@Khalid2015 wrote:
Hello , I have 2 groups (endovascular and surgical ) each one has good outcome and bad outcome , how can I calculate chi square for the difference between the two groups ? I am inputing these in SAS:
data procedure;
input procedrue $ good_outcome bad_outcome ;
cards;
surgical 500 200
endovascular 300 150
;
run;
Thanks
Chi-squares don't do 'difference between groups', they test difference in distributions between groups.
To do "difference between groups" you need to define how you are getting "difference".
Perhaps:
data procedure;
input procedure $12. good_outcome bad_outcome;
outcome='Good';
freq=good_outcome;
output;
outcome='Bad';
freq=bad_outcome;
output;
cards;
surgical 500 200
endovascular 300 150
;
run;
proc freq data=procedure;
tables procedure*outcome/ chisq;
weight freq;
run;
Note creating a single variable with two levels from two variables. Using a frequency count to maintain the sample size information (more or less). This will generally be the better way to prepare data for most of the analysis procedures in SAS.