Learn R Programming

sensmediation (version 0.2.0)

calc.effects: Function for estimation of natural direct and indirect effects and sensitivity analysis for unobserved mediator-outcome confounding

Description

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.

Usage

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)

Arguments

ML.object

object from coefs.sensmed

type

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.

exp.name

A character string indicating the name of the exposure variable used in the models.

med.name

A character string indicating the name of the mediator used in the models.

covariates

if conditional effects are to be estimated the list of covariate values. Covariates not specified are marginalized over. For more information, see sensmediation.

alt.decomposition

logical indicating whether alternative definitions of the direct and indirect effects should be used (for more information, see sensmediation).

exp.value

value of the exposure variable used as the exposure condition, default is 1.

control.value

value of the exposure variable used as the control (unexposed) condition, default is 0.

med.model

If type = "zy", fitted glm model object representing the mediator model at the basis of the estimation.

out.model

If type = "zm", fitted glm model object representing the outcome model at the basis of the estimation.

Value

A list with elements:

effects

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.

std.errs

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.

See Also

sensmediation