plot.glmertree2 {glmertree} | R Documentation |
plot
method for (g)lmertree
objects.
plot.lmertree2(x, which = "all", ask = TRUE, type = "extended", observed = TRUE, fitted = "marginal", tp_args = list(), drop_terminal = TRUE, terminal_panel = NULL, ...) plot.glmertree2(x, which = "all", ask = TRUE, type = "extended", observed = TRUE, fitted = "marginal", tp_args = list(), drop_terminal = TRUE, terminal_panel = NULL, ...)
x |
an object of class |
which |
character; |
ask |
logical. Should user be asked for input, before a new figure is drawn? |
type |
character; |
observed |
logical. Should observed datapoints be plotted in the tree?
Defaults to |
fitted |
character. |
tp_args |
list of arguments to be passed to panel generating function
|
drop_terminal |
logical. Should all terminal nodes be plotted at the bottom? |
terminal_panel |
an optional panel function to be passed to
|
... |
Additional arguments to be passed to |
The caterpillar plot(s) for the local (node-specific) fixed effects (created
when which = "tree.coef"
) depict the estimated fixed-effects
coefficients with 95% confidence intervals, but these CIs DO NOT ACCOUNT FOR
THE SEARCHING OF THE TREE STRUCTURE and are therefore likely too narrow.
There is currently no way to adjust CIs for searching the tree structure,
thus the CIs can only be used to obtain an indication of the variability
of the coefficient estimates, not for statistical significance testing.
The caterpillar plot(s) for the random effect (created if which = "ranef"
or "all"
) depict the predicted random effects with 95% confidence
intervals. See also ranef
.
The code is still under development and might change in future versions.
Fokkema M, Smits N, Zeileis A, Hothorn T, Kelderman H (2018). “Detecting Treatment-Subgroup Interactions in Clustered Data with Generalized Linear Mixed-Effects Model Trees”. Behavior Research Methods, 50(5), 2016-2034. https://doi.org/10.3758/s13428-017-0971-x
lmertree
, glmertree
,
party-plot
.
## load artificial example data data("DepressionDemo", package = "glmertree") ## fit linear regression LMM tree for continuous outcome lt <- lmertree(depression ~ treatment + age | cluster | anxiety + duration, data = DepressionDemo) plot.lmertree2(lt) plot.lmertree2(lt, type = "simple") plot.lmertree2(lt, which = "tree", fitted = "combined") plot.lmertree2(lt, which = "tree", fitted = "none") plot.lmertree2(lt, which = "tree", observed = FALSE) plot.lmertree2(lt, which = "tree.coef") plot.lmertree2(lt, which = "ranef") ## fit logistic regression GLMM tree for binary outcome gt <- glmertree(depression_bin ~ treatment + age | cluster | anxiety + duration, data = DepressionDemo) plot.glmertree2(gt) plot.glmertree2(gt, type = "simple") plot.glmertree2(gt, which = "tree", fitted = "combined") plot.glmertree2(gt, which = "tree", fitted = "none") plot.glmertree2(gt, which = "tree.coef") plot.glmertree2(gt, which = "ranef")