BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mepidemiology
Fluorite | Level 6

 Hello!

 

I am trying to perform a mediation analysis using PROC CAUSALMED and the outcome is a binary variable. I've set dist=binomial and link=log, and I've tried dist=binary and link=log. Each time I receive these warnings:

WARNING: At least one element of the gradient for the outcome model is greater than 1e-3.
WARNING: The Hessian for the outcome model has been ridged with a maximum value of 524288.
Standard errors might not be accurate.

 

Does anyone know a) what these mean and b) how I can fix them? Thank you!!

1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ
Both messages indicate numerical problems fitting the model. This is extremely common when fitting a binary response model using a link function other than the default logit link. The log link does not guarantee that the estimated values are in the valid range for a binomial mean - between 0 and 1. So, use the logit link and see if that fixes the problem.

View solution in original post

6 REPLIES 6
StatDave
SAS Super FREQ
Both messages indicate numerical problems fitting the model. This is extremely common when fitting a binary response model using a link function other than the default logit link. The log link does not guarantee that the estimated values are in the valid range for a binomial mean - between 0 and 1. So, use the logit link and see if that fixes the problem.
mepidemiology
Fluorite | Level 6

Thank you! I have tried this and while it does work, it only provides the Odds Ratio. I am trying to get the Risk Ratio (and link=log was suggested) because I'm trying to compare the output from R to SAS, but this is the problem I'm encountering.

SAS_Rob
SAS Employee

When you use the LOG link then they are actually relative risks and not odds ratios. They are mislabeled in earlier releases, but the more recent releases reflects the proper labeling, but  the label will say Odds Ratios until then.

 

SAS_Rob
SAS Employee

Without seeing the LOG with the CAUSALMED code in it, it is hard to be specific, but in general the message means that there are convergence issues with the outcome model.  The usual approach to solve the issue would be to simplify the model by either removing covariates from the COVAR statement or by removing the interaction between the mediator and treatment.

llllllll1
Calcite | Level 5

Hello, I'm handling the same problem recently. Since the outcome variable is not rare, the log link was suggested in SAS help. 

I've read these solutions you suggested, but as you can see, I've no reason to reduce those covariates, and there is no interaction option initially, so what else can I do to treat this problem, or if I can ignore the warnings?

 

code is as follows:

proc casusalmed data=data all;

class X(ref=first) M(ref=last) Y(ref=first) C(ref=first);

model Y=X M /link=log;

mediator M=X;

covar c;

run;

 

ballardw
Super User

You should include the entire code of the procedure call along with all of the messages from the log. IF you tried multiple sets of options then include them as well.

 

The folks that know more about this procedure may see some other option(s) that might be contributing to the issue. Plus then you don't get suggestions for options that you are already using.

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
  • 6 replies
  • 742 views
  • 1 like
  • 5 in conversation