I am trying to match based on gender and facility, but am running into trouble with repeated controls. Is there a way to specify that each control observation can only be picked once so I don't wind up with repeats? This is what I have so far and my dataset looks somewhat like this
MRN Gender Facility
1 1 facility1
2 0 facility2
PROC SQL;
CREATE table controls_id
as select
one.Gender as control_Gender,
two.Gender as case_Gender,
one.Facilitys as control_fac,
two.Facilitys as case_fac,
FROM control one, cases two
where ( one.Facilitys=two.Facilitys and one.Gender=two.Gender);
proc sort data =controls_id out=controls_ids;
by control_id case_id ;
run;
proc surveyselect data=controls_ids method=srs n=3 out=caseids;
strata control_id ;
SAMPLINGUNIT case_id;
run;
Try adding the NODUPKEY option in the PROC SORT. Does that fix it?
Try adding the NODUPKEY option in the PROC SORT. Does that fix it?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.