View source: R/aba_demographics.R
| aba_demographics | R Documentation | 
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.
aba_demographics(
  model,
  strata = NULL,
  include_predictors = TRUE,
  include_covariates = TRUE,
  include_outcomes = TRUE,
  add_vars = NULL,
  data_filter = NULL
)
model | 
 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.  | 
Note that support is weaker for longitudinal data right now.
a TableOne object (see tableone package).
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.