Hello everyone,
Currently, I am trying to generate a variable that indicates me the number of neighbors that are within 1 km and received a treatment. The indicator must be in control observations and treatment observations. So, if the observation is control, it would give me the total number of treated observations within 1 km, the same for the treated observation.
I have tried with the following code:
nearstat latitude longitude, near(latitude longitude) distvar(mydist) ncount(number_treated_HH) dband(0 1) contvar(puretreatment)
where puretreatment = 1 if the observation received the treatment. Nevertheless, I haven't succed. It returns the total number of neighbors within 1 km, regardless if the observation received or not the treatment.
Thank you very much in advance for your help,
Regards
Sara R
Related Posts with Nearstat count number of neighbors that satisfy a certain condition
Optimal lag for xtscc command (Regression with Driscoll-Kraay standard errors)I have to estimate a panel data model( 19 country and and 37 year) with xtscc command, i want to kno…
Testing after margins, postHoping someone can help me understand an issue with using test after margins, post. I run the follo…
Oaxaca result conversion?I got the following results through oaxaca two-fold method. ---------------------------------------…
Loop computations across many .dta files and define new variable based on computationDear all STATA users, I am new to STATA and have run into some issues with a data task. I hope you …
how to do crosstabulation for a list of variablesDear Statalist users, I am using Stata 14 and I have an individual-level dataset. I have a question …
Subscribe to:
Post Comments (Atom)
0 Response to Nearstat count number of neighbors that satisfy a certain condition
Post a Comment