anova.nauf.merMod: Type III anovas for mixed effects 'nauf' models.

Description Usage Arguments Details Value See Also Examples

View source: R/nauf.merMod-class-generic.R

Description

Obtain an anova table for a nauf.lmerMod or nauf.glmerMod model. Currently only Type III tests are supported.

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class '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 class 'nauf.glmerMod'
anova(object, ..., refit = TRUE, model.names = NULL,
  method = c("lme4", "LRT", "PB"), test_intercept = FALSE,
  args_test = NULL)

Arguments

object

A nauf.lmerMod or nauf.glmerMod.

...

Additional nauf models for the lme4 method. See anova.merMod.

refit

For the lme4 method, a logical indicating whether nauf.lmerMod models fit with REML should be refit with ML prior to comparison with models in ...; default TRUE. See anova.merMod.

model.names

For the lme4 method, character vectors of model names to be used in the anova table. See anova.merMod.

method

The method for calculating p-values. See 'Details'.

test_intercept

For all methods besides lme4, whether a test should be performed for the intercept term (default FALSE).

args_test

For methods nested-KR and PB, an optional named list of arguments to be passed to KRmodcomp and PBmodcomp, respectively.

Details

There are six methods of p-value calculation which are supported:

lme4

The default method. See anova.merMod.

S

nauf.lmerMod models only. Computes F-tests using the Satterthwaite approximation of denominator degrees of freedom, implemented with calcSatterth.

KR

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.

nested-KR

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.

LRT

If object is a nauf.lmerMod 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.

PB

If object is a nauf.lmerMod 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.

Value

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).

See Also

nauf.lmerMod and nauf.glmerMod 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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)

## Not run: 
# 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")

## End(Not run)

CDEager/nauf documentation built on May 6, 2019, 9:24 a.m.