Hi Statalist,

I have a large matched cohort data set where exposed have been matched 1:m with an unexposed group (siblings). One exposed can have multiple matched siblings (e.g. 1-10 siblings).

My matching variable indicator is called set_id.

The set_id variable has 9,859 unique values.
- No. of exposed = 9,859
- No. of unexposed/siblings = 17,220

How do I keep this matching when I drop some study subjects that are not relevant for my specific study (e.g. exclude individuals with observations before a given year)?
- If I drop any exposed individuals, all of their matched siblings should also be dropped.
- Conversely, if I drop any siblings, cases should only be dropped if there is no other matched sibling for this matched pair.

How do I write a Stata code that condition on this?

Thanks a lot in advance.