View source: R/plot.vimp.boostmtree.R
| plot.vimp.boostmtree | R Documentation |
Plot variable-importance objects returned by vimp.boostmtree().
## S3 method for class 'vimp.boostmtree'
plot(
x,
show.interaction = TRUE,
show.time.effect = TRUE,
output = c("plot", "data", "pdf"),
file = NULL,
main = "Variable importance (%)",
col = grey(0.80),
cex.names = 0.8,
eps = 0.1,
...
)
x |
An object of class |
show.interaction |
Logical value indicating whether time-interaction effects should be displayed when available. |
show.time.effect |
Logical value indicating whether the time-only effect should be reported in the plot margin when available. |
output |
One of |
file |
File name used when |
main |
Main title for the plot. |
col |
Bar color. |
cex.names |
Text magnification for variable names on the x-axis. |
eps |
Small amount added above the plotted range. |
... |
Additional arguments passed to |
The default behavior is to draw the variable-importance plot on the active graphics device.
For longitudinal fits, the plot shows main covariate effects above the x-axis and time-interaction effects below the x-axis. When available, the time-only effect is reported in the plot margin.
When output = "data", the function returns the plotting data instead of
drawing anything. This can be useful if you want to customize the display.
If output = "plot" or output = "pdf", the function returns the
input object invisibly.
If output = "data", the function returns a list containing the plotting
data for each response component.
set.seed(19)
sim.obj <- simLong(n = 15, n.time = 4, model = 1, family = "continuous")
dta <- sim.obj$data.list
fit <- boostmtree(
x = dta$features,
tm = dta$time,
id = dta$id,
y = dta$y,
family = "continuous",
M = 5,
cv.flag = TRUE,
verbose = FALSE,
control = boostmtree.control(seed = 19)
)
vimp.obj <- vimp.boostmtree(fit, x.names = c("x1", "x2"))
plot(vimp.obj)
plot.data <- plot(vimp.obj, output = "data")
str(plot.data, max.level = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.