This function allows you to format an aba summary in the same way
which it is printed to the console using the print
function. And then
it will be converted to an interactive react table that can be explored
in the Rstudio viewer or in a Shiny app.
Examples
# use built-in data
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')
# fit an aba model
model <- data %>% aba_model() %>%
set_groups(everyone()) %>%
set_outcomes(PET_ABETA_STATUS_bl) %>%
set_predictors(
PLASMA_PTAU181_bl,
PLASMA_NFL_bl,
c(PLASMA_PTAU181_bl, PLASMA_NFL_bl)
) %>%
set_covariates(AGE, GENDER, EDUCATION) %>%
set_stats('glm') %>%
fit()
#> [1] "PET_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION"
#> [1] "PET_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION + PLASMA_PTAU181_bl"
#> [1] "PET_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION + PLASMA_NFL_bl"
#> [1] "PET_ABETA_STATUS_bl ~ AGE + GENDER + EDUCATION + PLASMA_PTAU181_bl + PLASMA_NFL_bl"
# default aba summary
model_summary <- model %>% aba_summary()
# convert summary to table
my_table <- model_summary %>% as_reactable()