Description Usage Arguments Value Examples
The function to fit a random forest with random effects.
1 2 |
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. |
A list contains the random forest ($forest), mixed model ($MixedModel), and random effects ($RandomEffects). See the example below for the usage.
1 2 3 4 5 6 7 8 9 10 11 | 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.