msmediate.weights: Causal mediation analysis in multisite trials in the presence...

Description Usage Arguments Value Author(s) References Examples

View source: R/msmediate.R

Description

This function is used to estimate both the population average and between-site variance of natural direct effect, natural indirect effect, pure indirect effect, and treatment-by-mediator interaction effect. It incorporates a sample weight to adjust for complex sample and survey designs and employs an estimated nonresponse weight to account for non-random nonresponse.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
msmediate.weights(
  data,
  y,
  treatment,
  mediator,
  response,
  XR1,
  XR0,
  XM1,
  XM0,
  site,
  sample.weight
)

Arguments

data

The data set for analysis.

y

The name of the outcome variable (string).

treatment

The name of the treatment variable (string).

mediator

The name of the mediator variable (string).

response

The name of the response variable (string), which is equal to 1 if the individual responded and 0 otherwise.

XR1

A vector of variable names (string) of pretreatment covariates in the propensity score model for the response under the treatment condition. For now, the multilevel propensity score model only allows for one random intercept.

XR0

A vector of variable names (string) of pretreatment covariates in the propensity score model for the response under the control condition. For now, the multilevel propensity score model only allows for one random intercept.

XM1

A vector of variable names (string) of pretreatment covariates in the propensity score model for the mediator under the treatment condition. For now, the multilevel propensity score model only allows for one random intercept.

XM0

A vector of variable names (string) of pretreatment covariates in the propensity score model for the mediator under the control condition. For now, the multilevel propensity score model only allows for one random intercept.

site

The variable name for the site ID (string).

sample.weight

The variable name for the sample weight given by design (string).

Value

A list contains the estimates of the between-site variances of natural direct effect, natural indirect effect, pure indirect effect, and treatment-by-mediator interaction effect, and the correlations between the effects across sites ($Random_effects), and the population average effect estimates along with their hypothesis testing results ($Fixed_effects).

Author(s)

Xu Qin, Guanglei Hong, Jonah Deutsch, and Edward Bein

References

Qin, X., Hong, G., Deutsch, J., & Bein, E. (2019). Multisite causal mediation analysis in the presence of complex sample and survey designs and non-random non-response. Journal of the Royal Statistical Society: Series A (Statistics in Society), 182(4), 1343-1370. doi: 10.1111/rssa.12446

Examples

1
2
3
4
5
data(sim.weights)

msmediate.weights(data = sim.weights, y = "y", treatment = "tr", mediator = "me",
    response = "R", XR1 = c("x1", "x2", "x3"), XR0 = c("x1", "x2", "x3"), XM1 = c("x1",
        "x2", "x3"), XM0 = c("x1", "x2", "x3"), site = "site", sample.weight = "WD")

MultisiteMediation documentation built on Sept. 5, 2021, 6:04 p.m.