mediate_contY_contM: Mediation analysis function for continuous outcome and...

Description Usage Arguments Value

View source: R/mediate_contY_contM.R View source: R/mediateP.R

Description

Mediation analysis function for continuous outcome and mediator

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mediate_contY_contM(
  data,
  outcome = "Y",
  mediator = "M",
  exposure = "X",
  covariateY = c("X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8"),
  covariateM = c("X1", "X2", "X3", "X4", "X5", "X6", "X7"),
  x0 = 0,
  x1 = 1
)

Arguments

data

A dataset.

outcome

The outcome variable.

mediator

The mediator variable.

exposure

The exposure variable.

covariateY

A vector of confounders in the outcome regression.

covariateM

A vector of confounders in the mediator regression.

x0

The baseline exposure level.

x1

The new exposure level.

Value

A list containing NIE, NDE and MP point and interval estimates.


chaochengstat/mediateP documentation built on Jan. 8, 2021, 3:31 p.m.