Skip to contents

Calling aba_fit will trigger the fitting of all statistical models which have been specified for the model. This will result in fits for each group - outcome - stat combination.

Usage

aba_fit(object, verbose = FALSE)

Arguments

object

aba model The aba model to be fitted.

verbose

logical. Whether to give a progress bar during model fitting.

Value

abaModel

Details

Note that this function is identical to the generic fit() function which is also provided for compatability with the greater R ecosystem.

Examples

data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')

model_spec <- aba_model() %>%
  set_data(data) %>%
  set_groups(everyone()) %>%
  set_outcomes(ConvertedToAlzheimers, CSF_ABETA_STATUS_bl) %>%
  set_predictors(
    PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl,
    c(PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl)
  ) %>%
  set_stats('glm')

model <- model_spec %>% aba_fit()
#> [1] "ConvertedToAlzheimers ~ PLASMA_ABETA_bl"
#> [1] "ConvertedToAlzheimers ~ PLASMA_PTAU181_bl"
#> [1] "ConvertedToAlzheimers ~ PLASMA_NFL_bl"
#> [1] "ConvertedToAlzheimers ~ PLASMA_ABETA_bl + PLASMA_PTAU181_bl + PLASMA_NFL_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_ABETA_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_PTAU181_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_NFL_bl"
#> [1] "CSF_ABETA_STATUS_bl ~ PLASMA_ABETA_bl + PLASMA_PTAU181_bl + PLASMA_NFL_bl"