BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Cruise
Ammonite | Level 13

Hi All,

 

I'm trying to calculate 95%CI of interaction terms (povcat|racecat) in PROC GENMOD. Both povcat and racecat are categorical variables. The 95% confidence intervals for RR's based on one estimate are outputted (Wald 95% CI).

 

I'd like to calculate 95% CI for those with two estimates (interaction terms) based on the variance by taking the square root. 

 

My question is what is the option that I can specify in PROC GENMOD to output variance-covariance matrix V (a+b) = V(a) + V(b) - CoV (a, b)? 

 

Thanks so much for help.

/*sashelp dataset*/
proc genmod data=sashelp.cars;
class DriveTrain(ref="Front") type(ref="SUV") origin(ref="Asia")/param=ref;
model MPG_Highway=DriveTrain type origin type|origin/dist=negbin link=log offset=ln;
run;

/*my model*/
proc genmod data=temp;
class zone(ref="0") povcat(ref="1") racecat(ref="0") agecat(ref="6")/param=ref;
model OUTCOME=zone povcat racecat1 agecat povcat|racecat
/dist=negbin link=log offset=ln maxiter=5000;
run;
ods rtf close;
data par1 (keep=PARAMETER LEVEL1 LEVEL2 RR LOW_RR UP_RR); set par;
RR= exp(estimate);
low_rr=exp(estimate-(1.96*stderr));
up_rr=exp(estimate+(1.96*stderr));
where PARAMETER not in ('Intercept','Scale');
run;
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

You want this ?

 

ods output CovB=want;
proc genmod data=sashelp.cars;
class DriveTrain(ref="Front") type(ref="SUV") origin(ref="Asia")/param=ref;
model MPG_Highway=DriveTrain type origin type|origin/covb dist=negbin link=log ;
run;


proc print data=want noobs;run;

View solution in original post

1 REPLY 1
Ksharp
Super User

You want this ?

 

ods output CovB=want;
proc genmod data=sashelp.cars;
class DriveTrain(ref="Front") type(ref="SUV") origin(ref="Asia")/param=ref;
model MPG_Highway=DriveTrain type origin type|origin/covb dist=negbin link=log ;
run;


proc print data=want noobs;run;

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
  • 2268 views
  • 1 like
  • 2 in conversation