I am trying to use PROC CAUSALMED through SAS OnDemand for Academics (SAS Studio). I'd like to obtain the bootstrap CI for the mediation effect in a very simple mediation model (one predictor, one mediator). I am using the program shown below, and am getting the warning messages below the program (and no standard errors or test output). The variables are all continuous, and are somewhat correlated but are not linearly dependent. I can get all output using PROC REG so I know the models can be estimated. Any ideas on how I can get output for testing the mediation effect?
Thanks in advance.
PROC CAUSALMED data=ch3ex;
model salary = Time Cits;
mediator Cits = Time;
bootstrap;
run;
WARNING: The covariance matrix for the outcome model is not positive definite. The convergence is questionable.
WARNING: Standard errors are not computed for the effect estimates.
WARNING: Bootstrapping is not done because the convergence of the fitting for either the outcome or the mediator model is
questionable.
Hello,
My colleague @SAS_Rob is probably a good "resource" to help you out here.
I would say the data is not supporting the model but that may be a little short (the model is indeed very simple and you can fit something close to it with PROC REG).
This usage note may be an additional inspiration :
Usage Note 59081: Mediation analysis
http://support.sas.com/kb/59/081.html
Good luck,
Koen
Can you run the following and post the output and LOG?
PROC reg data=ch3ex;
model salary = Time Cits/collin;
run;
Sure; I even added vif... 😉
Collinearity is not an issue.
Could you also post the full output from:
proc means data=ch3ex min max mean std;
var salary Time Cits;
run;
I suspect that, given the magnitude of the estimates, the data itself might be ill-conditioned, but this would confirm that.
Sure, here is the output:
It's really a very simple data set and I find it strange that it is causing problems for this PROC.
Update: based on your response, I used salary/1000 instead of salary and that produced output. The coefficients would be on a different scale, though, and I'm not sure how I'd explain the need for this. If you have an explanation as to why/when re-scaling is necessary, I'd be interested in understanding it better (and I hope that in the future the PROC can be made more flexible). Thanks!
Very often you will see things such as salary reported on a different scale for this reason--ill conditioned data due to large units. All you end up doing is changing the units by rescaling so you would just report the results in the new units.
I can certainly re-scale, it is just unclear why it would be considered ill-conditioned with this PROC when it can be analyzed (and the models converge) without issue using all other regression procedures.
I would also gently recommend a more accurate/informative "Warning" message for this situation (in case anyone who has control over that reads this).
In any case, thanks for identifying the problem.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.