Good morning one and all.
I have a database with information for 40 urban regions. Within each region, there are a different number of cities. I want to do an OLS regression at the scale of urban regions (not cities), so I have to "collapse" (I don't know if that's the correct term) the data from the database because each row in the database (each city ) repeats the data from the urban region.
What I have done is use:
collapse (mena) var_list , by (id_urbanregion)
And then run the regression with OLS:
reg var1_region var2_region region_var3 region_var4 region_var5 , r
Is it correct, or is there another way to do it? Clearly, results between individuals (cities) and groups (urban regions) are completely different, so I am unsure if my procedure is OK using STATA commands.
Could you give me some advice? I really appreciate it!
Best,
Diego
I have a database with information for 40 urban regions. Within each region, there are a different number of cities. I want to do an OLS regression at the scale of urban regions (not cities), so I have to "collapse" (I don't know if that's the correct term) the data from the database because each row in the database (each city ) repeats the data from the urban region.
What I have done is use:
collapse (mena) var_list , by (id_urbanregion)
And then run the regression with OLS:
reg var1_region var2_region region_var3 region_var4 region_var5 , r
Is it correct, or is there another way to do it? Clearly, results between individuals (cities) and groups (urban regions) are completely different, so I am unsure if my procedure is OK using STATA commands.
Could you give me some advice? I really appreciate it!
Best,
Diego
Comment