Function to estimate natural direct and indirect effect estimates and standard errors (using the delta method) based on parametric regression models and perform sensitivity analysis for unobserved confounding.
Intended to be called through sensmediation
(or more.effects
), not on its own.
calc.effects(
ML.object,
type = "my",
exp.name,
med.name,
covariates = NULL,
alt.decomposition = FALSE,
exp.value = 1,
control.value = 0,
med.model = NULL,
out.model = NULL
)
A list with elements:
A list with elements NIE
and NDE
, row matrices with the estimated NIE and NDE (or NIE* and NDE* if alt.decomposition = TRUE
) for each value of the sensitivity parameter Rho
.
A list with elements se.nie
and se.nde
, row matrices with the estimated standard errors for the natural direct and indirect effects for the different values of the sensitivity parameter Rho
.
list of the estimated mediator model parameters over Rho
, with
beta0
Intercept
beta1
Exposure
beta2
Covariates
beta3
Exposure-covariate interactions
Components that are not included in the input mediator model are set to 0.
list of the estimated outcome model parameters over Rho
, with
theta0
Intercept
theta1
Exposure
theta2
Mediator
theta3
Exposure-mediator interaction
theta4
Covariates
theta5
Exposure-covariate interactions
theta6
Mediator-covariate interactions
theta7
Exposure-mediator-covariate interactions
Components that are not included in the input outcome model are set to 0.
List with the partial derivatives of the NDE (Lambda), NIE (Gamma) and TE (Eta) wrt the mediator and outcome model parameters for each value of Rho
a list with the joint covariance matrix of the outcome and mediator model parameters for each value of Rho
. Note that the covariance matrix is constructed for all estimated parameters listed in betas
and thetas
but that components not included in the input mediator and outcome models are set to 0.
list of the covariate values that the effects are conditioned on.
object from coefs.sensmed
the type of confounding for which the sensitivity analysis is to be performed. type = "my"
, the default, corresponds to unobserved mediator-outcome
confounding, type = "zm"
to exposure-mediator confounding and type = "zy"
to exposure-outcome confounding.
A character string indicating the name of the exposure variable used in the models.
A character string indicating the name of the mediator used in the models.
if conditional effects are to be estimated the list of covariate values. Covariates not specified are marginalized over. For more information, see sensmediation
.
logical indicating whether alternative definitions of the direct and indirect effects should be used (for more information, see sensmediation
).
value of the exposure variable used as the exposure condition, default is 1.
value of the exposure variable used as the control (unexposed) condition, default is 0.
If type = "zy"
, fitted glm
model object representing the mediator model at the basis of the estimation.
If type = "zm"
, fitted glm
model object representing the outcome model at the basis of the estimation.
Anita Lindmark
sensmediation