ffRanefLMER.fnc {LMERConvenienceFunctions} | R Documentation |
Forward-fit the random effect structure of an LMER model.
Description
Forward-fit an LMER model's random effect structure by comparing a model without one of the specified random effects and a model with it by way of log-likelihood ratio testing. If the more complex model is a significantly better fit, the random effect is kept, otherwise it is dropped. This function can now be used with generalized linear mixed-effects models (glmer
s).
Usage
ffRanefLMER.fnc(model, ran.effects = list(ran.intercepts =
as.character(), slopes = as.character(), corr = as.character(),
by.vars = as.character()), alpha = 0.05, if.warn.not.add = TRUE,
log.file = NULL)
Arguments
model |
A |
ran.effects |
Can be either a vector or a list. In the former case, the random effects to be evaluated are provided. For example |
alpha |
Level of significance for log-likelihood ratio test. Defaults to 0.05. |
if.warn.not.add |
Logical. If a warning is issued after fitting a model with a new random effect (e.g., |
log.file |
Should the back-fitting log be saved? Defaults to |
Value
A mer
object with forward-fitted random effect structure as well as a log of the process is printed on screen and, optionally, printed in a log file.
Note
The removal of a random effect from the random effects structure if the variables that compose it are not also in the fixed effects structure has been turned off in this version.
Author(s)
Antoine Tremblay, Statistics Canada, trea26@gmail.com
.
References
Pinheiro, J.C. and Bates, D.M. (2000). Mixed Effects Models in S and S-Plus. New York: Springer.
See Also
bfFixefLMER_F.fnc;
bfFixefLMER_t.fnc;
fitLMER.fnc;
mcposthoc.fnc;
pamer.fnc;
mcp.fnc;
romr.fnc;
perSubjectTrim.fnc.
Examples
# see example in LMERConvenienceFunctions help page.