Standard deviation for 5 year period, panel dataset

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

ww34
Posts: 7
Joined: Tue May 06, 2014 6:59 am

Standard deviation for 5 year period, panel dataset

Postby ww34 » Tue Jan 19, 2016 8:14 am

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.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Standard deviation for 5 year period, panel dataset

Postby EViews Gareth » Tue Jan 19, 2016 9:45 am

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.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests