Hi there,
I am working on a case control study, for each case, I have 20 controls, but I would like to further select a smaller sample with 5 controls per case. How can I select it randomly without replacement? I have googled it and seems like proc surveyselect could be a good solution for my case, however I don't know how to specify the parameters to get what I want, anyone got any ideas?
A sample dataset would look like this:
data have;
input n id;
datalines
1 12
1 13
1 14
1 15
1 16
1 17
1 18
2 35
2 40
2 56
2 57
2 58
2 59
2 60
;
run;
where n refers to case id, and id refers to control id, I would like to select 5 controls per case randomly.
Thanks!