predict.MixRF: Prediction Function for MixRF

Description Usage Arguments Value Examples

Description

Prediction Function for MixRF

Usage

1
2
## S3 method for class 'MixRF'
predict(object, newdata, id = NULL, EstimateRE = TRUE)

Arguments

object

The fitted MixRF object.

newdata

A data frame contains the predictors for prediction.

id

The group variable in the new data.

EstimateRE

To use the estimated random effects in the prediction or not. The default is TRUE.

Value

A matrix (now for balanced data) contains the predicted values.

Examples

1
2
3
4
5
6
7
8
library(lme4)
library(randomForest)
data(sleepstudy)

tmp = MixRF(Y=sleepstudy$Reaction, x=as.data.frame(sleepstudy$Days), random='(Days|Subject)',
            data=sleepstudy, initialRandomEffects=0, ErrorTolerance=0.01, MaxIterations=100)

pred = predict.MixRF(object=tmp, newdata=sleepstudy, EstimateRE=TRUE)

randel/MixRF documentation built on May 26, 2019, 10:59 p.m.