From a sample of 1000 patients, the number who take a certain drug within 6 months BEFORE a heart attack is 400, and the number who take that drug within 6 months AFTER a heart attack is 550. What SAS test can I run to determine if the BEFORE and AFTER numbers are significantly different? Note that some patients may be in both groups. thanks.
As shown in the output stat, the p-value (<.0001) suggests that the two groups (before and after) are not independent. Look into the Risk Estimates table, there is significant difference between the group proportions.
You have paired data: 1000 observations of the form NN, NY, YN, YY. As such you might wish to apply McNemar's test, which is part of the output from the AGREE option in Proc Freq.
2025 SAS Hackathon: There is still time!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!