aba_plot_risk_density | R Documentation |
This function plots risk density curves across group - outcome - stat
combinations and split by binary outcome. It currently supports stat_glm
.
aba_plot_risk_density(
model,
risk_type = c("absolute", "relative"),
drop_basic = FALSE
)
model |
abaModel. A fitted aba model with |
risk_type |
string. Whether to use absolute or relative risk. |
drop_basic |
logical. Whether to drop the basic model or not. |
a ggplot with risk density curves split by binary outcome value.
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')
# fit glm model with binary outcome variables
model <- data %>% aba_model() %>%
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()
fig <- model %>% aba_plot_risk_density()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.