This function creates a glm stat object which can be passed as input
to the set_stats()
function when building an aba model. This stat performs
a traditional logistic regression analysis using the glm
function with
a binary outcome. Coefficients will be presented as odds ratios. Default
metrics include AUC.
Arguments
- time
string. The "time under risk" variable determining how long e.g. the individual has been in the study or when the individual got the disease.
- std.beta
logical. Whether to standardize model predictors and covariates prior to analysis.
- complete.cases
logical. Whether to only include the subset of data with no missing data for any of the outcomes, predictors, or covariates. Note that complete cases are considering within each group - outcome combination but across all predictor sets.
Examples
data <- adnimerge %>% dplyr::filter(VISCODE == 'bl')
# fit model
model <- data %>% aba_model() %>%
set_groups(everyone()) %>%
set_outcomes(ConvertedToAlzheimers, ConvertedToDementia) %>%
set_predictors(
PLASMA_PTAU181_bl, PLASMA_NFL_bl,
c(PLASMA_PTAU181_bl, PLASMA_NFL_bl)
) %>%
set_stats(
stat_cox(time = 'TimeUnderRiskDementia')
) %>%
fit()
## summarise model
model_summary <- model %>% summary()