BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Reeza
Super User

Yes the p-value is common. If you want individual p-values need to run contrast tests.

For other variables add /expb after the model statement or oddsratio statements for each variable.

Ashwini_uci
Obsidian | Level 7

i am trying to get the output by using  contrast statement now,

this is what my program looks like, but i am not sure what numbers should i consider in the line after the contrast statement

female (anyproc1 ) 1 0 -1 000/estimate=both;

i am wondering what to use in place of 10 -1 000, my variables are binary, as explained in previous posts. (female= 0 and 1 and anyproc1 =0 and 1).

thanks much,

Proc logistic data=library.nismicathcabg4 descending ;

Class female  (ref= first) dm dmcx htn_c  aids alcohol ANEMDEF arth race1(ref=first)   ZIPINC_QRTL(ref=first) hosp_location h_contrl(ref=first) hosp_teach bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail tumor anyproc1  ulcer valve wghtloss cararrhythmia  /param=ref;

Model died = age  dm dmcx htn_c  aids alcohol ANEMDEF arth race1 zipinc_qrtl hosp_location h_contrl hosp_teach  TOTAL_DISC

bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail   tumor

ulcer valve wghtloss cararrhythmia anyproc1 female (anyproc1 )/expb ;

where  stemi=0;

contrast 'female 1 vs 0 in anyproc1'

female (anyproc1 ) 1 0 -1 000/estimate=both;

weight discwt;

title 'Logi Reg interaction between anyproc vs gender in NSTEMI patients using "where" option with RACE ';

run;

Reeza
Super User

Did you get the 3 odds ratio you needed?

I'm not familiar with the syntax for the contrast statement.

Ashwini_uci
Obsidian | Level 7

no i didnt . what i got is in the file attached above' interaction1.pdf.

I tried following to get the odds ration compared to the ref intercation term,

but it gave me 2 ORs. They are the last 2 outputs in the attched file interaction1.pdf.

Is there anyhitng more i can add to get those required ORs?

also all the ORs are male vs females, where do i add a statement to get ORs as female vs male

thanks,

Proc logistic data=library.nismicathcabg4 descending ;

Class female  (ref= first) dm dmcx htn_c  aids alcohol ANEMDEF arth race1(ref=first)   ZIPINC_QRTL(ref=first) hosp_location h_contrl(ref=first) hosp_teach bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail tumor anyproc1 ulcer valve wghtloss cararrhythmia  /param=ref;

Model died = age female  dm dmcx htn_c  aids alcohol ANEMDEF arth race1 zipinc_qrtl hosp_location h_contrl hosp_teach  TOTAL_DISC

bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail  anyproc1  tumor ulcer valve wghtloss cararrhythmia female*anyproc1 ;

where stemi=0;

oddsratio female / at(anyproc1='0');

oddsratio female  / at(anyproc1='1');

weight discwt;

title 'Logi Reg interaction between anyproc vs gender in Nstemi ';

run;

Ashwini_uci
Obsidian | Level 7

where exactly in the model should i set the reference level? i tried to do it in the oddsratio statement, but it showing me syntax error..

Reeza
Super User

Are you sure the code you attached had an interaction term? I didn't search thoroughly but didn't see it.

You should see the p-value in your parameter estimates section, see the example here:

http://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/viewer.htm#statug_logistic_sec...

See output 51.2.3 where the treatment*sex has the diff levels and the p-values. That's what you should see in your output or look for at least.

Also to get your output to PDF you can do the following instead of the conversion that your currently doing:

ods pdf file='C:\test.pdf';

title 'this is my nicer looking pdf';

proc print data=sashelp.class;

run;

ods pdf close;

Ashwini_uci
Obsidian | Level 7

Thanks for sharing the code for creating pdf..

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 36 replies
  • 25355 views
  • 0 likes
  • 4 in conversation