Learn R Programming

spaMM (version 1.4.1)

LRT: Likelihood ratio test of fixed effects.

Description

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.

Usage

## S3 method for class 'HLfit':
anova(object,object2,...)
LRT(object,object2,boot.repl=0)  
LRT(object,object2,boot.repl=0)

Arguments

object,object2
Two models fits being compared (their order does not matter).
boot.repl
the number of bootstrap replicates.
...
Further arguments passed to or from other methods.

Value

  • An object of class fixedLRT, actually a list with as-yet unstable format, but here with typical elements (depending on the options)
  • fullfitthe HLfit object for the full model;
  • nullfitthe HLfit object for the null model;
  • basicLRTA data frame including values of the likelihood ratio statistic, its degrees of freedom, and the p-value;
  • and, if a bootstrap was performed:
  • rawBootLRTA data frame including values of the likelihood ratio statistic, its degrees of freedom, and the raw bootstrap p-value;
  • BartBootLRTA data frame including values of the Bartlett-corrected likelihood ratio statistic, its degrees of freedom, and its p-value;
  • bootInfoa list with the following elements: [object Object],[object Object]

Details

A raw bootstrap p-value can also be computed from the simulated distribution as (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.

References

Bartlett, M. S. (1937) Properties of sufficiency and statistical tests. Proceedings of the Royal Society (London) A 160: 268-282. Davison A.C., Hinkley D.V. (1997) Bootstrap methods and their applications. Cambridge Univ. Press, Cambridge, UK.

See Also

See also fixedLRT.

Examples

Run this code
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