BookmarkSubscribeRSS Feed
gizat
Calcite | Level 5
Dear SAS experts,
 

For my matched case-control study, I’m preparing my data for a conditional logistic regression.  Using the matching variables, I’ve got a dataset containing the details for cohort (cases and controls identified). At this stage I know my cases and the controls. However, I do not know which controls were matched to which case. I need to make risk sets or strata so that I can perform conditional logistic regression. 

 

Each case and control have unique identifying variable, I want to identify the controls matched to each case. Could you please help me how I can link the cases to their matched controls and assign them a specific id for each? My matching ration is 1:3.

 

Looking forward to hearing from you. 

Thank you,

 

2 REPLIES 2
smantha
Lapis Lazuli | Level 10
Do you know if the match variables overlap between cases. If not you can use the following logic. Group is the variable that has case or control values.
Proc sort data= have; by match1 match2 match3 group
Data want;
Set have;
By match1 match2 match3;
Retain caseno 0;
If first.match1 then caseno=caseno+1;
Run;
This works well only if match1 match2 and match3 are all discrete values and matches are exact. If you are doing a match on ranges you can split your have dataset into two datasets one containing all the records of cases only, and the other containing all records. Then do a sql join on both datasets.
gizat
Calcite | Level 5

Hi Smantha,

 

Yes, they do. I've three matching variables; age (+-2 years), gender (match same gender) and year of hospital admission (+-2 years). What I want is to choose three controls for per case among possible controls and want to identify the controls matched to each case. 

More help is appreciated!

 

Kind regards,

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 503 views
  • 0 likes
  • 2 in conversation