Learn R Programming

sensmediation (version 0.2.0)

more.effects: Estimate additional natural direct and indirect effects based on an object from sensmediation

Description

Takes an object from sensmediation and estimates additional natural direct and indirect effects, with a sensitivity analysis using the same sensitivity parameter as in the original analysis, without having to redo the optimization to find the estimated regression coefficients. The effects to be estimated are regulated through the arguments covariates and alt.decomposition as described in the documentation for sensmediation. The confidence level used is regulated through the argument conf.level.

Usage

more.effects(sensmed.object, conf.level = 0.95, covariates = NULL,
  alt.decomposition = FALSE, exp.value = 1, control.value = 0)

Arguments

sensmed.object

Object from sensmediation for which additional effects are to be calculated.

conf.level

the confidence level to be used for confidence intervals and uncertainty intervals.

covariates

if conditional effects are to be estimated the list of covariate values (see sensmediation). Covariates not specified are marginalized over.

alt.decomposition

logical indicating whether alternative definitions of the direct and indirect effects should be used (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.

Value

more.effects returns an object of class "effectsMed".

The function summary (summary.effectsMed) gives a summary of the results in the form of a table with the estimated effects and results of the sensitivity analysis. The function plot (plot.effectsMed) plots the estimated natural indirect or direct effects with confidence intervals over the range of the sensitivity parameter.

call

The matched call

Rho

The sensitivity parameter vector.

type

character, the type of confounding the sensitivity analysis is performed for.

coefs.sensmed

a list with the output from coefs.sensmed

NIE

matrix with the estimated NIEs (or NIE*s if alt.decomposition=TRUE) over the range of the sensitivity parameter Rho.

NDE

matrix with the estimated NDEs (or NDE*s if alt.decomposition=TRUE) over the range of the sensitivity parameter Rho.

std.errs

list with the standard errors of the NIE (NIE*), NDE (NDE*) and total effect over the range of the sensitivity parameter Rho.

CI

a list with the confidence intervals of the NIE (NIE*), NDE (NDE*) and total effect over the range of the sensitivity parameter Rho.

UI

matrix with the uncertainty intervals for the NIE (NIE*) and NDE (NDE*) over the range of the sensitivity parameter Rho.

conf.level

numeric, the confidence level used for confidence intervals and uncertainty intervals.

covariates

list of the covariate values that the effects are conditioned on.

exp.name

character vector containing the name of the exposure variable.

med.name

character vector containing the name of the mediator variable.

alt.decomposition

logical, indicating whether the alternative definitions of the direct and indirect effects have been used

See Also

sensmediation

Examples

Run this code
# NOT RUN {
#First we estimate marginal NIE, NDE with sensitivity analyses to mediator-outcome confounding:
effects.my <- sensmediation(med.model = m.model, out.model = y.model, exp.name = "z",
                     med.name = "m", Rho = seq(0, 0.5, 0.1))

#Then we want to do the same for conditional NIE, NDE without reestimating the regression
#coefficients:
effects.my.cond <- more.effects(sensmed.object = effects.my, covariates = list(x = 1))
summary(effects.my.cond)
plot(effects.my.cond)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab