Description Usage Arguments Value See Also Examples
View source: R/nauf.merMod-class-generic.R
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.
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, ...)
|
object |
A |
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
|
ReForm, REForm, REform |
Older versions of |
type |
Whether the predictions should be transformed with the inverse link function. |
na.action |
Changes from default of |
... |
Additional parameters (currently unused and ignored with a warning). |
A numeric vector of predicted values.
predict.merMod
, nauf_lmer
,
nauf_glmer
, nauf_glmer.nb
,
nauf.lmerMod
, and nauf.glmerMod
.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.