Hello,
How to calculate or get odds ratio and relative risk for Overall response table. I have 2 treatment group.
I tried with proc freq,
proc freq data=workorr;
by trt01pn mainord;
table ord / chisq relrisk;
weight count;
output chisq relrisk out=ratio;
run;
/****OR***/
ods listing close;
ods output cmh = relrto;
proc freq data=orr2 ;
by mainord ;
tables stratan*trt01pn*ord / cmh relrisk;
run;
But I am not getting in output dataset. I am only getting chi sq. value for first code and p value for second code.
I got risk diff. (RD) with below code.
ods trace on;
/*95% CI*/
proc freq data=workorr;
by trt01pn mainord ;
table ord / binomial ;
exact binomial;
weight count / zero ; /*add this for zero CI's*/
output binomial out=orr_ ;
RUN;
ods trace off;
please let me know if I am missing something or doing something wrong.
Thanks you.
OR and RR are all for 2x2 contingency table, so you need 2 category variables with 2 levels to calculated them.
https://support.sas.com/kb/23/003.html
For high dimension contingency table:
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.
Ready to level-up your skills? Choose your own adventure.