BookmarkSubscribeRSS Feed
zaldarsa
Obsidian | Level 7

Hi!

I am trying to do a mediation analysis in which brain volumes are the mediator (continuous), meditteranean diet the exposure (continuous), and cognitive test scores (continuous) the outcome. However, whenver I run the analysis I get the following message in the log and my code:

WARNING: The covariance matrix for the outcome model is not positive definite. The convergence is
         questionable.
WARNING: The covariance matrix for the mediator model is not positive definite. The convergence is
         questionable.
WARNING: Standard errors are not computed for the effect estimates.


proc causalmed data=cog;
   model  icogstroop  = Meddietavg per_TBV25 ;
   mediator per_TBV25 =Meddietavg ;
   covar age0 sex race center education avgpact smoke avgbmi caloriesavg htn anycvd diab2hhba1ccum25;
run;


Thank you in advance for your help!

 

4 REPLIES 4
pink_poodle
Barite | Level 11
Would the warning go away if you comment out the covar statement?
zaldarsa
Obsidian | Level 7

Yes, the error message did go away, so I decided to just do the mediation analysis without the covariates!

pink_poodle
Barite | Level 11
That is because of overfitting. It is usually one or two of them that have a lot of categories. Like @SAS_Rob said, you can try adding them back one-by-one and leave out the trouble-makers.
SAS_Rob
SAS Employee

The general meaning of the message is that the data does not support either of the causal models.  The likely culprit is one or more of the covariates causing a singularity in the model.  Unfortunately it is sometimes difficult to know which one(s) so in practice the easiest thing to do is a process of elimination by starting with just a single covariate and then adding from there until the problem occurs.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 736 views
  • 4 likes
  • 3 in conversation