Hello all, I'm conducting a propensity score match with the %GMATCH macro. There is a great content out there outlining sample code within a textbook with this macro that I have followed to ensure that my code is appropriate. Pre-Match we have 199 patients in the intervention group (treatment) and 802 observations in the comparator group (control). My 1:1 match was great, no issues. 180 patients matched to 180 patients. The code to call the %gmatch macro is below. %gmatch(
data = out_ps_dm9,
group = study_group,
id = id,
mvars = logit_ps_dm9,
wts = 1,
dist = 1,
dmaxk = &stdcal,
ncontls = 1,
seedca = 25102007,
seedco = 26102007,
out = matchpairs_dm9,
print = F
);
** Currently doing a 1 to 1 match, Match subjects on the logit of the propensity score. **; I'm struggling with the 1:2 match. When matching 1:2, the treatment group (intervention group) is being matched at a rate of 1:2, but the final dataset has 359 patients in intervention group and 359 patients in the comparator group. It is still only ~180 patients from the intervention group in the final dataset, but they are listed twice because they are associated with two pairs in the comparator group. How do I analyze the dataset with 359:359 patients? Using PROC PSMATCH and doing a 1:2 match, I had 180 patients matched to 360 patients in my final dataset. Below is my code of doing the %GMATCH with 1:2 matching: %gmatch(
DATA = out_ps_dm9, /* Data: the name of the SAS data set containing the treated and untreated subjects.*/
group = study_group, /* Group: the variable identifying treated/untreated subjects. */
id = id, /* Id: the variable denoting subjects’ identification numbers. */
mvars = logit_ps_dm9, /* Mvars: the list of variables on which one is matching.*/
wts = 1, /* Wts: the list of non-negative weights corresponding to each matching variable.*/
dist = 1,/* Dist: the type of distance to calculate [1 indicates weighted sum (over matching variables) of absolute case-control differences]*/
dmaxk = &stdcal, /* Dmaxk: the maximum allowable difference in the matching difference between matched treated and untreated subjects.*/
ncontls = 2, /* Ncontls: the number of untreated subjects to be matched to each treated subject.*/
seedca = 25102007, /* Seedca: the random number seed for sorting the treated subjects prior to matching.*/
seedco = 26102007, /* Seedco: the random number seed for sorting the untreated subjects prior to matching. */
out = matchpairs_dm92, /* Out: the name of a SAS data set containing the matched sample.*/
print = F /* Print: the flag indicating whether the matched data should be printed.*/
);
** Currently doing a 1 to 2 match, matching subjects on the logit of the propensity score. **;
DATA matchpairs_dm92;
SET matchpairs_dm92;
pair_id = _N_;
RUN;
PROC CONTENTS DATA = matchpairs_dm9 POSITION; RUN;
DATA control_match_dm92;
SET matchpairs_dm92;
control_id = __IDCO;
logit_ps = __CO1;
KEEP pair_id control_id logit_ps;
RUN;
/* Create a data set containing the matched comparator patients (untreated subjects) */
PROC CONTENTS DATA = control_match_dm92 POSITION; RUN;
DATA case_match_dm92;
SET matchpairs_dm92;
case_id = __IDCA;
logit_ps = __CA1;
KEEP pair_id case_id logit_ps;
RUN;
/* Create a data set containing the matched intervention patients (treated subjects) */
PROC CONTENTS DATA = case_match_dm92 POSITION; RUN;
PROC SORT DATA=control_match_dm92; BY control_id; RUN;
PROC SORT DATA=case_match_dm92; BY case_id; RUN;
DATA exposed_dm92;
SET out_ps_dm9;
IF study_group = 1;
case_id = id;
RUN;
PROC CONTENTS DATA = exposed_dm92 POSITION; RUN;
DATA control_dm92;
SET out_ps_dm9;
IF study_group = 0;
control_id = id;
RUN;
PROC CONTENTS DATA = control_dm92 POSITION; RUN;
PROC SORT DATA=exposed_dm92; BY case_id; RUN;
PROC SORT DATA=control_dm92; BY control_id; RUN;
DATA control_match_dm92;
MERGE control_match_dm92 (IN=f1) control_dm92 (IN=f2);
BY control_id;
IF f1 and f2;
RUN;
PROC CONTENTS DATA = control_match_dm92 POSITION; RUN;
DATA case_match_dm92;
MERGE case_match_dm92 (IN=f1) exposed_dm92 (IN=f2);
BY case_id;
IF f1 and f2;
RUN;
PROC CONTENTS DATA = case_match_dm92 POSITION; RUN;
DATA long_dm92;
SET control_match_dm92 case_match_dm92;
prop_score = exp(logit_ps) / (exp(logit_ps) + 1);
RUN; Thank you! I want to ensure that I am appropriately assessing both my groups with a 1:2 match and a 1:3 match. Tyler
... View more