## ------------------------------------------------------------
## survival example
## ------------------------------------------------------------
#default split rule
data(pbc, package = "randomForestSRC")
pbc.d <- impute.rfsrc(Surv(days, status) ~ ., data = pbc, nsplit = 3)
#random splitting is fast and works well
pbc2.d <- impute.rfsrc(Surv(days, status) ~ ., data = pbc, splitrule = "random")
summary(pbc.d - pbc2.d)
## ------------------------------------------------------------
## regression.example
## ------------------------------------------------------------
air.d <- impute.rfsrc(Ozone ~ ., data = airquality, nimpute = 5)
air2.d <- impute.rfsrc(Ozone ~ ., data = airquality, nimpute = 5, splitrule = "random")
## ------------------------------------------------------------
## unsupervised example
## we impute without distinction between y-outcomes and x-variables
## we are invoking random splitting
## all variables are imputed
## ------------------------------------------------------------
data(pbc, package = "randomForestSRC")
pbcR.d <- impute.rfsrc(data = pbc, nimpute = 5)
airR.d <- impute.rfsrc(data = airquality, nimpute = 5)
Run the code above in your browser using DataLab