plot.TSVC | R Documentation |
Visualization of trees of effects of covariates that vary with the values of one or several effect modifiers.
## S3 method for class 'TSVC'
plot(
x,
variable,
ellipse_a = 0.8,
ellipse_b = 0.2,
ellipse_x = 0,
ellipse_y = 0,
branch_adj = 0,
cex.lines = 2,
cex.branches = 1,
cex.coefs = 1,
cex.main = 1,
cex.numbers = 1,
draw_numbers = TRUE,
title = NULL,
decimals = 3,
confint = NULL,
...
)
x |
a fitted object of class |
variable |
name of the variable, for which the tree shall be plotted. |
ellipse_a |
controls width of ellipses containing coefficient estimates. |
ellipse_b |
controls height of ellipses containing coefficient estimates. |
ellipse_x |
controls location on x-axis of ellipses containing coefficient estimates. |
ellipse_y |
controls location on y-axis of ellipses containing coefficient estimates. |
branch_adj |
vertical adjustment of branch labels. |
cex.lines |
width of branches of the tree. |
cex.branches |
size of the labels of the tree. |
cex.coefs |
size of the coefficients in the terminal nodes of the tree. |
cex.main |
size of the title of the tree. |
cex.numbers |
size of the internally used node number. |
draw_numbers |
if |
title |
optional title, which is addded to the tree; if |
decimals |
number of decimals of coefficient estimates. Per default the coefficient estimates are displayed with three decimals. |
confint |
optional fitted object of class |
... |
further arguments passed to or from other methods. |
Moritz Berger <Moritz.Berger@imbie.uni-bonn.de>
https://www.imbie.uni-bonn.de/people/dr-moritz-berger/
Berger, M., G. Tutz and M. Schmid (2019). Tree-Structured Modelling of Varying Coefficients. Statistics and Computing 29, 217-229, https://doi.org/10.1007/s11222-018-9804-8.
TSVC
, predict.TSVC
, summary.TSVC
# Swiss Labour Market
library(AER)
data("SwissLabor")
# recode factors
sl <- SwissLabor
sl$participation <- as.numeric(sl$participation)-1
sl$foreign <- as.numeric(sl$foreign)-1
## Not run:
fit1 <- TSVC(participation~income+age, data=sl, family=binomial(link="logit"),
nperm=1000, trace=TRUE)
plot(fit1, "income")
fit2 <- TSVC(participation~income+age, data=sl, family=binomial(link="logit"),
perm_test=FALSE, test_linear=FALSE, splits_max=3)
set.seed(20012025)
ci2 <- confint(fit2, bootstrap_n=500, alpha=0.05, trace=TRUE)
plot(fit2, variable="income", confint=ci2, ellipse_y=0, draw_numbers=FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.