Choosing an Association Analysis
The associate environment provides you tailored solutions to address scientific questions about relationships of PRSs and outcomes in a cohort: direct associations, time-to-event effects, subgroup patterns, formal comparisons, mediation, Mendelian randomization, and meta-analysis.
Each of its nested functionalities operate on a previously created PolyGeniusData object populated with PRS scores and phenotypes / covariates of interest, and return a PolyGeniusAssociation object containing the summary statistics of the fitted statistical models and related artifact data required for visualizing results.
Start with the question you want to answer.
Whether PRS X Is Associated With Trait Y
Use associate$regression() for direct outcome association tests, supporting one or many outcomes, predictors, and adjusted covariates .
- Discrete/binary outcome: logistic regression (
glm) - Continuous outcome: linear regression (
lm)
assoc <- associate$regression(
data,
outcome = demented,
predictors = everything(),
covariates = c(age, sex, PCA)
)What comes back
A PolyGeniusAssociations object using the regression summary schema. See the full page for the exact lm and glm row fields and interpretation.
Plotting
visualize$associations$forest(assoc)
visualize$associations$heatmap(assoc)
Whether X Is Associated With Time Until An Event
Use associate$regression() with a time variable for event-time association tests.
- right-censored survival: Cox regression (
cox) - competing event supplied: Fine-Gray regression (
crr)
cox.assoc <- associate$regression(
data,
outcome = demented,
time = age.death,
predictors = everything(),
covariates = c(sex, PCA)
)What comes back
A PolyGeniusAssociations object using the survival regression schema. See the full page for Cox and Fine-Gray fields, event counts, and survival artifacts.
Plotting
visualize$associations$forest(cox.assoc)
visualize$associations$heatmap(cox.assoc)
visualize$associations$survival(cox.assoc)
Whether Groups Have Different Survival Curves
Use grouped survival analysis when the question is whether survival differs between levels of a grouping variable.
- unadjusted curves: Kaplan-Meier (
km) - adjusted group differences: Cox with the group as predictor
km.assoc <- associate$regression(
data,
outcome = demented,
time = age.death,
predictors = prs.tertile,
model = "km"
)What comes back
A PolyGeniusAssociations object with an omnibus log-rank row for km, plus curve, risk-table, and group-summary artifacts.
Plotting
visualize$associations$survival(km.assoc, show.event.table = TRUE) visualize$associations$heatmap(km.assoc)
What The Association Is Within Each Subgroup
Use split.by when you want the same association reported separately within subgroups.
- descriptive subgroup estimates
- not a formal test that subgroup effects differ
stratified <- associate$regression(
data,
outcome = demented,
predictors = PRS,
covariates = c(age, PCA),
split.by = sex
)What comes back
A PolyGeniusAssociations object using the fitted model schema, with subgroup membership recorded in stratum.
Plotting
visualize$associations$forest(stratified) visualize$associations$heatmap(stratified)
Whether The Association Differs Between Groups
Use a heterogeneity comparison when you want to test whether an association differs by a modifier.
- classical models: interaction-style comparison
- survival heterogeneity: comparison workflow, not
split.by
het <- associate$compare(
data,
outcome = demented,
predictors = PRS,
covariates = c(age, PCA),
by = sex,
type = "heterogeneity"
)What comes back
Comparison rows describing the heterogeneity test. The key result is the test statistic and p-value for effect modification.
Plotting
Comparison forest or heatmap views once comparison rows are available.
Which Groups Differ From Each Other
Use contrasts when the question is which levels or terms differ.
- pairwise contrasts across grouped predictors
- multiplicity-adjusted p-values where multiple contrasts are requested
contrasts <- associate$compare(
data,
outcome = demented,
by = prs.tertile,
covariates = c(sex, PCA),
type = "contrast",
contrast = "pairwise"
)What comes back
Contrast rows such as Mid - Low, High - Low, and High - Mid, using the comparison summary schema.
Plotting
visualize$associations$forest(contrasts)
visualize$associations$heatmap(contrasts)
Whether X Adds Information Beyond Covariates
Use a nested comparison to test whether adding X improves an association model beyond covariates.
- reduced model: covariates only
- full model: covariates plus focal predictor
nested <- associate$compare(
data,
outcome = demented,
predictors = PRS,
covariates = c(age, sex, PCA),
type = "nested"
)What comes back
Comparison rows describing the reduced-versus-full test. This is inferential model comparison, not predictive benchmarking.
Plotting
Comparison tables or heatmaps. Use evaluate$incremental() when the question is predictive added value.
Whether The Effect Of X On Y Is Mediated Through M
Use mediation when the question is whether an exposure-outcome association operates through an intermediate variable.
- exposure:
X - mediator:
M - outcome:
Y
med <- associate$mediation(
data,
exposure = PRS,
mediator = braaksc,
outcome = demented,
covariates = c(age, sex, PCA)
)What comes back
A PolyGeniusAssociations object using the mediation schema: total, direct, indirect, and proportion-mediated rows where appropriate.
Plotting
Mediation-specific summaries and forest-style effect views. Detailed plotting is under construction.
Whether Genetic Evidence Supports A Causal Effect Of X On Y
Use Mendelian randomization when genetic instruments are used to estimate an exposure-outcome effect.
- exposure: instrumented trait
- outcome: target trait
- estimators: IVW, Egger, median where supported
mr <- associate$mr(
data,
exposure = exposure_trait,
outcome = outcome_trait,
instruments = variants
)What comes back
An MR PolyGeniusAssociations object with estimator-level rows plus instrument diagnostics and summaries as artifacts.
Plotting
Estimator forest plots and MR diagnostics. Detailed plotting is under construction.
Whether Association Evidence Can Be Combined Across Cohorts
Use meta-analysis to pool compatible association rows across cohorts or studies.
- inputs: summary-mode
PolyGeniusAssociationsobjects - rows must represent the same estimand and effect scale
pooled <- associate$meta(
ROSMAP = rosmap.assoc,
ACT = act.assoc,
method = "random"
)What comes back
A meta-analysis PolyGeniusAssociations object with pooled estimates, standard errors, confidence intervals, p-values, and study counts.
Plotting
visualize$associations$forest(pooled) visualize$associations$heatmap(pooled)
Which PRS Model Predicts Best
This is an evaluation question, not an association question.
- use
evaluate$compare()for predictive performance - use
associate$compare()for association effects or model terms
cmp <- evaluate$compare(
models = c(model_a, model_b),
on = data,
outcome = demented
)What comes back
A PolyGeniusEvaluation object with delta-style performance metrics such as differences in AUC, RMSE, or C-index depending on outcome type.
Plotting
visualize$evaluate$compare$delta.forest(cmp)
Reading The Result Object
Association workflows return PolyGeniusAssociations objects in summary mode. The main table contains the inferential rows. Additional plot-support structures such as survival curves, prediction grids, risk tables, and diagnostics are stored as artifacts.
assoc
slotArtifacts(assoc)
slotDiagnostics(assoc)
slotLog(assoc)Use the detailed pages above when you need the exact schema for a specific question.
Common Confusions
split.by = sexreports separate subgroup estimates; it does not test whether the subgroup effects differ.- If the question is whether PRS tertile groups differ, use the tertile as the predictor or comparison group, not as a split variable.
- A significant p-value in one subgroup and a non-significant p-value in another subgroup is not a formal heterogeneity test.
associate$compare()is for association effects and model terms.evaluate$compare()is for predictive performance between PRS models.- Mediation asks whether an effect is transmitted through an intermediate variable. Interaction asks whether an effect differs by a modifier.