LRT
performs a likelihood ratio (LR) test between two model fits, the ``full'' and the ``null'' model fits,
currently differing only in their fixed effects. Parametric bootstrap p-values can be computed, either using the raw bootstrap distribution of the likelihood ratio, or a a bootstrap estimate of the Bartlett correction of the LR statistic.
This function differ from fixedLRT
in its arguments (model fits for LRT
, but all arguments required to fit the models for fixedLRT
), and in the format of its return value. The function will stop or return possibly incorrect results for models differing beyond their fixed effects. By conceptual drift, anova
works as an alias for LRT
.## S3 method for class 'HLfit':
anova(object,object2,...)
LRT(object,object2,boot.repl=0)
LRT(object,object2,boot.repl=0)
fixedLRT
, actually a list with as-yet unstable format, but here with typical elements (depending on the options)(1+sum(t >= t0))/(N+1)
where t0
is the original likelihood ratio, t
the vector of bootstrap replicates and N
its length. See Davison & Hinkley (1997, p. 141) for discusion of the adjustments in this formula.
The bootstrap can also be used to provide a Bartlett correction for the likelihood ratio test in small sample. According to this correction, the mean value $m$ of the likelihood ratio statistic under the null hypothesis is computed (here estimated by a parametric bootstrap) and the original LR statistic is multiplied by $n/m$ where $n$ is the number of degrees of freedom of the test.fixedLRT
.data(wafers)
## Gamma GLMM with log link
m1 <- HLfit(y ~X1+X2+X1*X3+X2*X3+I(X2^2)+(1|batch),family=Gamma(log),
resid.formula = ~ X3+I(X3^2) ,data=wafers,HLmethod="ML")
m2 <- update(m1,formula.= ~ . -I(X2^2))
anova(m1,m2)
Run the code above in your browser using DataLab