Hi
I have a data set with 134 people in the treatment group and 17.000 people in the potential statistical control group.
I want to do exact matching, where each person in the treatment group gets 5 exact matches from the control group.
My problem is that I want to include the persons status in the month they began treatment in the matching, but the control group doesn't have a start month, because they didn't receive treatment. So I want each treated persons 5 matches to be assigned the same "start month", so I compare their statuses at the same time.
The problem is that I only learn the control groups start month after they have been matches to a specific treated person. But I can't do the matching, unless I know at what month to look at the control group's status. So it's a bit of a conundrum.
I'm thinking it must be some kind of macro where I look at each person in the treatment group one at a time, find all their matches (without the status), look at their status on the treated person's start month, and assign 5 matches who have the same status at the same time. And then do the same for de other 133 people, one at a time.
Does anyone have experience with this and is able to help me?
Thanks a lot! 🙂
Please supply usable example data (in a DATA step with DATALINES/CARDS, as shown here) so we get an idea about your data structure and have something to test code against.
Please include the expected result of the transformation.
Would you consider to use the propensity score matching?
According to your statement, I think that using proc psmatch might be helpful.
For example:
proc psmatch data=drugs region=cs; class Drug Gender; psmodel Drug(Treated='Drug_X')= Gender Age Bmi; match method=exact(k=5) exact=Gender stat=lps caliper=0.25; assess lps var=(Gender Age Bmi) / weight=none plots=(boxplot barchart); output out(obs=match)=Outgs lps=_Lps matchid=_MatchID;
In the match statement, you can assign method=exact, k=5 for your situation.
The one time I had to do something like this, I started with the distribution of start month from the treatment group. I used that distribution to randomly assign a start month to the control population. Then I used the complete set of characteristics to find matches.
@Astounding wrote:
The one time I had to do something like this, I started with the distribution of start month from the treatment group. I used that distribution to randomly assign a start month to the control population. Then I used the complete set of characteristics to find matches.
Depending on how persnickety your reviewer is likely to be, you may want to determine whether start month is at all correlated with other attributes of interest within the treatment group. If so, then the random assignment of start month for control cases might need to take those attributes into account.
For me, handling correlated independents was part of a class that overwhelmed me and put me to sleep 50 years ago. I leave it to the heavy-duty stats people to sort this one out .
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.