- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Show us the output that you have questions about.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
My mistake. I think it should be
oddsratio cen_reg*incpov1/dif = all;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I also tried using proc genmod but the output zeroed out all of northeast
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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