predict.mixor: Predict Outcome From Mixor Fitted Model

Description Usage Arguments Details Value Author(s) See Also Examples

Description

predict method for class mixor.

Usage

1
2
## S3 method for class 'mixor'
predict(object, newdata = NULL, na.action = na.fail, ...)

Arguments

object

an object of class mixor.

newdata

an optional data frame to be used for obtaining predictions when the random effects are zero. When newdata is not supplied, the random effects estimates are used in obtaining model predictions. All variables used in the mixor model, the fixed and the random effects models, as well as the grouping factors, must be present in the data frame.

na.action

a function that indicates what should happen when newdata contains NAS. The default action (na.fail) causes the function to print an error message and terminate if there are any incomplete observations.

...

other arguments.

Details

This function returns fitted probabilities and the predicted class from a fitted mixor object. When the newdata parameter is specified, the random effects are taken to be zero and predictions are returned. Otherwise conditional predictions, which includes both fixed and random effects terms, for the observed data are returned.

Value

predicted

class specific probabilities from the fitted model.

class

predicted class, that having the largest fitted probability, from the fitted model.

Author(s)

Kellie J. Archer, Donald Hedeker, Rachel Nordgren, Robert D. Gibbons

See Also

See Also mixor, print.mixor

Examples

1
2
3
4
5
6
7
8
library("mixor")
data("schizophrenia")
### Random intercept
SCHIZO1.fit<-mixor(imps79o ~ TxDrug + SqrtWeek + TxSWeek, data=schizophrenia, 
     id=id, link="probit")
pihat<-predict(SCHIZO1.fit)
table(pihat$class, schizophrenia$imps79o)
head(pihat$predicted)

mixor documentation built on May 2, 2019, 5:56 a.m.