
nauf
models.Obtain an anova table for a or
model. Currently only Type III tests
are supported.
# S3 method for nauf.lmerMod
anova(object, ..., refit = TRUE, model.names = NULL,
method = c("lme4", "S", "KR", "LRT", "PB", "nested-KR"),
test_intercept = FALSE, args_test = NULL)# S3 method for nauf.glmerMod
anova(object, ..., refit = TRUE, model.names = NULL,
method = c("lme4", "LRT", "PB"), test_intercept = FALSE,
args_test = NULL)
Additional nauf
models for the lme4
method. See
anova.merMod
.
For the lme4
method, a logical indicating whether
models fit with
REML
should be
refit with ML
prior to comparison with models in ...
; default
TRUE
. See anova.merMod
.
For the lme4
method, character vectors of model
names to be used in the anova table. See anova.merMod
.
The method for calculating p-values. See 'Details'.
For all methods besides lme4
, whether a test
should be performed for the intercept term (default FALSE
).
The object returned depends on the method, and has class
nauf.mer.anova
. For the lme4
,
S
, and KR
methods, it is an anova
table.
For the nested-KR
, PB
, and LRT
methods,
a list with the anova table and restricted models is returned (similar
to the output of mixed
).
There are six methods of p-value calculation which are supported:
The default method. See anova.merMod
.
nauf.lmerMod models only. Computes F-tests using the
Satterthwaite approximation of denominator degrees of freedom,
implemented with calcSatterth
.
nauf.lmerMod models only. If object
was fit with
maximum likelihood (ML
), then the model is refit with restricted
maximum likelihood (REML
) first. Then computes F-tests using the
Kenward-Roger approximation of denominator degrees of freedom,
implemented with Anova.merMod
.
nauf.lmerMod models only. If object
was fit
with maximum likelihood (ML
), then the model is refit with
restricted maximum likelihood (REML
) first. Then for each fixed
effects term, a restricted nested model is fit lacking only that fixed
effects term, and F-tests are computed using the Kenward-Roger
approximation of denominator degrees of freedom,
implemented with KRmodcomp
. The full model and
restricted models are returned along with the anova table, similar to
mixed
.
If object
is a fit with
REML
, it is first refit with ML
. Then restricted models
are fit as in the nested-KR
method, and Chi-squared (likelihood
ratio) tests are computed. The full model and restricted models are
returned along with the anova table, similar to
mixed
.
If object
is a fit with
REML
, it is first refit with ML
. Then likelihood ratios are
computed as for the LRT
method, and p-values for the likelihood
ratios are computed using parametric bootstrapping, implemented with
PBmodcomp
. The full model and restricted models
are returned along with the anova table, similar to
mixed
.
and
classes;
anova.merMod
for the lme4
method;
Anova.merMod
for the KR
method;
calcSatterth
for the S
method;
mixed
for the nested-KR
, LRT
, and
PB
methods; KRmodcomp
for the
nested-KR
method; PBmodcomp
for the
PB
method.
dat <- droplevels(subset(plosives, voicing == "Voiceless"))
dat$spont[dat$dialect == "Valladolid"] <- NA
sobj <- standardize(cdur ~ dialect * spont + (1 | speaker) + (1 | item), dat)
mod <- nauf_lmer(sobj$formula, sobj$data)
# lme4 method anova table
anova(mod)
# anova table using Satterthwaite approximation
anova(mod, method = "S")
# anova table using Kenward-Roger approximation
anova(mod, method = "KR")
# list with restricted models and Kenward-Roger table
anova(mod, method = "nested-KR")
# list with restricted models and parametric bootstrap table
# model is first refit with maximum likelihood
anova(mod, method = "PB")
# list with restricted models and likelihood ratio test table
# model is first refit with maximum likelihood
anova(mod, method = "LRT")
Run the code above in your browser using DataLab