I have a simple dataset. Is it possible to obtain a p-value using the Cochran-Armitage test? The following is the table:
Group | Successes | Total Trials | Proportion |
1 | 20 | 500 | 0.04 |
2 | 30 | 1000 | 0.03 |
3 | 40 | 500 | 0.08 |
You have all the information you need. You will just need to restructure your data set like the following:
data test;
input Group Successes Total;
cards;
1 20 500
2 30 1000
3 40 500
;
run;
data test2;
set test;
resp='y';ct=successes;output;
resp='n';ct=total-successes;output;
run;
proc freq data=test2 order=data;
weight ct;
tables resp*group/trend;
run;
Yes. As long as your contingency table is 2xC or Rx2 , you can do Cochran-Armitage test.
But you need transform your data into this structure:
You have all the information you need. You will just need to restructure your data set like the following:
data test;
input Group Successes Total;
cards;
1 20 500
2 30 1000
3 40 500
;
run;
data test2;
set test;
resp='y';ct=successes;output;
resp='n';ct=total-successes;output;
run;
proc freq data=test2 order=data;
weight ct;
tables resp*group/trend;
run;
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.