Description Usage Arguments Value Examples
Plot metrics of an aba model summary
1 2 3 4 5 6 7 8 9 10 |
object |
an aba model summary. The object to plot - this should be the
result of an |
metric |
string. The performance metric to plot (e.g., |
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 metric.
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('glm') %>%
fit()
# summarise aba model to calculate metrics
model_summary <- model %>% aba_summary()
# plot the metrics using default (defaults to AUC)
metric_plot <- model_summary %>% aba_plot_metric()
# coord flip
metric_plot2 <- model_summary %>% aba_plot_metric(coord_flip=TRUE)
# compare predictor sets within each outcome instead of the opposite
metric_plot3 <- model_summary %>%
aba_plot_metric(x = 'outcome', group='predictor')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.