Description Usage Arguments Details Value Author(s) References See Also Examples
This function performs the residual bootstrap as described by Efron (1979) and wild bootstrap as described by Wu (1986) for ANOVA hypothesis testing. Linear models incorporating categorical and/or quantitative predictor variables with a quantitative response are allowed. The function output creates the bootstrap null distribution for each term to be tested. Estimation is performed via least squares and only Type I sum of squares are calculated.
1 2 |
formula |
input a linear model formula of the form |
B |
number of bootstrap samples. This should be a large, positive integer value. |
type |
type of bootstrap to perform. Select either "residual" for residual bootstrap or "wild" for wild bootstrap. |
wild.dist |
distribution used to create the wild bootstrap weights for the residuals. Allowed distributions include
|
seed |
optionally, set a value for the seed for the bootstrap sample generation. The default |
data |
optionally, input the name of the dataset where variables appearing in the model are stored. |
keep.boot.resp |
a boolean indicating whether the list of returns includes raw bootstrap responses. Setting this to TRUE may not be possible for larger datasets or too many bootstrap samples due to memory usage. |
Currently, the user must manipulate the output of the function manually to view the bootstrap ANOVA table components and visualize the null distribution. More convenient/streamlined output is expected in future package versions.
Thanks to Bochuan Lyu who helped to coding to this function.
terms |
names of the terms/rows of the ANOVA table. These correspond to each predictor variable input to the formula. |
df |
degrees of freedom associated with each term/row in the ANOVA table. These correspond to the number of categories in each predictor variable (or are 1 for quantitative predictors) |
origFStats |
original F-statistic value. Same value as obtained by |
origSSE |
original sum of squares, error. Same value as obtained by |
origSSTr |
original sum of squares, treatment. Vector containing the sum of squares for each term in the ANOVA model.
These are the same values as obtained by |
bootFStats |
matrix containing the bootstrap F statistics. Each column corresponds to a term in the ANOVA table. There
are |
bootSSE |
matrix containing the bootstrap sum of squares, error. Each column corresponds to a term in the ANOVA table. There
are |
bootSSTr |
matrix containing the bootstrap sum of squares, treatment. Each column corresponds to a term in the ANOVA table. There
are |
'p-values' |
vector containing the bootstrap p-values for each predictor term in the ANOVA model. These are calculated by
counting the number of bootstrap test statistics which are greater than the original observed test statistic and
dividing by |
Megan Heyman, heyman@rose-hulman.edu
Efron, B. (1979). "Bootstrap methods: Another look at the jackknife." Annals of Statistics. Vol. 7, pp.1-26.
Wu, C.F.J. (1986). "Jackknife, Bootstrap, and Other Resampling Methods in Regression Analysis." Annals of Statistics. Vol. 14, No. 4, pp.1261 - 1295.
1 2 3 4 5 6 7 8 9 | data(mtcars) #load an example dataset
myANOVA2 <- ANOVA.boot(mpg~as.factor(cyl)*as.factor(am), data=mtcars)
myANOVA2$`p-values` #bootstrap p-values for 2-way interactions model
myANOVA1 <- ANOVA.boot(mpg~as.factor(cyl), data=mtcars)
myANOVA1$`p-values` #bootstrap p-values for 1-way model
myANOVA2a <- ANOVA.boot(mpg~as.factor(cyl)+as.factor(am), data=mtcars)
myANOVA2a$`p-values` #bootstrap p-values for 1-way additive model
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.