☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-11-2025 10:39 PM
(499 views)
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 |
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How can I restructure my data to match the format you mentioned? I don't have any additional information.
Thanks!
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much for providing such a wonderful solution!