Learn R Programming

spaMM (version 1.1)

fixedLRT: Likelihood ratio test of fixed effects.

Description

fixedLRT performs a likelihood ratio (LR) test between two models, the ``full'' and the ``null'' models, currently differing only in their fixed effects. This is the recommended interface to corrHLfit for performing such tests. Both models are fit in same way, i.e. by ML, or allowing some REML correction for the estimation of dispersion parameters. A Bartlett correction of the LR statistic can be estimated using the bootstrap.

Usage

fixedLRT(null.formula,formula,data,HLmethod,REMLformula=NULL,boot.repl=0,
          control=list(),control.boot=list(),...)

Arguments

null.formula
Either a formula (as in glm) or a predictor (see Predictor) for the null model.
formula
Either a formula or a predictor for the full model.
data
A data frame containing the variables in the model.
HLmethod
A method to fit the full and null models. See the identically-named HLfit argument for background information about such methods. The two most meaningful values of HLmethod in fix
REMLformula
a formula specifying the fixed effects which design matrix is used in the REML correction for the estimation of dispersion parameters, if these are estimated by REML. This formula is by default that for the *full* model.
boot.repl
the number of bootstrap replicates.
control
A set of control parameter for the fits of the data, mostly for development purposes. However, if an initial value is provided for a dispersion parameter, a better one may be sought if further control=list(prefits=TRUE) (the effect appears sm
control.boot
Same as control, but for the fits of the bootstrap replicates. Again, the option control.boot=list(prefits=TRUE) may yield a small improvement in the fits, at the expense of more computation time.
...
Additional arguments passed to corrHLfit, including mandatory ones such as data and those ultimately passed to designL.from.Corr. With respect to the latter, note in particular that try.chol affects the

Value

  • An object of class fixedLRT, actually a list with typical elements (depending on the options)
  • fullfitthe HLfit objects for the full model,
  • nullfitthe HLfit objects for the null model,
  • LRToriA likelihood ratio chi-square statistic
  • LRTprofAnother likelihood ratio chi-square statistic, after a profiling step, if any.
  • dfthe number of degrees of freedom of the test.
  • trace.infoInformation on various steps of the computation.
  • bootrepsA table of fitted likelihoods for bootstrap replicates.
  • meanbootLRTThe mean likelihood ratio chi-square statistic for boostrap replicates.

Details

Comparison of REML fits is a priori not suitable for performing likelihood ratio tests. Nevertheless, it is possible to contrive them for testing purposes (Wehlam & Thompson 1997). This function generalizes some of Wehlam & Thompson's methods to GLMMs. It further provides 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. Rousset F., Ferdy, J.-B. (2014) Testing environmental and genetic effects in the presence of spatial autocorrelation. Ecography, in press. http://dx.doi.org/10.1111/ecog.00566 Welham, S. J., and Thompson, R. 1997. Likelihood ratio tests for fixed model terms using residual maximum likelihood, J. R. Stat. Soc. B 59, 701-714.

See Also

See also corrHLfit.

Examples

Run this code
data(blackcap)
## result comparable to the corrHLfit examples based on blackcap
fixedLRT(null.formula=migStatus ~ 1 + Matern(1|latitude+longitude),
       formula=migStatus ~ means + Matern(1|latitude+longitude), 
       HLmethod='ML',data=blackcap)

## longer version with bootstrap
fixedLRT(null.formula=migStatus ~ 1 + Matern(1|latitude+longitude),
       formula=migStatus ~ means + Matern(1|latitude+longitude), 
       HLmethod='ML',data=blackcap, boot.repl=100)

Run the code above in your browser using DataLab