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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: