MixRF: Mixed Random Forest

Description Usage Arguments Value Examples

Description

The function to fit a random forest with random effects.

Usage

1
2
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

 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

MixRF documentation built on May 1, 2019, 10:17 p.m.