predict.nauf.merMod: Predictions from a mixed effects 'nauf' model at new data...

Description Usage Arguments Value See Also Examples

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

Description

The predict method for nauf.glmerMod and nauf.lmerMod objects (the results of nauf_glmer, nauf_glmer.nb, and nauf_glmer). It is based on predict.merMod, but currently some options are not supported for nauf models.

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'nauf.glmerMod'
predict(object, newdata = NULL, newparams = NULL,
  re.form = NULL, ReForm, REForm, REform, terms = NULL, type = c("link",
  "response"), allow.new.levels = FALSE, na.action = na.pass, ...)

## S3 method for class 'nauf.lmerMod'
predict(object, newdata = NULL, newparams = NULL,
  re.form = NULL, ReForm, REForm, REform, terms = NULL, type = c("link",
  "response"), allow.new.levels = FALSE, na.action = na.pass, ...)

Arguments

object

A nauf.lmerMod or nauf.glmerMod.

newdata

A data frame to make predictions on.

newparams, terms, allow.new.levels

Changes to default values are not currently supported and result in an error.

re.form

Formula for random effects to condition on. Currently, only NULL (the default, indicating conditioning on all random effects in the model) and NA or ~ 0 (indicating to use only the fixed effects in the predictions) are supported (i.e. you cannot currently condition on a subset of the random effects).

ReForm, REForm, REform

Older versions of re.form in lme4 which are now deprecated.

type

Whether the predictions should be transformed with the inverse link function.

na.action

Changes from default of na.pass are ignored with a warning.

...

Additional parameters (currently unused and ignored with a warning).

Value

A numeric vector of predicted values.

See Also

predict.merMod, nauf_lmer, nauf_glmer, nauf_glmer.nb, nauf.lmerMod, and nauf.glmerMod.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
dat <- plosives
dat$spont[dat$dialect == "Valladolid"] <- NA
sobj <- standardize(intdiff ~ voicing * dialect * spont +
  (1 + voicing * spont | speaker) + (1 + dialect | item), dat)

mod <- nauf_lmer(sobj$formula, sobj$data)
fit <- predict(mod)  # fitted values
preds <- predict(mod, sobj$data)  # predict same data using all ranef
preds_fe <- predict(mod, sobj$data, re.form = NA)  # only use fixef

isTRUE(all.equal(fit, preds))  # TRUE
isTRUE(all.equal(preds, preds_fe))  # FALSE

## End(Not run)

nauf documentation built on June 20, 2017, 9:05 a.m.