| bootmodels | R Documentation |
Parametric bootstrap p-values for the terms and coefficients of a model. Responses are simulated from the model
fitted without its fixed effects (only an intercept, any offset, and the same random effects and covariance
structure: the global null hypothesis), the full model is refitted to each, and a p-value is (b + 1)/(B + 1), b
of the B simulated statistics being at least as large as the observed one. Results are the same for any
ncore. Useful for GLMs and GLMMs and small samples, where
Wald or F tests can be poor.
bootmodels(model, nsim = 999, type = c("I", "II", "III", "1", "2", "3"), seed = NULL,
ncore = 1, ...)
model |
A model fitted by |
nsim |
Number of simulated data sets, the default is 999. |
type |
The type of ANOVA table (as in |
seed |
Optional random number seed, for reproducible results; the user's random number stream is left as it was. |
ncore |
Number of cores for refitting, the default is 1. |
... |
Not used: |
The result has the same form as that of permmodels: its permlist can be given to
predictmeans or contrastmeans (argument permlist) for bootstrap p-values of
pairwise comparisons or contrasts (p.method "bootstrap" in the pairs table).
In a simulation study (500 data sets per case, 5% level; dev/sim-boot.R in the package sources) the
bootstrap corrected the liberal Wald chi-square test of a whole-plot factor in a split plot with 6 blocks (10%
to 6-7%, as Kenward-Roger) and kept the level in Poisson and binomial GLMMs, also when other terms had effects.
Like the likelihood-ratio test it relies on the model: with overdispersed counts fitted as Poisson it rejected
37% of true null hypotheses, where permmodels (Freedman-Lane on the working scale) gave 7%.
Invisibly, a list with permlist (the coefficients and covariance matrices of the refits),
COEFFICENTS and ANOVA (the model's tables with a Boot_p_value column). Attribute
"resampling" is "parametric bootstrap"; advice (e.g. on too few samples) in attr(, "advice")
(advice).
Dongwen Luo, Siva Ganesh and John Koolaard
permmodels, varcomp (test_method = "bootstrap"), advice
library(predictmeans)
Oats$nitro <- factor(Oats$nitro)
fm <- lmer(yield ~ nitro*Variety + (1|Block/Variety), data = Oats)
bt <- bootmodels(fm, nsim = 99, seed = 1) # use 999 or more in practice
predictmeans(fm, "nitro", permlist = bt)$pairs
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.