Description Usage Arguments Details Value Author(s) See Also Examples
Backward elimination of random-effect terms followed by backward elimination of fixed-effect terms in linear mixed models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
object |
a fitted model object. For the |
ddf |
the method for computing the denominator degrees of freedom and
F-statistics. |
alpha.random |
alpha for random effects elimination |
alpha.fixed |
alpha for fixed effects elimination |
reduce.fixed |
reduce fixed effect structure? |
reduce.random |
reduce random effect structure? |
keep |
an optional character vector of fixed effect terms which should
not be considered for eliminated. Valid terms are given by
|
... |
currently not used. |
x |
a step object. |
Tests of random-effects are performed using ranova
(using
reduce.terms = TRUE
) and tests of fixed-effects are performed using
drop1
.
The step method for lmer
fits has a print method.
step
returns a list with elements "random"
and
"fixed"
each
containing anova-like elimination tables. The "fixed"
table is
based on drop1
and the "random"
table is
based on ranova
(a drop1
-like table for random effects). Both
tables have a column "Eliminated"
indicating the order in which terms
are eliminated from the model with zero (0
) indicating that the term
is not eliminated from the model.
The step
object also contains the final model as an attribute which
is extractable with get_model(<step_object>)
.
Rune Haubo B. Christensen and Alexandra Kuznetsova
drop1
for tests of marginal
fixed-effect terms and ranova
for a
drop1
-like table of reduction of
random-effect terms.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Fit a model to the ham dataset:
fm <- lmer(Informed.liking ~ Product*Information+
(1|Consumer) + (1|Product:Consumer)
+ (1|Information:Consumer), data=ham)
# Backward elimination using terms with default alpha-levels:
(step_res <- step(fm))
final <- get_model(step_res)
anova(final)
## Not run:
# Fit 'big' model:
fm <- lmer(Informed.liking ~ Product*Information*Gender*Age +
+ (1|Consumer) + (1|Consumer:Product) +
(1|Consumer:Information), data=ham)
step_fm <- step(fm)
step_fm # Display elimination results
final_fm <- get_model(step_fm)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.