Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Dynamic restriction of controls when matching with psmatch2?

From   Saideep Bose <>
Subject   st: Dynamic restriction of controls when matching with psmatch2?
Date   Fri, 15 Apr 2011 22:04:08 +0800

Hello all,

I ran into a roadblock using psmatch2 in Stata and was wondering if anybody had any thoughts on how to approach the problem.

I am trying to match cases and controls from a cohort study that has continual enrollment (individuals continually added from 2006-2010). Furthermore, the intervention is not given to individuals in the experimental arm at a a specific date or age. Instead they can receive the intervention at any age between 1-5.

Here are the variables I have:

enrolled 	(0,1): whether or not a child received the intervention
enrolled_d 	(continuous): exact date at which a child in the intervention arm received the intervention
dob 		(continuous): date of birth
death_d		(continuous): date of death (if they died)

group		(1-13): location variable
sex			(0,1): female or male

Basically what I want to do is run a 1:1 match with no replacement between the cases and controls on dob, sex, and location. Ordinarily I would just use the following:

psmatch2 enrolled dob sex group, logit noreplacement

However, there is an important condition that I want to impose. As it is matching I do not want the matched control to be have a date of death (death_d) before the enrollment date (enrolled_d) of the case. This is to reduce selection bias as the study guarantees that all cases were alive at the time of enrollment and hence I want to force all matched controls to meet this criteria as well.

I am relatively inexperienced with Stata can think of no easy way to do this. I tried:

psmatch2 enrolled dob sex group if (death_d > enrolled_d), logit noreplacement

But it doesn't work because the enrolled_d variable is only present for cases (missing for controls).

The easy way to do this would be, while the match program is running for each case individual, to temporarily restrict the dataset to all those with a death_d > enrolled_d, but I do not know how to accomplish this temporary creation of a dynamic dataset (furthermore, every-time there was a successful match it would have to be taken out of the pool of potential controls in subsequent datasets).

Also, I do not have to stick with psmatch2 if there are better alternatives for the problem I have.

Thanks for taking the time to read!

Saideep Bose
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index