# NOT RUN {
df <- aba::adnimerge %>% dplyr::filter(VISCODE == 'bl')
# standard model selection
model <- df %>% aba_model() %>%
set_outcomes(ConvertedToAlzheimers) %>%
set_predictors(
CDRSB_bl, ADAS13_bl, MMSE_bl,
CSF_ABETA_bl, CSF_PTAU_bl, CSF_TAU_bl,
PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl,
MRI_HIPP_bl,
PET_ABETA_bl
) %>%
set_covariates(AGE, GENDER, EDUCATION) %>%
set_stats('glm') %>%
aba_fit()
model_summary <- model %>% aba_summary()
# default selection - forward selection by AIC with threshold = -2
# }
# NOT RUN {
model_selection <- model %>% aba_selection(verbose=TRUE)
# }
# NOT RUN {
# selection with p-value and threshold = 0.1
# }
# NOT RUN {
model_selection <- model %>%
aba_selection(criteria = 'pval', threshold=0.1, verbose=TRUE)
# }
# NOT RUN {
# selection by group
model2 <- model %>%
set_predictors(
c(CDRSB_bl,ADAS13_bl,MMSE_bl),
c(CSF_ABETA_bl,CSF_PTAU_bl,CSF_TAU_bl),
c(PLASMA_ABETA_bl, PLASMA_PTAU181_bl, PLASMA_NFL_bl),
c(MRI_HIPP_bl),
c(PET_ABETA_bl)
) %>%
aba_fit()
model_summary2 <- model2 %>% aba_summary()
# }
# NOT RUN {
model_selection2 <- model2 %>%
aba_selection(criteria='pval', threshold=0.1, verbose=TRUE)
# }
# NOT RUN {
# add more outcomes
model3 <- model2 %>%
set_outcomes(ConvertedToAlzheimers, ConvertedToDementia) %>%
aba_fit()
# }
# NOT RUN {
model_selection3 <- model3 %>%
aba_selection(criteria='pval', threshold=0.1, verbose=TRUE)
# }
# NOT RUN {
# add more groups
model4 <- model3 %>%
set_groups(everyone(), DX_bl %in% c('MCI','AD')) %>%
aba_fit()
# }
# NOT RUN {
model_selection4 <- model4 %>%
aba_selection(criteria='pval', threshold=0.1, verbose=TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab