BookmarkSubscribeRSS Feed
HitmonTran
Pyrite | Level 9

Hi I am receiving an error in log message for proc genmod when determining Relative Risk.  This is caused because there are results for one treatment arm and zero for the other.  Since my current program is macrotized with other subsets, it doesn't always display a message.

So, how would I prevent the log from displaying an error message in this situation? thanks

 

HitmonTran_0-1612112244353.png

 

	proc genmod data = aetime; 
		class actarm(ref='Placebo') usubjid;
		model aecnt = actarm  
		      / dist = poisson link = log offset=futime;
		estimate 'Rel Risk' actarm 1 -1/ exp;
		repeated subject = usubjid/ type = unstr;
		ods output estimates=RELRISK(where=(label='Rel Risk'));
	run;

 

1 REPLY 1
ballardw
Super User

@HitmonTran wrote:

Hi I am receiving an error in log message for proc genmod when determining Relative Risk.  This is caused because there are results for one treatment arm and zero for the other.  Since my current program is macrotized with other subsets, it doesn't always display a message.

So, how would I prevent the log from displaying an error message in this situation? thanks

 

HitmonTran_0-1612112244353.png

 

	proc genmod data = aetime; 
		class actarm(ref='Placebo') usubjid;
		model aecnt = actarm  
		      / dist = poisson link = log offset=futime;
		estimate 'Rel Risk' actarm 1 -1/ exp;
		repeated subject = usubjid/ type = unstr;
		ods output estimates=RELRISK(where=(label='Rel Risk'));
	run;

 


If you know the cause is " are results for one treatment arm and zero for the other" then test that before calling the procedure. If the error case is in effect do not call the procedure.

You need to decide what the result data set should look like in that case.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 864 views
  • 0 likes
  • 2 in conversation