BookmarkSubscribeRSS Feed
Maya1
Fluorite | Level 6

Hello ,

 

when I run the following macro, I sometimes encounter the error "Termination due to Floating Point Exception".

 

%macro mult (dsin=,sc=);
ods output ParameterEstimates=pe_sc&sc. estimates=est_sc&sc.
proc glimmix data=&dsin method= laplace;

by study;
class response predictor patient;
model response= predictor/ dist=multinomial link=glogit s cl;
random predictor  /sub=patient group=response G type= Chol;     
nloptions maxiter=5000 tech=quanew;   
parms / lowerb=1e-4,.,1e-4,1e-4,., 1e-4;    
freq count;
estimate "Predictor=0" intercept 1 predictor 1 0 / cl ilink bycat;          
estimate "Predictor=1" intercept 1 predictor 0 1 / cl ilink bycat;   
run;
%mend mult;

 

The procedure converges for the respecitve cases, however, as one estimate for the predictor is 0, the estimate-statement causes the termination. Without "estimate "Predictor=0" intercept 1 predictor 1 0 / cl ilink bycat;estimate "Predictor=1" intercept 1 predictor 0 1 / cl ilink bycat;" , the procedure continues with the next by-group (=study) without any problems. Because I need the macro to go through every by-group, my question is:  Is there any chance to add a condition in the macro that only executes the estimate statement if the estimates are non-zero and writes missing values into the ods estimates-table otherwise? If not, how could I catch the termination error as variable and continue with the next by-group?

 

Thanks in advance, M

 

 

 

3 REPLIES 3
SteveDenham
Jade | Level 19

Would it make sense to replace the ESTIMATE statements with LSMESTIMATE statements?

 

Something like

 

LSMESTIMATE predictor 'Predictor=0' 1 0/ilink cl;

LSMESTIMATE predictor 'Predictor=1' 0 1/ilink cl;

 

Or move to LSMEANS, and use the ODDS and ODDSRATIO options.

 

Steve Denham

Maya1
Fluorite | Level 6

Thank you for your time, Mr Denham. Unfortunately, least square means are not available for dist=mult in proc glimmix. So neither lsmeans nor lsmestimate works. Odds ratios are also not an option in my case. Is there any possibility to "catch" the estimate for the predictor if it is zero before the estimate-statement is executed? In which system variable could I possibly find this error and with which value? 

Thanks again + regards,

M

 

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

I can't think of any tricks to flag results within a glimmix run to decide whether or not to execute estimate statements within the same run. I can think of an alternative, but I don't have the time to write out the needed code. You would take out all your estimate statements, and put your results in an item store (using the STORE statement within glimmix). You would also save other results using ODS OUTPUT statements or the OUTPUT statement, such as the predicted values. In a DATA step, you would identify whether the prediction (or whatever) was 0 or not.  If not 0, you would then run PROC PLM (with RESTORE statement to get results from glimmix), which would have the needed estimate statements. If prediction was 0, you could then execute a different PROC PLM with estimate statements that would work.  The main programming work would be done within a DATA step.

 

I know this is just a general suggestion, but it allows you to selectively use estimate statements based on certain results from a model fit.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 1906 views
  • 4 likes
  • 3 in conversation