rmpw: Causal Mediation Analysis Using Weighting Approach

Description Usage Arguments Value Author(s) References Examples

View source: R/rmpw.R

Description

Causal Mediation Analysis Using Weighting Approach

Usage

1
rmpw(data, treatment, mediator, outcome, propensity_x, outcome_x, decomposition)

Arguments

data

The data set for analysis.

treatment

The name of the treatment variable (string).

mediator

The name of the mediator variable (string).

outcome

The name of the outcome variable (string).

propensity_x

A vector of variable names (string) of pretreatment confounders, which will be included in the propensity score model.

outcome_x

A vector of variable names (string) of pretreatment confounders, which will be included in the outcome model.

decomposition

Type of decomposition. When decomposition = 1, the total treatment effect will be decomposed into pure direct effect (DE.0), total and pure indirect effect (IE.1 and IE.0), and natural treatment-by-mediator interaction effect (IE.1 - IE.0). When decomposition = 2, the total treatment effect will be decomposed into pure indirect effect (IE.0), total and pure direct effect (DE.1 and DE.0), and natural treatment-by-mediator interaction effect (DE.1 - DE.0).

Value

A list contains the estimates of the causal effects and the coefficients of the pretreatment covariates.

Author(s)

Xu Qin and Guanglei Hong

References

Hong, G., Deutsch, J., & Hill, H. D. (2015). Ratio-of-mediator-probability weighting for causal mediation analysis in the presence of treatment-by-mediator interaction. Journal of Educational and Behavioral Statistics, 40 (3), 307-340. doi: 10.3102/1076998615583902

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(Riverside)
rmpw(data = Riverside, treatment = "treat", mediator = "emp", 
    outcome = "trunc_dep12sm2", propensity_x = c("emp_prior", 
        "pqtrunc50", "pqtrunc51", "pqtrunc52", "pqtrunc53", "pqtrunc30", 
        "hispanic", "pqtrunc49", "nevmar"), outcome_x = c("emp_prior", 
        "pqtrunc50", "pqtrunc51", "pqtrunc52", "pqtrunc53", "pqtrunc30", 
        "hispanic", "pqtrunc49", "nevmar"), decomposition = 0)
rmpw(data = Riverside, treatment = "treat", mediator = "emp", 
    outcome = "trunc_dep12sm2", propensity_x = c("emp_prior", 
        "pqtrunc50", "pqtrunc51", "pqtrunc52", "pqtrunc53", "pqtrunc30", 
        "hispanic", "pqtrunc49", "nevmar"), outcome_x = c("emp_prior", 
        "pqtrunc50", "pqtrunc51", "pqtrunc52", "pqtrunc53", "pqtrunc30", 
        "hispanic", "pqtrunc49", "nevmar"), decomposition = 1)
rmpw(data = Riverside, treatment = "treat", mediator = "emp", 
    outcome = "trunc_dep12sm2", propensity_x = c("emp_prior", 
        "pqtrunc50", "pqtrunc51", "pqtrunc52", "pqtrunc53", "pqtrunc30", 
        "hispanic", "pqtrunc49", "nevmar"), outcome_x = c("emp_prior", 
        "pqtrunc50", "pqtrunc51", "pqtrunc52", "pqtrunc53", "pqtrunc30", 
        "hispanic", "pqtrunc49", "nevmar"), decomposition = 2)

Example output

                        Estimate Std.Error t value Pr(>|t|) 
Natural Direct Effect     0.9916    0.8735  1.1352   0.2563 
Natural Indirect Effect  -0.8794    0.4716 -1.8646   0.0622 
                          Estimate Std.Error t value Pr(>|t|)   
Gamma.0                      5.578    1.8096  3.0824   0.0021  *
Natural Direct Effect       1.2772    0.8611  1.4832    0.138   
Natural Indirect Effect    -0.8713    0.4753 -1.8334   0.0667   
Pure Indirect Effect         0.318    0.2748  1.1574   0.2471   
T-by-M Interaction Effect  -1.1893    0.5547 -2.1441    0.032  .
emp_prior                   0.1294    0.6804  0.1902   0.8491   
pqtrunc50                  -1.3269    0.5491 -2.4166   0.0157  .
pqtrunc51                   2.3187    0.5792  4.0029   <0.001 **
pqtrunc52                  -0.6729    0.6225 -1.0809   0.2797   
pqtrunc53                   1.0757    0.5116  2.1028   0.0355  .
pqtrunc30                  -1.4588    0.4048 -3.6037   <0.001 **
hispanic                    1.6085    0.7003  2.2967   0.0216  .
pqtrunc49                   0.7225    0.4204  1.7185   0.0857   
nevmar                       0.695    0.6405   1.085   0.2779   
                          Estimate Std.Error t value Pr(>|t|)   
Gamma.0                      5.578     1.812  3.0784   0.0021  *
Pure Indirect Effect        0.0879    0.2753  0.3192   0.7496   
Total Direct Effect         1.1893    0.7011  1.6964   0.0898   
Natural Direct Effect        0.318    0.8632  0.3684   0.7126   
T-by-M Interaction Effect   0.8713    0.5693  1.5306   0.1259   
emp_prior                   0.1294    0.6796  0.1905   0.8489   
pqtrunc50                  -1.3269    0.5494 -2.4152   0.0157  .
pqtrunc51                   2.3187    0.5781   4.011   <0.001 **
pqtrunc52                  -0.6729    0.6238 -1.0787   0.2807   
pqtrunc53                   1.0757    0.5127   2.098   0.0359  .
pqtrunc30                  -1.4588    0.4047 -3.6051   <0.001 **
hispanic                    1.6085    0.7009   2.295   0.0217  .
pqtrunc49                   0.7225     0.421  1.7163   0.0861   
nevmar                       0.695    0.6406  1.0849    0.278   

rmpw documentation built on May 2, 2019, 8:32 a.m.

Related to rmpw in rmpw...