Programming the statistical procedures from SAS

PROC GENMOD ISSUE when computing the exact confidence interval for the relative risk

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

PROC GENMOD ISSUE when computing the exact confidence interval for the relative risk

Dear All,

 

In calculating the relative risk and corresponding exact 95% confidence intervals via exact Poisson regression using a log-linear model, the following scenario works (note that number of cases in group 2 = 1486);

data have1; * number of cases in group 2 = 1486 ;
input total cases group all;
log_total = log(total);
datalines;
14660 1529 1 1
14645 1486 2 1
;run;
proc genmod data=have1 exactonly; CLASS group(ref='1') all /PARAM=ref; model cases=group all /DIST=poisson OFFSET=log_total LINK=log; exact group /estimate outdist=dist ALPHA=0.05; exactoptions statustime=10 method=NETWORK; ODS OUTPUT ExactParmEst=estimate ExactTests=ExactTest; RUN;

 

 

The relative risk, lower and upper confidence limits are got by exponentiating the variables "estimate", "LowerCL" and "UpperCL" in the "estimate" dataset output via ODS OUTPUT.

 

HOWEVER, with a very slight change (number of cases = 1485), a computational issue is encountered, namely, "WARNING: Invalid confidence interval detected and set to missing".

 

data have2; * number of cases in group 2 = 1485 ;
input total cases group all;
log_total = log(total);
datalines;
14660   1529  1 1
14645   1485  2 1
;run;

proc genmod data=have2 exactonly;
CLASS  group(ref='1') all /PARAM=ref;
model cases=group all /DIST=poisson OFFSET=log_total LINK=log ;
exact group /estimate outdist=dist ALPHA=0.05;
exactoptions statustime=10 method=NETWORK;
ODS OUTPUT ExactParmEst=estimate ExactTests=ExactTest;
RUN;

What could be the issue here? Is this a potential bug in the genmod procedure? How can I solve this? I know a possible work-around is to set the reference group to group(ref='2') which results in the sign of the estimates being flipped. We can back-flip the sign of the estimates and get the needed RR, Lower and Upper limits by exponentiating. But this is just a work-around. What is the solution?

 

Many thanks in advance,

George

 


Accepted Solutions
Solution
‎04-27-2017 01:18 PM
SAS Super FREQ
Posts: 3,548

Re: PROC GENMOD ISSUE when computing the exact confidence interval for the relative risk

I ran your programs at SAS 9.4m3 (SAS/STAT 14.2) and the warning does not appear. I assume that this was a problem in an earlier release that has been fixed. I don't know what version of SAS implemented this change, but Technical Support can provide you with that information, and probably additional details.

 

View solution in original post


All Replies
Solution
‎04-27-2017 01:18 PM
SAS Super FREQ
Posts: 3,548

Re: PROC GENMOD ISSUE when computing the exact confidence interval for the relative risk

I ran your programs at SAS 9.4m3 (SAS/STAT 14.2) and the warning does not appear. I assume that this was a problem in an earlier release that has been fixed. I don't know what version of SAS implemented this change, but Technical Support can provide you with that information, and probably additional details.

 

Occasional Contributor
Posts: 6

Re: PROC GENMOD ISSUE when computing the exact confidence interval for the relative risk

Thanks Rick. Indeed, this seems to be an issue in SAS versions 9.3M2 and lower (at least tested on 9.2 as well).

 

SAS Super FREQ
Posts: 3,548

Re: PROC GENMOD ISSUE when computing the exact confidence interval for the relative risk

Glad you zeroed in on the problem. FYI, there have been five releases of SAS since SAS 9.3m2. There are some amazing features in SAS 9.4m4, not only in SAS/STAT but also in the graphics that are available in PROC SGPLOT. I hope you get a chance to upgrade to SAS 9.4m4 or (later this year) SAS 9.4m5.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 196 views
  • 0 likes
  • 2 in conversation