BookmarkSubscribeRSS Feed
_maldini_
Barite | Level 11

I am struggling to request Odds Ratios (ORs) in PROC SURVEYFREQ with an independent variable that has more than 2 levels.

When I use the RESRISK option, I get the following error:

Screen Shot 2022-06-14 at 1.32.50 PM.png

I'm not sure what this error is telling me.

 

I have successfully used the RELRISK option in the past w/ a different data set, but the independent variable only had 2 levels (e.g., explains_re):

PROC SURVEYFREQ DATA=cap.subset_2; 
	repweight rakedw1--rakedw80 / jkcoefs=1; 
	WEIGHT rakedw0; 
	TABLE flag_5*explains_re*confid_re / ROW EXPECTED CHISQ CELLCHI2 RELRISK; 
	FORMAT explains_re explains_re_difmt. confid_re confid_re_difmt.; 
RUN; 

With the current data set, the independent variable has 4 levels. The RELRISK option doesn't produce RRs or ORs. And, there is no mention of it in the log, as opposed to the error message when I use RESRISK.

Screen Shot 2022-06-14 at 1.40.04 PM.png

To summarize, the syntax I have used in the past produces ORs, but only when the independent variable has 2 levels. I'm seeking syntax that produces ORs w/ an independent variable that has 4 levels.

 

Thanks.

1 REPLY 1
ballardw
Super User

The error message is telling you that RESRISK is not a valid option in your version of Surveyfreq. Since the documentation for the procedure at https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_surveyfreq_syntax06.htm does not include RESRISK where did you get that as an option?

With that error no output should be generated.

 

So make sure you use RELRISK, not RESRISK.

 

If you want ODDS Ratios for more levels you may be looking at Proc Surveylogistic.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 411 views
  • 2 likes
  • 2 in conversation