Skip to main content
. 2019 May 8;2:4. doi: 10.3389/fdata.2019.00004

Table 5.

Lines 39–54.

Line Code
39. PROC FREQ NOPRINT DATA = matches;
40.    TABLES case_age*case_gender/OUT = con_out;
41. PROC SORT DATA = caseout(RENAME =
                         (age = case_age gender = case_gender
count = case_cnt));
42.   BY case_age case_gender;
43. PROC SORT DATA = con_out (RENAME = (count = con_cnt));
44.   BY case_age case_gender;
45. DATA final (DROP = percent);
46.   MERGE caseout con_out;
47.   BY case_age case_gender;
48. con_need = case_cnt*∶
49. IF con_cnt = . THEN con_cnt = 0;
50. diff = con_cnt-con_need;
51. PROC PRINT DATA = final;
52.   WHERE diff< 0;
53.   TITLE ‘Insufficient Matches’;
54. RUN;

To investigate whether all cases have received the desired amount of matched controls, the code in this table may be used. It results in a table showing the cases missing one or more matched controls.