predict {StratSel} | R Documentation |
Prediction Function for Objects of the StratSel
Class
Description
Prediction function for objects of the StratSel
class. Provides either predictions for all observations in a model or for a specified profile. In addition, the function will either predict an outcome or three probabilities (indicating the probability for each outcome).
Usage
## S3 method for class 'StratSel'
predict(object, prob = FALSE, profile, ...)
Arguments
object |
An object of class |
prob |
Logical. If |
profile |
Vector. A vector defining a specific profile for which the prediction is made. |
... |
... |
Value
Either a matrix with dimension n * m
, where there are n
observations in the original model and m
is three (for the three possible outcomes) or it will be a vector with n
elements indicating for each observation which the most likely outcome would be.
Author(s)
Lucas Leemann lleemann@gmail.com
Examples
data(data.fake)
out1 <- StratSel(Y ~ var.A + var.B | var.C + var.D | var.E + var.C, data=data.fake, corr=FALSE)
predict(out1)
predict(out1, prob=TRUE)
predict(out1, profile=c(1,0.2,0.2,1,0.2,0.2,1,0.2,0.2))