PlotTree | R Documentation |
Plot an ensemble tree
PlotTree(myfit, ...)
myfit |
A fitted ensemble tree. |
\dots |
Additional arguments for plotting the tree. |
data(SimDataLst)
K <- length(SimDataLst)
covars <- grep("^X", names(SimDataLst[[1]]), value=TRUE)
fit_lst <- list()
for (k in 1:K) {
tmpdf <- SimDataLst[[k]]
# use your estimator of interest
fit_lst[[k]] <- grf::causal_forest(X=as.matrix(tmpdf[, covars, with=FALSE]),
Y=tmpdf$Y, W=tmpdf$Z)
}
coord_id <- 1
coord_df <- SimDataLst[[coord_id]]
aug_df <- GenAugData(coord_id, coord_df, fit_lst, covars)
myfit <- EnsemTree(coord_id, aug_df, "site", covars)$myfit
PlotTree(myfit, main="Ensemble Tree")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.