regression_test | R Documentation |
This function will run a simulation-based hypothesis test for a slope of simple linear regression or correlation between two quantitative variables.
regression_test(
formula,
data,
summary_measure = c("slope", "correlation"),
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
|
as_extreme_as |
Value of observed slope or correlation. |
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. |
data(mtfires)
mtfires$logHect <- log(mtfires$Hectares)
regression_test(logHect ~ Temperature,
data = mtfires,
summary_measure = "correlation",
as_extreme_as = 1.388,
direction = "greater",
number_repetitions = 1000
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.