coef.glmertree {glmertree} | R Documentation |
coef
and fixef
methods for (g)lmertree
objects.
## S3 method for class 'lmertree' coef(object, which = "tree", drop = FALSE, ...) ## S3 method for class 'lmertree' fixef(object, which = "tree", drop = FALSE, ...) ## S3 method for class 'glmertree' coef(object, which = "tree", drop = FALSE, ...) ## S3 method for class 'glmertree' fixef(object, which = "tree", drop = FALSE, ...)
object |
an object of class |
which |
character; |
drop |
logical. Only used when |
... |
Additional arguments, curretnly not used. |
The code is still under development and might change in future versions.
If type = "local"
, returns a matrix of estimated local fixed-effects
coefficients, with a row for every terminal node and a column for every
fixed effect. If type = "global"
, returns a numeric vector of
estimated global fixed-effects coefficients.
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 LMM tree with local fixed effects only lt <- lmertree(depression ~ treatment + age | cluster | anxiety + duration, data = DepressionDemo) coef(lt) ## fit LMM tree including both local and global fixed effect lt <- lmertree(depression ~ treatment | (age + (1|cluster)) | anxiety + duration, data = DepressionDemo) coef(lt, which = "tree") # default behaviour coef(lt, which = "global") ## fit GLMM tree with local fixed effects only gt <- glmertree(depression_bin ~ treatment | cluster | age + anxiety + duration, data = DepressionDemo) coef(gt) ## fit GLMM tree including both local and global fixed effect gt <- glmertree(depression_bin ~ treatment | (age + (1|cluster)) | anxiety + duration, data = DepressionDemo) coef(gt, which = "tree") # default behaviour coef(gt, which = "global")