aba_demographics: Create a demographics table from a fitted aba model.

Description Usage Arguments Details Value Examples

View source: R/aba_demographics.R

Description

This function allows you to automatically create a demographics table from a fitted aba model. The variables in the table will be inferred from the spec of the model (predictors, covariates, outcomes, etc.), although this can be customized.

Usage

1
2
3
4
5
6
7
8
9
aba_demographics(
  object,
  strata = NULL,
  include_predictors = TRUE,
  include_covariates = TRUE,
  include_outcomes = TRUE,
  add_vars = NULL,
  data_filter = NULL
)

Arguments

object

abaModel. The fitted aba model to create demographics table from.

strata

string (optional). How to stratify the demographics table.

include_predictors

boolean. Whether to include predictors in table.

include_covariates

boolean. Whether to include covariates in table.

include_outcomes

boolean. Whether to include outcomes in table.

add_vars

character vector (optional). Any additional variables to add to the demographics table. These variables should be present in the data from the aba model.

data_filter

logical expression (optional). If this is specified, the data from the aba model will be further filtered before the table is made.

Details

Note that support is weaker for longitudinal data right now.

Value

a TableOne object (see tableone package).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
model <- aba_model() %>%
  set_data(adnimerge %>% dplyr::filter(VISCODE == 'bl')) %>%
  set_groups(everyone()) %>%
  set_outcomes(ConvertedToAlzheimers, CSF_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') %>%
  aba_fit()

my_table <- model %>% aba_demographics(strata = 'DX_bl')
print(my_table)

aba documentation built on Dec. 17, 2021, 1:06 a.m.