BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
4 REPLIES 4
Olivier
Pyrite | Level 9
You seem to need a proportion test. You can perform an equivalent to proportion test with PROC FREQ and chi-2 test (cross BEFORE/AFTER with GROUP).

Regards
Olivier
deleted_user
Not applicable
Olivier: thanks for your reply. Can you provide more detail on the cross you mention? It seems that I have the following 2x2 table:


Group 1(Before): No (600) Yes (400)

Group 2 (After): No (450) Yes (550)
deleted_user
Not applicable
Assuming that you are looking for chi-square test of independence and estimate the difference in the proportion of the two groups; here is the code-

data test;
input grp $ n_y $ n;
datalines;
before no 600
before yes 400
after no 450
after yes 550
;
run;

proc freq data=test;
tables grp*n_y/chisq riskdiff;
weight n;
run;

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.

Hope this helps.
deleted_user
Not applicable
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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 4 replies
  • 952 views
  • 0 likes
  • 2 in conversation