Learn R Programming

mvtboost (version 0.5.0)

plot.mvtb: Plots the model implied effect of 1 predictor for one outcome

Description

Plots the model implied effect of 1 predictor for one outcome

Usage

"plot"(x, predictor.no = 1, response.no = 1, n.trees = NULL, X = NULL, xlab = NULL, ylab = NULL, return.grid = FALSE, ...)

Arguments

x
mvtb output object
predictor.no
index of the predictor variable
response.no
index of the response variable
n.trees
desired number of trees. Defaults to the minimum number of trees by CV, test, or training error
X
optional vector, matrix, or data.frame of predictors. If included, a 'rug' (a small vertical line for each observation) is plotted on the x-axis showing the density of predictor.no.
xlab
label of the x axis
ylab
label of the y axis
return.grid
TRUE/FALSE return the prediction grid from gbm. Default is FALSE.
...
extra arguments are passed to plot. See ?par

Value

Produces a plot of the model implied effect along with the relative influence of the predictor. If return.grid=TRUE, returns the plotting matrix as well.

Details

This is the classic partial dependence plot, where the model implied effect of the chosen predictor is plotted controlling for the other predictors. In addition to the model-implied effect, the relative influence of the predictor is included in the x-axis label. If this is not desired, a custom label can be provided via xlab.

See Also

plot.gbm, mvtb.perspec, for other plots, mvtb.heat to plot the covariance explained by predictors in a heatmap