Hi,
I was comparing the results of the PROC CAUSALMED procedure and the SAS macro given in the paper "Mediation Analysis Allowing for Exposure–Mediator Interactions and Causal Interpretation: Theoretical Assumptions and Implementation With SAS and SPSS Macros" by Valeri and VanderWeele.
Outcome=Binary
Exposure/Treatment=Binary
Mediator=Binary
All coded as 0 and 1.
However, the results obtained somewhat differ.
A] Program and Output of the macro
%mediation(data=anak23,yvar=BPControlBoth,avar=VL_LT200,mvar=MMAS_NonAdh,cvar=,a0=0,a1=1,m=0,yreg=logistic,mreg=logistic, interaction=false,casecontrol=,output=,c=,boot=,cens=);
run;
SAS Output
cde | 2.25450 | 0.044196 | 1.02132 | 4.97666 |
nde | 2.25450 | 0.044196 | 1.02132 | 4.97666 |
nie | 1.22482 | 0.047073 | 1.00262 | 1.49627 |
total effect | 2.76137 | 0.013251 | 1.23613 | 6.16857 |
proportion mediated | 0.28777 |
0.2299 | 0.0913 | 0.05089 | 0.4089 | 2.52 | 0.0118 |
0.1932 | 0.0908 | 0.01530 | 0.3711 | 2.13 | 0.0333 |
0.1932 | 0.0908 | 0.01530 | 0.3711 | 2.13 | 0.0333 |
0.0367 | 0.0191 | -0.00078 | 0.07417 | 1.92 | 0.0550 |
15.9613 | 9.7584 | -3.1648 | 35.0875 | 1.64 | 0.1019 |
0 | . | . | . | . | . |
15.9613 | 9.7584 | -3.1648 | 35.0875 | 1.64 | 0.1019 |
Just to highlight the results of the NIE and % mediated.
macro Causalmed
p-value 0.047 0.055
% mediated 28.78 15.96
Thanks.
I believe the issue is that the PROC CAUSALMED code does not specify that the outcome, mediator, and treatment are binary, so as a result the CAUSALMED procedure is modeling the outcome and mediator with a normal distribution not logistic regression. You can check if this is the case by looking at the "Model Information" table produced with the example code.
Specifying the mediator and treatment variables in the CLASS statement will indicate that they are binary and you can use the DIST=bin option in the MODEL statement to indicate the outcome is binary and should be modeled using logistic regression. The third example in the documentation for PROC CAUSALMED has an example of causal mediation analysis with treatment, outcome, and mediator, all binary.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.