Description Usage Arguments Details Value Author(s) References See Also Examples
Calculate reference distribution of likelihood ratio statistic in mixed effects models using parametric bootstrap
1 2 3 4 5 6 7 8 9 10 11 12 13 14  PBrefdist(largeModel, smallModel, nsim = 1000, seed = NULL, cl = NULL,
details = 0)
## S3 method for class 'lm'
PBrefdist(largeModel, smallModel, nsim = 1000, seed = NULL,
cl = NULL, details = 0)
## S3 method for class 'merMod'
PBrefdist(largeModel, smallModel, nsim = 1000, seed = NULL,
cl = NULL, details = 0)
## S3 method for class 'mer'
PBrefdist(largeModel, smallModel, nsim = 1000, seed = NULL,
cl = NULL, details = 0)

largeModel 
A linear mixed effects model as fitted with the

smallModel 
A linear mixed effects model as fitted with the

nsim 
The number of simulations to form the reference distribution. 
seed 
Seed for the random number generation. 
cl 
A vector identifying a cluster; used for calculating the reference distribution using several cores. See examples below. 
details 
The amount of output produced. Mainly relevant for debugging purposes. 
The model object
must be fitted with maximum likelihood
(i.e. with REML=FALSE
). If the object is fitted with restricted
maximum likelihood (i.e. with REML=TRUE
) then the model is
refitted with REML=FALSE
before the pvalues are calculated. Put
differently, the user needs not worry about this issue.
A numeric vector
S<c3><b8>ren H<c3><b8>jsgaard [email protected]
Ulrich Halekoh, S<c3><b8>ren H<c3><b8>jsgaard (2014)., A KenwardRoger Approximation and Parametric Bootstrap Methods for Tests in Linear Mixed Models  The R Package pbkrtest., Journal of Statistical Software, 58(10), 130., http://www.jstatsoft.org/v59/i09/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  data(beets)
head(beets)
beet0 < lmer(sugpct ~ block + sow + harvest + (1block : harvest), data=beets, REML=FALSE)
beet_no.harv < update(beet0, .~.harvest)
rr < PBrefdist(beet0, beet_no.harv, nsim=20)
rr
## Note: Many more simulations must be made in practice.
## Computations can be made in parallel using several processors:
## Not run:
cl < makeSOCKcluster(rep("localhost", 4))
clusterEvalQ(cl, library(lme4))
clusterSetupSPRNG(cl)
rr < PBrefdist(beet0, beet_no.harv, nsim=20)
stopCluster(cl)
## End(Not run)
## Above, 4 cpu's are used and 5 simulations are made on each cpu.

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.