associate$mediation
Mediation analyses for PolyGeniusData
Description
associate$mediation() estimates total, direct, and indirect effects for a specified exposure-mediator-outcome triplet resolved from a PolyGeniusData object.
Summary mode returns a PolyGeniusAssociations object using the mediation schema. Model mode returns the raw fitted mediator model, outcome model, and backend mediation object.
Usage
`associate$mediation`(data, exposure, mediator, outcome, covariates = NULL, outcome.model = c("auto", "lm", "glm"), method = c("natural.effects", "baron.kenny"), weights = NULL, output = c("summary", "models"), ...)
Arguments
data
|
A |
exposure
|
Unquoted exposure expression. |
mediator
|
Unquoted mediator expression. |
outcome
|
Unquoted outcome expression. |
covariates
|
Optional unquoted covariate expression. |
outcome.model
|
Outcome model family. |
method
|
Mediation method label. |
weights
|
Optional unquoted weights expression or numeric vector. |
output
|
One of |
…
|
Additional arguments forwarded to |
Details
Mediation currently relies on the suggested {mediation} package.
Supported outcome-model families:
-
“lm”for continuous outcomes -
“glm”for binary outcomes
Survival mediation is not implemented yet.
Value
-
“summary”returns aPolyGeniusAssociationsobject. -
“models”returns a named list of fitted objects.
See Also
associate, PolyGeniusAssociations