Hi, I used SAS a code published here to match cases and controls using the "Linear Assignment - graph directed method" (published in 2020) - please see the code attached below. This code worked perfectly with my dataset and I could select controls on 1:5 with no duplicate controls. However, a researcher I worked with checked the code and mentioned that there is a possibility to select the controls "non-randomly" from this method. So, I want to know if this method selects the controls randomly or not. Could you please check the code and confirm to me if the controls are randomly selected in this method as random selection of controls is encouraged in this project? Thank you so much. The Code: data have; input case_id control_id; datalines; 1 10 1 125 1 1850 1 928 3 125 3 8 3 1276 3 1011 3 10 4 10 4 1011 ; data links1; set have; rename case_id=from control_id=to; weight = 1; run; proc optnet data_links=links1 GRAPH_DIRECTION=DIRECTED; linear_assignment out=want1; run; proc print data=want1; run; proc sql; create table links2 as select * from links1 where to not in (select to from want1); quit; proc optnet data_links=links2 GRAPH_DIRECTION=DIRECTED; linear_assignment out=want2; run; proc print data=want2; run; proc sql; create table links3 as select * from links2 where to not in (select to from want2); quit; proc optnet data_links=links3 GRAPH_DIRECTION=DIRECTED; linear_assignment out=want3; run; proc print data=want3; run; data want; set want1 want2 want3; rename from=case_id to=control_id; drop weight; run; proc sort data=want; by case_id control_id; run; proc print data=want noobs; run;
... View more