predict.MixRF: Prediction Function for MixRF

Description Usage Arguments Value Examples

View source: R/predict.MixRF.r View source: R/MixRFb.r

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)

lschen-stat/MixRF documentation built on May 14, 2019, 11:27 a.m.