BookmarkSubscribeRSS Feed
kyla123
Fluorite | Level 6

For an assignment I am trying to get the odds ratios of hpv shots and determining the association of poverty and using region as a confounder 

The code I am attempting to use is 

proc logistic data = puf.nisteenpuf19;

class cen_reg (param =ref ref= "NORTHEAST")incpov1 (param = ref ref = "ABOVE POVERTY > $75K") ;

model hpvi_group = incpov1 cen_reg incpov1*cen_reg;

run;

 

However in the output it doesn't give value for any northeast data and i need odds ratios for northeast_below poverty and northeast_above poverty <= $75k. it references all northeast values instead of just referencing northeast_above poverty >75$k

 

Hope this make sense

15 REPLIES 15
PaigeMiller
Diamond | Level 26

Show us the output that you have questions about.

--
Paige Miller
PaigeMiller
Diamond | Level 26

What happens if you include the ODDSRATIO statement in your code?

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_syntax26.htm

--
Paige Miller
kyla123
Fluorite | Level 6

I am not 100% sure how to include it

 

proc logistic data = puf.nisteenpuf19;

class cen_reg (param =ref ref= "NORTHEAST")incpov1 (param = ref ref = "ABOVE POVERTY > $75K") ;

model hpvi_group = incpov1 cen_reg incpov1*cen_reg;

oddsratio cen_reg incpov1 dif = ref | all;

run;

PaigeMiller
Diamond | Level 26

Was there a problem somewhere? I think it should be:

 

oddsratio cen_reg*incpov1 dif = all;

Please don't make us keep asking ... when there is a problem in the code, or a problem in the log, or a problem in the output ... show us.

--
Paige Miller
kyla123
Fluorite | Level 6

NOTE: PROCEDURE LOGISTIC used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
2891 proc logistic data = puf.nisteenpuf19;
2892 class cen_reg (param =ref ref= "NORTHEAST")incpov1 (param = ref ref = "ABOVE POVERTY >
2892! $75K") ;
2893 model hpvi_group = incpov1 cen_reg incpov1*cen_reg;
2894 oddsratio cen_reg*incpov1 dif = all;
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, /.
ERROR 76-322: Syntax error, statement will be ignored.
2895 run;
PaigeMiller
Diamond | Level 26

My mistake. I think it should be

 

oddsratio cen_reg*incpov1/dif = all;
--
Paige Miller
kyla123
Fluorite | Level 6
I received the same error message

NOTE: The SAS System stopped processing this step because of errors.
2896 proc logistic data = puf.nisteenpuf19;
2897 class cen_reg (param =ref ref= "NORTHEAST")incpov1 (param = ref ref = "ABOVE POVERTY >
2897! $75K") ;
2898 model hpvi_group = incpov1 cen_reg incpov1*cen_reg;
2899 oddsratio cen_reg*incpov1/dif = all;
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: ;, /.
ERROR 76-322: Syntax error, statement will be ignored.
2900 run;
PaigeMiller
Diamond | Level 26

Next step

 

When you have an error in the log, copy the log as text and paste it into the window that appears when you click on the </>. We need this every time you provide a log for us. This preserves the formatting of the log and makes it more readable.

 

2021-11-26 08_27_29-Reply to Message - SAS Support Communities — Mozilla Firefox.png

--
Paige Miller
kyla123
Fluorite | Level 6
NOTE: PROCEDURE LOGISTIC used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.
2910  proc logistic data = puf.nisteenpuf19;
2911  class cen_reg (param =ref ref= "NORTHEAST")incpov1 (param = ref ref = "ABOVE POVERTY >
2911! $75K") ;
2912  model hpvi_group = incpov1 cen_reg incpov1*cen_reg;
2913  oddsratio cen_reg*incpov1/dif = all;
                       -
                       22
                       76
ERROR 22-322: Syntax error, expecting one of the following: ;, /.
ERROR 76-322: Syntax error, statement will be ignored.
2914  run;

Sorry, I am very new to this 

kyla123
Fluorite | Level 6

I also tried using proc genmod but the output zeroed out all of northeast Screen Shot 2022-03-18 at 9.26.22 AM.png

 

Screen Shot 2022-03-18 at 9.26.04 AM.png

 

PROC GENMOD DATA = puf.nisteenpuf19;
class CEN_REG (ref = "NORTHEAST") INCPOV1 (REF= "ABOVE POVERTY > $75K");
model HPVI_GROUP = CEN_REG INCPOV1 AGE SEX RACEETHK INCPOV1*CEN_REG/DIST = BINOMIAL LINK = LOG;
RUN;
PaigeMiller
Diamond | Level 26

Apparently, ODDSRATIO will not work for interactions, so you should remove it. The default output from PROC LOGISTIC (without the ODDSRATIO statement) should show odds ratios for all model terms. Can you show us that odds ratio output?

--
Paige Miller
kyla123
Fluorite | Level 6

This is the output I receive when running pro logistic without the odds ratio statement

proc logistic data = puf.nisteenpuf19;
class cen_reg (param =ref ref= "NORTHEAST")incpov1 (param = ref ref = "ABOVE POVERTY > $75K") ;
model hpvi_group = incpov1 cen_reg incpov1*cen_reg;
run;

Screen Shot 2022-03-18 at 8.59.19 AM.pngScreen Shot 2022-03-18 at 9.44.55 AM.png

PaigeMiller
Diamond | Level 26

Ok. I don't know how to get odds ratios for interactions. The odds ratios for your two main effects are produced by these statements:

 

oddsratio cen_reg;
oddsratio incpov1;

 

 

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 15 replies
  • 2546 views
  • 1 like
  • 2 in conversation