Page 1 of 1

Standard deviation for 5 year period, panel dataset

Posted: Tue Jan 19, 2016 8:14 am
by ww34
I have an (unbalanced) panel dataset. The cross section is organised by state (with many observations for each state) and the date series is year of marriage. I need to construct a heterogeneity index which captures (average) heterogeneity in various spousal differences by state by year. I can do this using the view by classification option but since I have a limited number of observations for some years it returns NA or 0 standard deviations. My solution is to calculate the standard deviation for observations over a 5 year period (i.e. the year of marriage, the two years prior and the two years after). I have tried using the @mstdev and @movstdev commands - for example @mstdev(education,5) but this is not providing correct results as it is not calculating the standard deviation by state or year. Is there any way that I can use the statistics by classification option but get it to compute the standard deviations on a 5 year rolling basis rather than for single years?

Thanks in advance for any advice.

Re: Standard deviation for 5 year period, panel dataset

Posted: Tue Jan 19, 2016 9:45 am
by EViews Gareth
The only way to do it is to program it yourself by rolling the sample forward.

Within EViews if you click on Help->Quick Help Reference->Sample Programs and Data, and then click on Roll, there are some examples of computing a rolling standard deviation.