Hi all,

I am investigating the impact of metro station accessibility on housing values. For this, I am using a DiD estimator. I am experiencing some difficulties and was hoping to find some input here.
With the help of QGis software, for every transaction in my dataset I can determine the distance to every metro station. For simplicity lets say that there are only two metro stations. Some transactions will experience accessibility (defined as x meters for the station) to multiple stations, others to only one, and others to none (i.e. observations can be exposed to multiple treatments).

My supervisor suggested I would run my regression as following:

transaction_price = P1 + P2 + T1 + T2 + P1*T1 + P2 *T2

Where the bold statement is an indicator of the (possibly) different treatment effects of accessibility to different metro stations.

However, I experience some trouble in constructing the code for this. More specifically, I want my control units to lay no further than 1500 meters from the station.

So for instance, if transaction 1 lays within the treatment zone of station 1 but station 2 lays further than 1500 meters, the only data from transaction 1 I wish to use in my regression is the a) price b) P1, which is the post indicator c) T1 which is the treatment indicator d) P1*T1 which is the treatment effect.

By transforming P2, T2 and P2T2 into missing values for observation 1 is not a way to solve this, I believe that observation 1 will then be "ignored" by Stata if I run the regression command.
I was thinking of some row condition to solve this problem but haven't find any solution so far and was wondering if there actually is a solution to this?

I hope my question is somewhat clear, I apologize in advance if I documented anything wrong.

Thank you in advance!