fixedLRT
performs a likelihood ratio (LR) test between two models, the ``full'' and the ``null'' models,
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 LRT
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.fixedLRT(null.formula, formula, data,
method, HLmethod = method, REMLformula=NULL,
boot.repl=0, control=list(),control.boot=list(),
fittingFunction, nb_cores=NULL, ...)
formula
(as in glm
) or a predictor
(see Predictor
) for the null model.
formula
or a predictor
for the full model.
HLfit
's HLmethod
argument for background information about such methods.
The two most meaningful values of method
in fixedLRT
calls are:
'ML'
for an LRT based on ML fits (generally recommended); and
'PQL/L'
for an LRT based on PQL/L fits (recommended for spatial binary data).
Also feasible, but more tricky, and not really recommended (see Rousset and Ferdy, 2014), is 'REML'
.
This will perform an LRT based on two REML fits of the data, *both* of which use the
same conditional (or “restricted”) likelihood of residuals for estimating dispersion parameters \(\lambda\) and \(\phi\) (see REMLformula
argument).
Further, REML will not be effective on a given dispersion parameter if a non-trivial init.corrHLfit value is provided for this parameter.
method
, but wll work only for fittingFunction=corrHLfit
.
control=list(prefits=TRUE)
(the effect appears small, however).
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.
"corrHLfit"
or "fitme"
.spaMM.getOption("nb_cores")
, and 1 if the latter is NULL. nb_cores=1
which prevents the use of parallelisation procedures.corrHLfit
, including mandatory ones such as data
and those ultimately passed to designL.from.Corr
. With respect to the latter, note that try.chol
affects the simulation of samples for the parametric bootstrap, and although ultimate differences in performance may be small, try.chol=FALSE
may be slightly better.
fixedLRT
, actually a list with as-yet unstable format, but here with typical elements (depending on the options)
and, if a bootstrap was performed, the additional elements described in LRT
.
See Details in LRT
for details of the bootstrap procedures.
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.
corrHLfit
and LRT
.if (spaMM.getOption("example_maxtime")>1.4) {
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)
}
if (spaMM.getOption("example_maxtime")>150) {
## 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