permTestAnova {CarletonStats} | R Documentation |
Permutation test for ANOVA F-test
Description
Permutation test to see if the population mean is the same for two or more
populations. For instance, test latex
where
latex
denotes the population mean. The values of the numeric
variable are randomly assigned to the groups and the ANOVA F statistic is
calculated. The command will print the mean and
standard error of the distribution of the test statistic as well as a
P-value.
Usage
permTestAnova(x, ...)
## Default S3 method:
permTestAnova(
x,
group,
B = 9999,
plot.hist = TRUE,
plot.qq = FALSE,
xlab = NULL,
ylab = NULL,
title = NULL,
seed = NULL,
...
)
## S3 method for class 'formula'
permTestAnova(formula, data = parent.frame(), subset, ...)
Arguments
x |
a numeric vector. |
... |
further arguments to be passed to or from methods. |
group |
a factor variable with two or more levels. If |
B |
the number of resamples (positive integer greater than 2). |
plot.hist |
a logical value. If |
plot.qq |
a logical value. If |
xlab |
an optional character string for the x-axis label |
ylab |
an optional character string for the y-axis label |
title |
an optional character string giving the plot title |
seed |
optional argument to |
formula |
a formula of the form |
data |
a data frame with the variables in the formula. |
subset |
an optional expression specifying which observations to keep. |
Details
Observations with missing values are removed.
Value
Returns invisibly a vector of the replicates of the test statistic.
Methods (by class)
-
permTestAnova(default)
: Permutation test for ANOVA F-test -
permTestAnova(formula)
: Permutation test for ANOVA F-test
Author(s)
Adam Loy, Laura Chihara
References
Tim Hesteberg's website: https://www.timhesterberg.net/bootstrap-and-resampling
Examples
permTestAnova(states03$ViolentCrime, states03$Region, B = 499)
#using formula syntax
## Not run:
permTestAnova(ViolentCrime ~ Region, data = states03, B = 9999)
## End(Not run)