MixRF {MixRF} | R Documentation |
Mixed Random Forest
Description
The function to fit a random forest with random effects.
Usage
MixRF(Y, X, random, data, initialRandomEffects = 0, ErrorTolerance = 0.001,
MaxIterations = 1000)
Arguments
Y |
The outcome variable. |
X |
A data frame or matrix contains the predictors. |
random |
A string in lme4 format indicates the random effect model. |
data |
The data set as a data frame. |
initialRandomEffects |
The initial values for random effects. |
ErrorTolerance |
The tolerance for log-likelihood. |
MaxIterations |
The maximum iteration times. |
Value
A list contains the random forest ($forest), mixed model ($MixedModel), and random effects ($RandomEffects). See the example below for the usage.
Examples
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)
# tmp$forest
# tmp$MixedModel
# tmp$RandomEffects
[Package MixRF version 1.0 Index]