Extracts posterior summaries of survival and longitudinal covariate
coefficients from a fitted joint model. Uses the existing stats::coef()
generic. Survival-only and longitudinal-only fits are also supported.
Usage
# S3 method for class 'JointModelSamples'
coef(object, ...)Arguments
- object
(
JointModelSamples) samples from a fitted joint model.- ...
Summary functions or named arguments passed to the underlying
cmdstanr::CmdStanMCMCobject's$summary()method, which usesposterior::summarise_draws(). Supply a custom quantile function to change the credible interval (see examples). Do not supplyvariables: the method selects the coefficient variables automatically.
Value
A tibble with one row per covariate coefficient, in design-matrix order (survival first, then longitudinal predictors). The columns are:
component:"survival"or"longitudinal".predictor: the longitudinal predictor name, orNAfor survival.covariate: the corresponding design-matrix column name.variable: the original indexed Stan variable name.Summary columns returned by
$summary(). By default these includemean,median,sd,mad,q5,q95,rhat,ess_bulk, andess_tail. The default intervals are 90% credible intervals.
Details
Covariate labels come from the fitted design matrices, including factor
contrasts and interactions. Longitudinal coefficients are grouped by their
predictor, such as mu_g, mu_s, or omega_g; all covariate predictors
reported by covariates.LongitudinalModel() are included.
Coefficients remain on their fitted predictor scales. No exponentiation or other transformation is applied. Intercepts, association-link coefficients, and other model parameters are not included. An error is raised if there are no covariate coefficients or a required coefficient was not sampled.
See also
Other JointModelSamples:
LongitudinalRandomEffects(),
as_print_string.JointModelSamples()
