# NOT RUN {
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')
# set with variables - this will result in four "predictor sets".
model <- aba_model() %>%
set_data(data) %>%
set_predictors(
PLASMA_ABETA_bl,
PLASMA_PTAU181_bl,
PLASMA_NFL_bl,
c(PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl)
)
# set with tidy selection functions - but this is only one "predictor set",
# not multiple individual predictor sets.
model <- aba_model() %>%
set_data(data) %>%
set_predictors(
starts_with('PLASMA')
)
# automatically generate all possible combinations of variables
model <- aba_model() %>%
set_data(data) %>%
set_predictors(
all_combos(c('PLASMA_ABETA_bl', 'PLASMA_PTAU181_bl', 'PLASMA_NFL_bl'))
)
# supply strings - data does not need to be set first here. But it will
# result in an error if these variables do not <U+00E9>xist in the eventual data.
model <- aba_model() %>%
set_data(data) %>%
set_predictors(
'PLASMA_ABETA_bl',
'PLASMA_PTAU181_bl',
'PLASMA_NFL_bl',
c('PLASMA_ABETA_bl', 'PLASMA_PTAU181_bl', 'PLASMA_NFL_bl')
)
# }
Run the code above in your browser using DataLab