Visualize the distribution of the simulation-based inferential statistics or the theoretical distribution (or both!).

visualize(
data,
bins = 15,
method = "simulation",
dens_color = "black",
obs_stat = NULL,
obs_stat_color = "red2",
pvalue_fill = "pink",
direction = NULL,
endpoints = NULL,
endpoints_color = "mediumaquamarine",
ci_fill = "turquoise",
...
)

visualise(
data,
bins = 15,
method = "simulation",
dens_color = "black",
obs_stat = NULL,
obs_stat_color = "red2",
pvalue_fill = "pink",
direction = NULL,
endpoints = NULL,
endpoints_color = "mediumaquamarine",
ci_fill = "turquoise",
...
)

## Arguments

data The output from calculate(). The number of bins in the histogram. A string giving the method to display. Options are "simulation", "theoretical", or "both" with "both" corresponding to "simulation" and "theoretical". A character or hex string specifying the color of the theoretical density curve. A numeric value or 1x1 data frame corresponding to what the observed statistic is. Deprecated (see Details). A character or hex string specifying the color of the observed statistic as a vertical line on the plot. Deprecated (see Details). A character or hex string specifying the color to shade the p-value. In previous versions of the package this was the shade_color argument. Deprecated (see Details). A string specifying in which direction the shading should occur. Options are "less", "greater", or "two_sided" for p-value. Can also give "left", "right", or "both" for p-value. For confidence intervals, use "between" and give the endpoint values in endpoints. Deprecated (see Details). A 2 element vector or a 1 x 2 data frame containing the lower and upper values to be plotted. Most useful for visualizing conference intervals. Deprecated (see Details). A character or hex string specifying the color of the observed statistic as a vertical line on the plot. Deprecated (see Details). A character or hex string specifying the color to shade the confidence interval. Deprecated (see Details). Other arguments passed along to \ggplot2\ functions.

## Value

A ggplot object showing the simulation-based distribution as a histogram or bar graph. Also used to show the theoretical curves.

## Details

In order to make visualization workflow more straightforward and explicit visualize() now only should be used to plot statistics directly. That is why arguments not related to this task are deprecated and will be removed in a future release of \infer\.

# to plot a theoretical null distribution, skip the generate() # step and supply method = "theoretical" to visualize() null_dist_theoretical <- gss %>% specify(response = hours) %>% hypothesize(null = "point", mu = 40) %>% calculate(stat = "t") visualize(null_dist_theoretical, method = "theoretical")
# to plot both a theory-based and simulation-based null distribution, # use the simulation-based null distribution and supply # method = "both" to visualize() visualize(null_dist, method = "both")