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;
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;
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.