- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try adding the NODUPKEY option in the PROC SORT. Does that fix it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try adding the NODUPKEY option in the PROC SORT. Does that fix it?