| plot_maihda | R Documentation |
Creates various plots for visualizing MAIHDA model results including caterpillar plots, variance partition coefficient comparisons, observed vs. shrunken estimates, and predicted subgroup values with confidence intervals.
plot_maihda(
object,
type = c("caterpillar", "vpc", "obs_vs_shrunken", "predicted"),
summary_obj = NULL,
n_strata = 50,
...
)
object |
A maihda_model object from |
type |
Character string specifying plot type:
|
summary_obj |
Optional maihda_summary object from |
n_strata |
Maximum number of strata to display in caterpillar plot or predicted plot. Default is 50. Use NULL for all strata. |
... |
Additional arguments (not currently used). |
A ggplot2 object.
strata_result <- make_strata(maihda_sim_data, vars = c("gender", "race"))
model <- fit_maihda(health_outcome ~ age + (1 | stratum), data = strata_result$data)
# Caterpillar plot
plot_maihda(model, type = "caterpillar")
# VPC plot
plot_maihda(model, type = "vpc")
# Observed vs shrunken plot
plot_maihda(model, type = "obs_vs_shrunken")
# Predicted values with confidence intervals
plot_maihda(model, type = "predicted")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.