Description Usage Arguments Value Examples
Plot coefficients of an aba model summary
1 2 3 4 5 6 7 8 9 |
object |
an aba model summary. The object to plot - this should be the
result of an |
x |
string. The model spec factor to use as the x axis. Defaults to predictor sets. |
group |
string. The model spec factor to use as the group variable in ggplot - this corresponding to "group", "fill", and "color" in ggplot. Defaults to outcome. |
facet |
string. The model spec factor to use as the group variable in ggplot - this corresponding to "facet_wrap" in ggplot. Defaults to group. |
coord_flip |
logical. Whether to flip the x and y axes. This can be useful when there are a large amount of predictor sets and you want to view metrics vertically. |
palette |
string. Which ggpubr palette to use. See |
plotly |
logical. Whether to use plot.ly instead of standard ggplot. Defaults to false. Using ggplotly can be useful if you want interactivity on web pages. |
a ggplot of the specified aba model summary coefficients
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # fit aba model
model <- aba_model() %>%
set_data(adnimerge %>% dplyr::filter(VISCODE == 'bl')) %>%
set_groups(everyone()) %>%
set_outcomes(ConvertedToAlzheimers, CSF_ABETA_STATUS_bl) %>%
set_predictors(
PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl,
c(PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl)
) %>%
set_stats(stat_glm(std.beta=TRUE)) %>%
fit()
# summarise aba model to calculate metrics
model_summary <- model %>% aba_summary()
# plot the coefficients using default
coef_plot <- model_summary %>% aba_plot_coef(coord_flip=TRUE)
# compare predictor coefficients across outcomes
coef_plot2 <- model_summary %>%
aba_plot_coef(
x = 'outcome', group='predictor',
facet=c('term','group'), coord_flip=TRUE
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.