05-16-2018 11:03 AM
I'm trying to create a dataset where I match subjects by age (+/- 1 yr), gender, and county. I would want the final dataset to have individual observations for each subject, with an additional matched ID variable that identifies each group.
How can I go about it??
When I do it using SQL, I end up with one observation with all the ids of everyone that has been matched.
create table matches_age as
a.id as v_id,
b.id as nv_id,
a.birth_yr as v_birth_yr,
b.birth_yr as nv_birth_yr,
a.county_2013 as v_county_2013,
b.county_2013 as nv_county_2013,
a.gender_cd as v_gender_cd,
b.gender_cd as nv_gender_cd,
b.rand_num as rand_num
from v a, nv2 b
where ((a.birth_yr between b.birth_yr_high and b.birth_yr_low)
and a.county_2013=b.county_2013 and a.gender_cd=b.gender_cd);
05-16-2018 11:20 AM
From what I'm reading, it seems like it's used to identify multiple observations of the same subject. I would want to match cases and controls with similar characteristics and assign each group of cases/controls a unique value.
05-16-2018 11:37 AM
What version of SAS do you have?
PROC PSMATCH is for probabilistic linkages and/or the Mayo Clinic matching macros?
Mayo Clinic macros
05-16-2018 05:27 PM
I have SAS 9.4 TS Level 1M2 X64_7PRO.
I don't want to do propensity score as in PSMATCH.
I just want to select observations that have the same birth_yr, gender, and county and assign a unique number to it.