Hello, I am a pretty novice Stata user with some knowledge on linear regression and basic Stata commands. I am analyzing time series rainfall data in Ethiopia villages (each observation in ea_id2). The trouble is there are roughly 600 villages, each with 35 years of data for a total of 19,000 observations.
I used a simple tabstat, by command to give the rainfall for each village averaged over 35 years.
ea_id2 | mean
--------------+--------------
10101088 | 69.40667
10102088 | 72.355
10103010 | 71.81194
10103088 | 72.39486
10105088 | 78.20653
10106088 | 97.18694
10107010 | 74.47611
10201088 | 63.62139
10202020 | 48.58444
10202088 | 52.20139
10203088 | 51.30889
10204088 | 56.76083
10206088 | 75.1075
10207010 | 67.77722
10208088 | 55.24208
10209088 | 53.89843
10212010 | 56.98778
10301088 | 41.93361
10303010 | 46.71806
In addition to producing the mean, I want to produce simple linear regressions for each village as a function of time. Do I create a new variable to use in tabstat? Or do I need to use matrices or moving averages? I have no experience in either, so assistance would be greatly appreciated.
I used a simple tabstat, by command to give the rainfall for each village averaged over 35 years.
ea_id2 | mean
--------------+--------------
10101088 | 69.40667
10102088 | 72.355
10103010 | 71.81194
10103088 | 72.39486
10105088 | 78.20653
10106088 | 97.18694
10107010 | 74.47611
10201088 | 63.62139
10202020 | 48.58444
10202088 | 52.20139
10203088 | 51.30889
10204088 | 56.76083
10206088 | 75.1075
10207010 | 67.77722
10208088 | 55.24208
10209088 | 53.89843
10212010 | 56.98778
10301088 | 41.93361
10303010 | 46.71806
In addition to producing the mean, I want to produce simple linear regressions for each village as a function of time. Do I create a new variable to use in tabstat? Or do I need to use matrices or moving averages? I have no experience in either, so assistance would be greatly appreciated.
Comment