Plot predictor values versus predicted risk from fitted aba model
Source:R/stat_glm.R
aba_plot_predictor_risk.Rd
This function plots real predictor values versus predicted risk (either absolute or relative) from a fitted aba model with glm stats.
Arguments
- model
fitted abaModel. The model to plot
- term_labels
list. Names and values of predictors and their labels to replace them with in the plot.
Examples
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')
# fit glm model with binary outcome variables
model <- data %>% aba_model() %>%
set_groups(everyone()) %>%
set_outcomes(CSF_ABETA_STATUS_bl) %>%
set_predictors(
c(PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl)
) %>%
set_stats(
stat_glm(std.beta = FALSE)
) %>%
fit()
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_ABETA_bl + PLASMA_PTAU181_bl + PLASMA_NFL_bl"
g <- model %>% aba_plot_predictor_risk()