Learn R Programming

doBy (version 4.4.0)

PBmodcomp: Model comparison of mixed models using parametric bootstrap methods.

Description

Model comparison of mixed models using parametric bootstrap methods.

Usage

PBmodcomp(largeModel, smallModel, nsim = 200, ref = NULL, cl = NULL, details = 0)
## S3 method for class 'mer':
PBmodcomp(largeModel, smallModel, nsim = 200, ref = NULL, cl = NULL, details = 0)
BCmodcomp(largeModel, smallModel, nsim = 200, ref = NULL, cl = NULL, details = 0)
## S3 method for class 'mer':
BCmodcomp(largeModel, smallModel, nsim = 200, ref = NULL, cl = NULL, details = 0)

Arguments

largeModel
A linear mixed effects model as fitted with the lmer() function in the lme4 package. This model muse be larger than smallModel (see below).
smallModel
A linear mixed effects model as fitted with the lmer() function in the lme4 package. This model muse be smaller than largeModel (see above).
nsim
The number of simulations to form the reference distribution.
ref
Vector containing samples from the reference distribution. If NULL, this vector will be generated using PBrefdist().
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.

Value

  • ## To be added...

Details

## To be added...

References

## To be added...

See Also

KRmodcomp

Examples

Run this code
library(doBy)
data(beets)
head(beets)
beet0<-lmer(sugpct~block+sow+harvest+(1|block:harvest), data=beets, REML=FALSE)
beet_no.harv <- update(beet0, .~.-harvest)
BCmodcomp(beet0, beet_no.harv, nsim=20)

## Vanilla
PBmodcomp(beet0, beet_no.harv)
BCmodcomp(beet0, beet_no.harv)
## Simulate reference distribution separately:
rr <- PBrefdist(beet0, beet_no.harv, nsim=20)
PBmodcomp(beet0, beet_no.harv, ref=rr)
BCmodcomp(beet0, beet_no.harv, ref=rr)

Run the code above in your browser using DataLab