Demeaning panel data

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

ivov
Posts: 2
Joined: Tue Sep 16, 2014 1:33 pm

Demeaning panel data

Postby ivov » Tue Sep 16, 2014 1:54 pm

Hey all,

I am currently working with a panel dataset and I need to demean my variables in Eviews8. I've 12 periods and about 170 countries per variable. Is there an easy way to subtract the mean value of the variable over the 12 periods per country from each of the datapoints per country?

To illustrate, let's say that average economic growth for a country over the past 3 years was 3%. Economic growth was 4%, 2% and 3% in 2000, 2001 and 2002 for example. Then I'd like to generate a new series in which the mean over the periods is subtracted from the actual variables, so it'll become 1%, -1% and 0% respectively. In the real case, the mean should be calculated for each of the 170 countries separately and then subtracted from the datapoints of that country in 1 go. Is this possible?

Thanks a lot for your help.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Demeaning panel data

Postby startz » Tue Sep 16, 2014 2:00 pm

Look at @meansby()

ivov
Posts: 2
Joined: Tue Sep 16, 2014 1:33 pm

Re: Demeaning panel data

Postby ivov » Thu Sep 18, 2014 2:16 am

Look at @meansby()
Thanks a lot! That solved my problem


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests