PlotTree: Plot an ensemble tree

View source: R/PlotTree.R

PlotTreeR Documentation

Plot an ensemble tree

Description

Plot an ensemble tree

Usage

PlotTree(myfit, ...)

Arguments

myfit

A fitted ensemble tree.

\dots

Additional arguments for plotting the tree.

Examples


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")



ellenxtan/ifedtree documentation built on March 28, 2023, 9:09 a.m.