as_table.abaSummary: Convert an aba summary to a nicely formatted table

View source: R/aba_summary.R

as_table.abaSummaryR Documentation

Convert an aba summary to a nicely formatted table

Description

This function allows you to format an aba summary in the same way which it is printed to the console using the print function. However, only one dataframe will result (i.e., the tables will not be split by group - outcome - stat combinations).

Usage

## S3 method for class 'abaSummary'
as_table(object)

Arguments

object

abaSummary. The aba summary to format as a table.

Value

a tibble

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

# default aba summary
model_summary <- model %>% aba_summary()

# convert summary to table
my_table <- model_summary %>% as_table()

ncullen93/abaR documentation built on Feb. 8, 2024, 12:01 p.m.