two_mean_test | R Documentation |
This function will run a simulation-based hypothesis test for a difference in means or difference in medians of a quantitative variable for two independent groups.
two_mean_test(
formula,
data,
summary_measure = "mean",
first_in_subtraction,
as_extreme_as,
direction = c("greater", "less", "two-sided"),
number_repetitions = 1,
add_normal = FALSE
)
formula |
Formula of the form |
data |
Data frame with columns for response and predictor variables. |
summary_measure |
Name of summary measure to return from simulations.
Allowed values are
|
first_in_subtraction |
Value of predictor variable that should be first in order of subtraction for computing difference in means. |
as_extreme_as |
Value of observed difference in means. |
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.
data(pt)
two_mean_test(responses ~ brand,
data = pt,
first_in_subtraction = "B1",
as_extreme_as = -.4,
direction = "two-sided",
number_repetitions = 1000
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.