Examples for Third-Variable Effect Analysis

Qingzhao Yu & Lin Zhu

2020-12-11

Package installation

R package mma is used for general third-variable effect analysis (Yu and Li 2017). The third-variable effect (TVE) refers to the effect conveyed by intervening variables to an observed relationship between an exposure and a response variable (outcome). In this package, the exposure is also called the predictor, the intervening variables are called mediators or confounders (MC). The TVE include total effect, direct effect, and indirect effects from different third variables. The effects are defined in Yu et al. (2014). The algorithms on how to make inferences on TVEs and how to explain the effects are described in Yu et al. (2014).

To use the R package mma, we first install the package in R (install.packages("mma")) and load it.

library(mma)
#> Loading required package: gbm
#> Loaded gbm 2.1.5
#> Loading required package: splines
#> Loading required package: survival
#> Loading required package: car
#> Loading required package: carData
#> Loading required package: gplots
#> 
#> Attaching package: 'gplots'
#> The following object is masked from 'package:stats':
#> 
#>     lowess
#source('C:/Users/qyu/Desktop/Research/mma/version current/R/mma.r')

Data Organization and Identify Potential Mediators/Confounders

We use weight_behavior data as an example to show how to do a preliminary data analysis to identify potential MCs and covariates. The function data.org is used for this purpose. The list of arguments for data.org are defined in Yu and Li (2017). In the following example, the predictor, “pred”, is gender, and the outcome, “y”, is a binary indicator of overweight (1) or not (0). The reference group of the exposure variable is the male as defined by “predref=”M“”. There are 12 variables in “x”, which includes all potential MCs and covariates. As an argument in the function data.org, “mediator=5:12” indicates that the variables from column 5 to column 12 in x should be tested for potential MCs. Other columns in “x” are to be treated as covariates. The “mediator” argument can also be a character vector with names of the potential MCs in x. Two tests are needed to identify a potential MC: first, the variable is significantly related with the predictor adjusting for other covariates. The other covariates here is defined by “cova”. If cova is a data frame by itself, all covariates in cova are for all potential MCs. If cova is a list, the first item will be the covariate data frame and the second item list the names or column numbers of MCs in “x” that should adjust for the covariates. The significance level is set by “alpha2”, whose default value is 0.1. Second, the variable has to be significantly related with the outcome adjusting (testtype=1, by default) or not adjusting (testtype=2) for the predictor and other variables. The significance level is set by “alpha”. In the following example, p-value 1 shows the results for the second test. and p-value 2 are the results for the first test. A variable that pass the second test but not the first test is considered as covariates. Variables do not pass the second test are not adopted in further analysis. Variables in “x” but not in “mediator” are forced in further analysis as covariates.

“jointm” is a list with the first item identify the number of groups of MCs whose joint effects are of interesting, where each group is defined in an item of “jointm”. In the above example, the joint effect of Variables 5, 7, 9 is of interesting. These variables are forced into analysis as potential MCs. A variable can be shown in “jointm” multiple times. The joint effect of each group of variables will be reported. A trick to force in variables as potential MCs is to assign them in a separate group of “jointm”.

One binary/continuous predictor and one binary/continuous outcome

data("weight_behavior")
#binary predictor x
#binary y
 x=weight_behavior[,c(2,4:14)]
 pred=weight_behavior[,"sex"]
 y=weight_behavior[,"overweigh"]
 data.b.b.1<-data.org(x,y,mediator=5:12,jointm=list(n=1,j1=7:9),
                        pred=pred,predref="M", alpha=0.4,alpha2=0.4)
 summary(data.b.b.1)
#> Identified as mediators: 
#> [1] "tvhours"   "cmpthours" "cellhours" "exercises" "sweat"     "sports"   
#> Selected as covariates: 
#> [1] "age"       "race"      "numpeople" "car"      
#> Tests: 
#>             P-Value 1.y P-Value 2.pred
#> age               0.836             NA
#> race              0.850             NA
#> numpeople         0.561             NA
#> car               0.052             NA
#> gotosch           0.710             NA
#> snack             0.724             NA
#> tvhours -         0.830          0.484
#> cmpthours -       0.826          0.760
#> cellhours -       0.067          0.688
#> sports *          0.000          0.003
#> exercises *       0.176          0.203
#> sweat *           0.181          0.046
#> pred              0.178             NA
#> ----
#>  *:mediator,-:joint mediator
#>  P-Value 1:Type-3 tests in the full model (data.org) or estimated coefficients (data.org.big) 
#>  when testtype=1, univariate relationship test with the outcome when testtype=2
#>  P-Value 2:Tests of relationship with the Predictor

The results from “data.org” function is summarized as above.

A potential MC defined in “mediator” argument is identified as categorical or binary if it has only two unique values or if the variable is a vector factors or characters. By default, the reference group is the first level of the variable. If the reference group needs to be changed, the categorical variable should be defined in binmed or catmed, and then the corresponding reference group in binref and catref. Continuous MCs can be defined by contmed. The following example did the same analysis as above, only that it defines that potential continuous mediators are columns 7,8,9,11, and 12 of x, binary mediators are columns 6 and 10, and categorical mediator is column 5 of x with 1 to be the reference group for all categorical and binary mediators.

 data.b.b.2<-data.org(x,y,pred=pred,contmed=c(7:9,11:12),binmed=c(6,10), jointm=list(n=1,j1=7:9),
   binref=c(1,1),catmed=5,catref=1,predref="M",alpha=0.4,alpha2=0.4) 
 summary(data.b.b.2)

Survival outcome

The functions in mma can deal with binary, categorical, continuous, or time-to-event outcomes. If the outcome is time-to-event, it should be defined by the “Surv” function in the survival package. An example of application on breast cancer survival can be found in Yu et al. (2019).

 cgd1<-cgd0
 status<-ifelse(is.na(cgd1$etime1),0,1)
 y=Surv(cgd1$futime,status) 
 x=cgd1[,c(5:7,9:12)]
 pred=cgd1[,4]
 data.b.surv<-data.org(x,y,pred=pred,mediator=1:ncol(x),   
                    alpha=0.4,alpha2=0.4)
 summary(data.b.surv)

Multivariate predictors

In addition, the package can handle multivariate and multicategorical predictors. If the predictor is multicategorical of k levels, “data.org” first transform the predictor to k-1 binary predictors. If a variable significantly relates with any of the k-1 predictors, the variable passes the first test described above. P-value 2 is shown for each predictor. In the following example, the predictor is the race with six levels.

 #multivariate predictor
 x=weight_behavior[,c(2:3,5:14)]
 pred=weight_behavior[,4]
 y=weight_behavior[,15]
 data.mb.b <-data.org(x,y,mediator=5:12,jointm=list(n=1,j1=c(5,7,9)),
                      pred=pred,predref="OTHER", alpha=0.4,alpha2=0.4)
 summary(data.mb.b)
#> Identified as mediators: 
#> [1] "tvhours"   "cellhours" "sweat"     "sports"    "gotosch"  
#> Selected as covariates: 
#> [1] "age"       "sex"       "numpeople" "car"       "exercises"
#> Tests: 
#>               P-Value 1.y P-Value 2.pred P-Value 2.predAFRICAN
#> age                 0.836             NA                    NA
#> sex                 0.178             NA                    NA
#> numpeople           0.561             NA                    NA
#> car                 0.052             NA                    NA
#> gotosch -           0.710          0.112                 0.796
#> snack               0.724             NA                    NA
#> tvhours -           0.830          0.748                 0.535
#> cmpthours           0.826             NA                    NA
#> cellhours -         0.067          0.880                 0.994
#> sports *            0.000          0.587                 0.163
#> exercises           0.176          0.629                 0.731
#> sweat *             0.181          0.647                 0.174
#> pred                0.543             NA                    NA
#> predAFRICAN         0.663             NA                    NA
#> predCAUCASIAN       0.242             NA                    NA
#> predINDIAN          0.890             NA                    NA
#> predMIXED           0.782             NA                    NA
#>               P-Value 2.predCAUCASIAN P-Value 2.predINDIAN
#> age                                NA                   NA
#> sex                                NA                   NA
#> numpeople                          NA                   NA
#> car                                NA                   NA
#> gotosch -                       0.996                0.097
#> snack                              NA                   NA
#> tvhours -                       0.334                0.916
#> cmpthours                          NA                   NA
#> cellhours -                     0.707                0.555
#> sports *                        0.816                0.453
#> exercises                       0.723                0.912
#> sweat *                         0.214                0.374
#> pred                               NA                   NA
#> predAFRICAN                        NA                   NA
#> predCAUCASIAN                      NA                   NA
#> predINDIAN                         NA                   NA
#> predMIXED                          NA                   NA
#>               P-Value 2.predMIXED
#> age                            NA
#> sex                            NA
#> numpeople                      NA
#> car                            NA
#> gotosch -                   0.033
#> snack                          NA
#> tvhours -                   0.092
#> cmpthours                      NA
#> cellhours -                 0.383
#> sports *                    0.091
#> exercises                   0.881
#> sweat *                     0.203
#> pred                           NA
#> predAFRICAN                    NA
#> predCAUCASIAN                  NA
#> predINDIAN                     NA
#> predMIXED                      NA
#> ----
#>  *:mediator,-:joint mediator
#>  P-Value 1:Type-3 tests in the full model (data.org) or estimated coefficients (data.org.big) 
#>  when testtype=1, univariate relationship test with the outcome when testtype=2
#>  P-Value 2:Tests of relationship with the Predictor

Multivariate outcomes

Similarly, the package can deal with multivariate outcomes. The following code deals with multivariate predictors and multivariate responses. If the variable is significantly related with any one of the outcomes, it passes the second test described above. The results from “data.org” are summarized for each combination of the exposure-outcome relationship.

 #multivariate responses
 x=weight_behavior[,c(2:3,5:14)]
 pred=weight_behavior[,4]
 y=weight_behavior[,c(1,15)]
 data.mb.mb<-data.org(x,y,mediator=5:12,jointm=list(n=1,j1=c(5,7,9)),
                      pred=pred,predref="OTHER", alpha=0.4,alpha2=0.4)
 summary(data.mb.mb)
#> Identified as mediators: 
#> [1] "tvhours"   "cellhours" "sweat"     "sports"    "gotosch"  
#> Selected as covariates: 
#> [1] "age"       "sex"       "numpeople" "car"       "exercises"
#> Tests: 
#>               P-Value 1.bmi P-Value 1.overweigh P-Value 2.pred
#> age                   0.458               0.836             NA
#> sex                   0.003               0.178             NA
#> numpeople             0.282               0.561             NA
#> car                   0.059               0.052             NA
#> gotosch -             0.527               0.710          0.112
#> snack                 0.830               0.724             NA
#> tvhours -             0.505               0.830          0.748
#> cmpthours             0.676               0.826             NA
#> cellhours -           0.084               0.067          0.880
#> sports *              0.001               0.000          0.587
#> exercises             0.089               0.176          0.629
#> sweat *               0.078               0.181          0.647
#> pred                  0.344               0.543             NA
#> predAFRICAN           0.900               0.663             NA
#> predCAUCASIAN         0.032               0.242             NA
#> predINDIAN            0.446               0.890             NA
#> predMIXED             0.833               0.782             NA
#>               P-Value 2.predAFRICAN P-Value 2.predCAUCASIAN
#> age                              NA                      NA
#> sex                              NA                      NA
#> numpeople                        NA                      NA
#> car                              NA                      NA
#> gotosch -                     0.796                   0.996
#> snack                            NA                      NA
#> tvhours -                     0.535                   0.334
#> cmpthours                        NA                      NA
#> cellhours -                   0.994                   0.707
#> sports *                      0.163                   0.816
#> exercises                     0.731                   0.723
#> sweat *                       0.174                   0.214
#> pred                             NA                      NA
#> predAFRICAN                      NA                      NA
#> predCAUCASIAN                    NA                      NA
#> predINDIAN                       NA                      NA
#> predMIXED                        NA                      NA
#>               P-Value 2.predINDIAN P-Value 2.predMIXED
#> age                             NA                  NA
#> sex                             NA                  NA
#> numpeople                       NA                  NA
#> car                             NA                  NA
#> gotosch -                    0.097               0.033
#> snack                           NA                  NA
#> tvhours -                    0.916               0.092
#> cmpthours                       NA                  NA
#> cellhours -                  0.555               0.383
#> sports *                     0.453               0.091
#> exercises                    0.912               0.881
#> sweat *                      0.374               0.203
#> pred                            NA                  NA
#> predAFRICAN                     NA                  NA
#> predCAUCASIAN                   NA                  NA
#> predINDIAN                      NA                  NA
#> predMIXED                       NA                  NA
#> ----
#>  *:mediator,-:joint mediator
#>  P-Value 1:Type-3 tests in the full model (data.org) or estimated coefficients (data.org.big) 
#>  when testtype=1, univariate relationship test with the outcome when testtype=2
#>  P-Value 2:Tests of relationship with the Predictor

Third-Variable Effect Analysis

Next, we use med function to estimate the TVE using the results from data.org function. The default approach is using a generalized linear model to fit the final full model. If “nonlinear=TRUE”“, multiple Additive Regression Trees (MART) will be used to fit the relationship between outcome(s) and other variables, and smoothing splines used to fit the relationship between the potential MC and exposure variables(s).

Binary predictor and binary outcome

 med.b.b.2<-med(data=data.b.b.2,n=2,nonlinear=TRUE)

Using the linear method and to show the results:

 med.b.b.1<-med(data=data.b.b.2,n=2)
 med.b.b.1
#> 
#> 
#> For the predictor pred :
#>  The estimated total effect:[1] 0.7436
#> 
#>  The estimated indirect effect:
#>       y1.all   y1.tvhours y1.cmpthours y1.cellhours y1.exercises 
#>       0.2289      -0.0078      -0.0200       0.0069      -0.0186 
#>     y1.sweat    y1.sports        y1.j1 
#>       0.0214       0.2098       0.0178

We can plot the marginal effect of the MC on the outcome, and the marginal effect of the predictor on the MC. If the predictor is binary, plot.med draws a histogram or boxplot of the marginal density of the MC at each different value of the predictor.

plot(med.b.b.1, data.b.b.2,vari="exercises",xlim=c(0,50))
plot(med.b.b.2, data.b.b.2,vari="sports")

Survival outcome

For survival outcome, the default option is to fit the final full model using Cox proportional hazard model. Note that when use type=“lp”, the linear predictor is the type of predicted value as in predict.coxph, the results is similar to those from MART. Readers are referred to Yu et al. (2019) for more details.

 med.b.surv.1<-med(data=data.b.surv,n=2,type="lp") 
  #close to mart results when use type="lp"
 med.b.surv.2<-med(data=data.b.surv,n=2,nonlinear=TRUE)  
 #results in the linear part unit

Statistical Inference on TVE Analysis

boot.med function is used to make inferences on the TVE. Results return from data.org function is input as the first argument.

Binary predictor and binary outcome

 bootmed.b.b.1<-boot.med(data=data.b.b.2,n=2,n2=50)
#> [1] 1
#> [1] 2
#> [1] 3
#> [1] 4
#> [1] 5
#> [1] 6
#> [1] 7
#> [1] 8
#> [1] 9
#> [1] 10
#> [1] 11
#> [1] 12
#> [1] 13
#> [1] 14
#> [1] 15
#> [1] 16
#> [1] 17
#> [1] 18
#> [1] 19
#> [1] 20
#> [1] 21
#> [1] 22
#> [1] 23
#> [1] 24
#> [1] 25
#> [1] 26
#> [1] 27
#> [1] 28
#> [1] 29
#> [1] 30
#> [1] 31
#> [1] 32
#> [1] 33
#> [1] 34
#> [1] 35
#> [1] 36
#> [1] 37
#> [1] 38
#> [1] 39
#> [1] 40
#> [1] 41
#> [1] 42
#> [1] 43
#> [1] 44
#> [1] 45
#> [1] 46
#> [1] 47
#> [1] 48
#> [1] 49
#> [1] 50
 summary(bootmed.b.b.1)
#> MMA Analysis: Estimated Mediation Effects Using GLM
#> For Predictor/Moderator at pred 
#> $total.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.559  0.664  0.380  1.409 -0.081  1.379  0.013  1.496 -0.134  0.081 
#> p_quan 
#>  0.040 
#> 
#> $direct.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.345  0.432  0.399  1.215 -0.350  1.278 -0.206  1.294 -0.394  0.279 
#> p_quan 
#>  0.320 
#> 
#> $indirect.effect
#>        y1.all y1.tvhours y1.cmpthours y1.cellhours y1.exercises y1.sweat
#> est     0.214     -0.003        0.023        0.011       -0.012    0.003
#> mean    0.232      0.001        0.024        0.024       -0.015    0.007
#> sd      0.159      0.044        0.059        0.041        0.032    0.033
#> upbd    0.544      0.087        0.139        0.104        0.047    0.071
#> lwbd   -0.080     -0.086       -0.090       -0.057       -0.078   -0.057
#> upbd_q  0.505      0.088        0.115        0.118        0.034    0.095
#> lwbd_q -0.004     -0.082       -0.046       -0.037       -0.090   -0.038
#> upbd_b  0.466      0.098        0.117        0.099        0.037    0.100
#> lwbd_b -0.006     -0.129       -0.055       -0.044       -0.096   -0.061
#> p_norm  0.145      0.987        0.677        0.568        0.634    0.824
#> p_quan  0.080      1.000        0.640        0.640        0.640    0.840
#>        y1.sports  y1.j1
#> est        0.181  0.011
#> mean       0.166  0.048
#> sd         0.090  0.090
#> upbd       0.341  0.225
#> lwbd      -0.010 -0.129
#> upbd_q     0.327  0.224
#> lwbd_q     0.041 -0.121
#> upbd_b     0.397  0.238
#> lwbd_b     0.019 -0.140
#> p_norm     0.065  0.592
#> p_quan     0.000  0.560

Similarly, the default approach is using a generalized linear model to fit the final full model. If the argument nonlinear=TRUE, multiple Additive Regression Trees (MART) will be used to fit the model in estimating the outcome. Applications for nonlinear Mediation Analysis are described in Yu et al. (2017; 2018).

 bootmed.b.b.2<-boot.med(data=data.b.b.2,n=2,n2=40,nu=0.05,nonlinear=TRUE)
 summary(bootmed.b.b.2)
#> MMA Analysis: Estimated Mediation Effects Using MART
#> For Predictor/Moderator at pred 
#> $total.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.108  0.412  0.232  0.867 -0.043  0.702  0.182  0.727  0.168  0.076 
#> p_quan 
#>  0.000 
#> 
#> $direct.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.095  0.237  0.243  0.714 -0.239  0.542  0.003  0.566 -0.009  0.329 
#> p_quan 
#>  0.500 
#> 
#> $indirect.effect
#>        y1.all y1.tvhours y1.cmpthours y1.cellhours y1.exercises y1.sweat
#> est     0.013     -0.003       -0.003        0.013        0.002    0.001
#> mean    0.175      0.011        0.031        0.016       -0.011   -0.003
#> sd      0.056      0.005        0.018        0.020        0.019    0.009
#> upbd    0.284      0.021        0.066        0.056        0.026    0.015
#> lwbd    0.065      0.001       -0.003       -0.024       -0.048   -0.021
#> upbd_q  0.243      0.018        0.051        0.041        0.007    0.009
#> lwbd_q  0.117      0.008        0.012       -0.001       -0.033   -0.010
#> upbd_b  0.176      0.019        0.037        0.022        0.008    0.010
#> lwbd_b  0.113      0.008        0.011       -0.001       -0.016   -0.009
#> p_norm  0.002      0.035        0.076        0.420        0.571    0.757
#> p_quan  0.000      0.000        0.000        0.500        0.500    0.500
#>        y1.sports  y1.j1
#> est        0.040  0.008
#> mean       0.122  0.073
#> sd         0.037  0.049
#> upbd       0.194  0.168
#> lwbd       0.050 -0.023
#> upbd_q     0.156  0.122
#> lwbd_q     0.081  0.020
#> upbd_b     0.148  0.102
#> lwbd_b     0.079  0.018
#> p_norm     0.001  0.135
#> p_quan     0.000  0.000

Plots of the fitted mma object from boot.med

plot.mma() plots the marginal effect of the selected variable on the outcome, and the marginal effect of the predictor on the selected variable. Interpretations for similar plots can be found in Yu et al. (2017).

 plot(bootmed.b.b.1,vari="exercises",xlim=c(0,50))

 plot(bootmed.b.b.1,vari="sports")

Combined function for multiple TVE analysis

The mma function is a combined function that automatically identify potential MCs, based on which to make statistical inference on the mediation effects.

 x=weight_behavior[,c(2,4:14)]
 pred=weight_behavior[,3]
 y=weight_behavior[,15]
 mma.b.b.glm<-mma(x,y,pred=pred,contmed=c(7:9,11:12),binmed=c(6,10),binref=c(1,1), catmed=5,catref=1,predref="M",alpha=0.4,alpha2=0.4,n=2,n2=2)
#> [1] 1
#> [1] 2
 summary(mma.b.b.glm)
#> MMA Analysis: Estimated Mediation Effects Using GLM
#> For Predictor/Moderator at pred 
#> $total.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.651  0.101  0.108  0.312 -0.110  0.173  0.029  0.177  0.177  0.349 
#> p_quan 
#>  0.000 
#> 
#> $direct.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.463 -0.163  0.328  0.480 -0.806  0.057 -0.384  0.069  0.069  0.619 
#> p_quan 
#>  1.000 
#> 
#> $indirect.effect
#>        y1.all y1.exercises y1.sweat y1.sports
#> est     0.188       -0.012    0.013     0.153
#> mean    0.264       -0.005    0.013     0.281
#> sd      0.221        0.008    0.025     0.140
#> upbd    0.696        0.011    0.061     0.555
#> lwbd   -0.168       -0.022   -0.035     0.006
#> upbd_q  0.412        0.000    0.029     0.375
#> lwbd_q  0.116       -0.011   -0.004     0.186
#> upbd_b  0.182        0.182    0.182     0.182
#> lwbd_b -0.011       -0.011   -0.011    -0.011
#> p_norm  0.231        0.513    0.607     0.045
#> p_quan  0.000        1.000    1.000     0.000

When the argument nonlinear=TRUE, multiple Additive Regression Trees (MART) will be used to fit the final full model in estimating the outcome.

 mma.b.b.mart<-mma(x,y,pred=pred,contmed=c(7:9,11:12),binmed=c(6,10),binref=c(1,1), catmed=5,catref=1,predref="M",alpha=0.4,alpha2=0.4,nonlinear=TRUE,n=2,n2=5)
 summary(mma.b.b.mart)
 summary(mma.b.b.mart)
#> MMA Analysis: Estimated Mediation Effects Using MART
#> For Predictor/Moderator at pred 
#> $total.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.156  0.319  0.273  0.854 -0.216  0.741  0.112  0.299  0.106  0.243 
#> p_quan 
#>  0.000 
#> 
#> $direct.effect
#>    est   mean     sd   upbd   lwbd upbd_q lwbd_q upbd_b lwbd_b p_norm 
#>  0.098  0.183  0.227  0.628 -0.262  0.524  0.028  0.245  0.026  0.421 
#> p_quan 
#>  0.000 
#> 
#> $indirect.effect
#>        y1.all y1.exercises y1.sweat y1.sports
#> est     0.058       -0.005    0.006     0.065
#> mean    0.136        0.009    0.005     0.121
#> sd      0.078        0.053    0.019     0.040
#> upbd    0.289        0.112    0.042     0.200
#> lwbd   -0.017       -0.094   -0.031     0.042
#> upbd_q  0.230        0.079    0.032     0.142
#> lwbd_q  0.055       -0.055   -0.011     0.058
#> upbd_b  0.189        0.020    0.034     0.143
#> lwbd_b  0.054       -0.061   -0.011     0.050
#> p_norm  0.082        0.861    0.781     0.003
#> p_quan  0.000        0.800    0.800     0.000

plot(mma.b.b.mart,vari="exercises")

#> Error in pred_name[, z.b]: incorrect number of dimensions

plot(mma.b.b.glm,vari="sweat")

References

Yu, Qingzhao, and Bin Li. 2017. “Mma: An R Package for Mediation Analysis with Multiple Mediators.” Journal of Open Research Software 5 (1): 11. doi:10.5334/jors.160.

Yu, Qingzhao, Ying Fan, and Xiaocheng Wu. 2014. “General Multiple Mediation Analysis with an Application to Explore Racial Disparities in Breast Cancer Survival.” Journal of Biometrics & Biostatistics 5 (2). OMICS International.: 1–9. doi:10.4172/2155-6180.1000189.

Yu, Qingzhao, Kaelen L. Medeiros, Xiaocheng Wu, and Roxanne E. Jensen. 2018. “Nonlinear Predictive Models for Multiple Mediation Analysis: With an Application to Explore Ethnic Disparities in Anxiety and Depression Among Cancer Survivors.” Psychometrika 83 (4). Springer US: 991–1006. doi:10.1007/s11336-018-9612-2.

Yu, Qingzhao, Richard A. Scribner, Claudia Leonardi, Lu Zhang, Chi Park, Liwei Chen, and Neal R. Simonsen. 2017. “Exploring Racial Disparity in Obesity: A Mediation Analysis Considering Geo-Coded Environmental Factors.” Spatial and Spatio-Temporal Epidemiology 21: 13–23. doi:10.1016/j.sste.2017.02.001.

Yu, Qingzhao, Xiaocheng Wu, Bin Li, and Richard A. Scribner. 2019. “Multiple Mediation Analysis with Survival Outcomes: With an Application to Explore Racial Disparity in Breast Cancer Survival.” Statistics in Medicine 38 (3): 398–412. doi:10.1002/sim.7977.