one_mean_test | R Documentation |
This function will run a simulation-based hypothesis test for a single mean or median of a quantitative variable.
one_mean_test(
data,
null_value = 0,
summary_measure = "mean",
shift = 0,
as_extreme_as,
direction = c("greater", "less", "two-sided"),
number_repetitions = 1,
add_normal = FALSE
)
data |
Vector of quantitative data values. |
summary_measure |
Name of summary measure to return from simulations.
Allowed values are |
shift |
Amount to shift data values for bootstrapping of null distribution. |
as_extreme_as |
Value of observed mean. |
direction |
Direction of alternative hypothesis.
Allowed values are |
number_repetitions |
Number of simulated samples. |
add_normal |
Logical value indicating whether to superimpose a normal curve on the histogram. Defaults to FALSE. |
Returns plot of distribution of simulated statistics, with values as or more extreme than specified value highlighted, and reports proportion of simulations as or more extreme than specified as subtitle on plot.
set.seed(117)
x <- rnorm(25)
m <- mean(x)
one_mean_test(x,
summary_measure = "mean",
shift = -m,
as_extreme_as = m,
direction = "two-sided",
number_repetitions = 100
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.