Skip to contents

This function plots real predictor values versus predicted risk (either absolute or relative) from a fitted aba model with glm stats.

Usage

aba_plot_predictor_risk(model, term_labels = NULL)

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.

Value

a ggplot

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()