PolyGenius
Contents

evaluate$association

Association of each PRS model with each outcome

evaluate$association() asks how strongly each score is associated with each outcome: an odds ratio for a binary outcome, a regression coefficient for a continuous one, optionally adjusted for covariates.

Usage

evaluate$association(
  data,
  outcomes,
  covariates = NULL,
  scores.layer = X,
  split.by = NULL,
  conf.level = 0.95,
  p.adjust.method = "BH"
)

Arguments

ArgumentDescription
dataA [PolyGeniusStudy](/reference/polygeniusstudy/). Holds the score layer and the sample columns the other arguments name. It is not modified.
outcomesUnquoted outcome expression resolved from data: a bare column, an expression such as status == "case", an [outcome()](/reference/outcome/) descriptor, or a c() or list() of these whose names label the outcomes. The type is binary or continuous, inferred from the values unless the descriptor sets it. A [surv()](/reference/surv/) outcome aborts.
covariatesUnquoted covariate expression resolved from data, such as c(age, sex, PC1), or NULL (default). Added to every fit. A character vector aborts.
scores.layerUnquoted name of an existing score layer, default X. The layer is used as supplied: nothing is scored or standardised here.
split.byUnquoted expression naming factor, character or logical sample columns, or NULL (default). Adds rows for each level beside the overall stratum = "all" rows. A level named "all" aborts.
conf.levelNumeric scalar in (0, 1), default 0.95.
p.adjust.methodOne of stats::p.adjust.methods, default "BH". Applied within analysis, outcome, metric and stratum.

Value

A PolyGeniusEvaluation following the schema-evaluation schema. $results has the columns listed in evaluate, one row per outcome, model and stratum. analysis is "association". metric is odds.ratio for a binary outcome and beta for a continuous one. Every fitted row carries lower, upper, pval and adj.pval, and $indices$multiplicity declares the adjustment families. model.ref, tier and tier.ref are NA. n is the fit's complete-case count and n.events its case count, NA for a continuous outcome. There are no artifacts. $diagnostics holds associate's fit messages.

Details

The fits are delegated to associate$regression(), with every model in scores.layer as a predictor (predictors = everything()). A binary outcome is fitted with "glm" and a continuous one with "lm". For each outcome type, the call runs once without split.by, giving the stratum = "all" rows, and once with it, giving the rows for each level.

Only each model's main-term row is kept:

  • binary: odds.ratio, the exponentiated log-odds estimate with its normal Wald interval;
  • continuous: beta, on the identity scale, with its Wald interval from the residual-df t distribution.

Effects are per unit of the supplied layer. A standardised layer, such as one from compute$standardize(), gives per-SD effects.

The p-value is associate's Wald test of the score term: z for a binary outcome, t for a continuous one. Associate's own adjustment is discarded and the p-values are re-adjusted in evaluate's families. For the same call the adjusted p-value equals associate's.

A fit that fails gives an NA row for that outcome, model and stratum, and its message goes to $diagnostics. The call does not abort when every fit fails.

Complete cases, strata and multiple testing follow the shared rules in evaluate. For interactions, another family, weights or the fitted models, call associate$regression() directly.

Examples

assoc <- evaluate$association(study, outcomes = dementia,
                              covariates = c(age, sex, PC1, PC2))
assoc$results[metric == "odds.ratio"]

# Per-SD effects, overall and within each sex
study$scores$X.scaled <- compute$standardize(study, layer = X)
evaluate$association(study, outcomes = c(ad = dementia, bmi = bmi),
                     scores.layer = X.scaled, split.by = sex)

See Also

evaluate$profile(), which runs this with the other components; visualize$evaluate$association() plots the effects as a forest.

Other evaluate-components: evaluate, evaluate.compare(), evaluate.incremental(), evaluate.performance(), evaluate.profile(), evaluate.redundancy(), evaluate.select(), evaluate.stratification()

Aliases: evaluate.association, evaluate$association