Specify a statistical test to apply
1 2 3 4 5 6 7 8 9 10
an explanatory variable to test (character).
the type of test to apply (see Details).
a null model for comparison (formula).
Test a single fixed effect, specified by
Compare the current model to a smaller one specified by the formula
compare, but only the fixed/random part of the formula needs to be supplied.
Test the significance of a single random effect.
A function which takes a fitted model as an argument and returns a single p-value.
method argument can be used to specify one of the following tests.
"z" is an asymptotic approximation for models not fitted
"kr" will only work with models
Z-test for models fitted with
using the p-value from
For models fitted with
lmer, this test can be used to
treat the t-values from
z-values, which is equivalent to assuming infinite degrees of freedom.
This asymptotic approximation seems to perform well for even medium-sized
data sets, as the denominator degrees of freedom are already quite large
(cf. Baayen et al. 2008) even if calculating their exact value is
analytically unsolved and computationally difficult (e.g. with
Satterthwaite or Kenward-Roger approximations). Setting
alpha=0.045 is roughly equal to the t=2 threshold suggested by
Baayen et al. (2008) and helps compensate for the slightly
T-test for models fitted with
lm. Also available for mixed models
lmerTest is installed, using the p-value calculated
using the Satterthwaite approximation for the denominator degrees of
freedom by default. This can be changed by setting
Likelihood ratio test, using
Wald F-test, using
Useful for examining categorical terms. For models fitted with
lmer, this should yield equivalent results to
method='kr'. Uses Type-II tests by default, this can be changed
Wald Chi-Square test, using
Please note that while this is much faster than the F-test computed with
Kenward-Roger, it is also known to be anti-conservative, especially for
small samples. Uses Type-II tests by default, this can be changed by
ANOVA-style F-test, using
For 'lm', this yields a Type-I (sequential) test (see
to use other test types, use the F-tests provided by
(see above). For
lmer, this generates Type-II tests with
Satterthwaite denominator degrees of freedom by default, this can be
changed by setting
Kenward-Roger test, using
This only applies to models fitted with
lmer, and compares models with
different fixed effect specifications but equivalent random effects.
Parametric bootstrap test, using
This test will be very accurate, but is also very computationally expensive.
random for a single random effect call
Baayen, R. H., Davidson, D. J., and Bates, D. M. (2008). Mixed-effects modeling with crossed random effects for subjects and items. Journal of Memory and Language, 59, 390–412.
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.