I am trying to create a mean population density variable for every observation in my dataset. Each observation has this basic structure:
Observation No. | Province/State | Return on Investment | mean population density | x3 (some other variable) |
1 | Delhi, Bengal | 5.5 | ? | |
2 | Tamil Nadu, Kerala | 7.9 | ? | |
3 | Kerala | 6.8 | ? |
How do I get Stata to go through every observation and perform the mean generating operation? It seems like I may have to use a loop of some kind, though I am not sure what's the easiest way.
Thank you!
0 Response to Generating mean of a variable (e.g. population density) for each observation, when each observation spans multiple states/provinces.
Post a Comment