predict.mixor {mixor} | R Documentation |
predict
method for class mixor
.
## S3 method for class 'mixor' predict(object, newdata = NULL, na.action = na.fail, ...)
object |
an object of class |
newdata |
an optional data frame to be used for obtaining predictions when the random effects are zero. When |
na.action |
a function that indicates what should happen when |
... |
other arguments. |
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.
predicted |
class specific probabilities from the fitted model. |
class |
predicted class, that having the largest fitted probability, from the fitted model. |
Kellie J. Archer, Donald Hedeker, Rachel Nordgren, Robert D. Gibbons
See Also mixor
, print.mixor
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)