Regress PDD via Logistic Regression
regress_pdd_on_demographics.RdFor each algorithm for probable Parkinson’s disease dementia (PDD), this
function fits a logistic regression model predicting the diagnosis from age,
sex, and their interaction. It takes as input demographic data and a tibble
of PDD diagnoses (typically generated via diagnose_pdd_sample).
Arguments
- d0
A tibble of demographic data generated by
prepare_data.- d1
A tibble of PDD diagnoses (typically the
PDDelement from the list returned bydiagnose_pdd_sample).- covs
Either a character vector containing covariates of interest (in which case the resulting formula will be
PDD ~ age * sex * (covariate1 + covariate2 + ...), orNULL(default case whereby the resulting formula will bePDD ~ age * sex).- inter
A logical indicating whether covariates ought to be added to the together with their interactions with predictors of interest (default and recommended,
TRUE) or as additive terms only (FALSE).
Value
A list with the following components:
fitsA list of fitted logistic regression models for each PDD criterion.
valuesA tibble of model coefficients and statistics.
plotsA named list of ggplot2 objects:
dataPlots showing raw proportions of PDD diagnoses by age and sex.
parametersPlots summarising effect sizes (odds ratios) and associated p-values.
See also
prepare_data()preparesd0.diagnose_pdd_sample()preparesd1.stats::glm()is used to fit regressions.
Examples
if (FALSE) { # \dontrun{
p <- data_paths("data-raw")
data0 <- prepare_data(p)
data1 <- diagnose_pdd_sample(data0)
results <- regress_pdd_on_demographics(data0, data1$PDD)
} # }