Replacing values in a series with a mean

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

kaywu814
Posts: 3
Joined: Tue Nov 13, 2012 9:39 am

Replacing values in a series with a mean

Postby kaywu814 » Tue Nov 13, 2012 2:20 pm

12345
Last edited by kaywu814 on Sun Jul 07, 2013 12:46 pm, edited 1 time in total.

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

Re: Replacing values in a series with a mean

Postby EViews Gareth » Tue Nov 13, 2012 2:25 pm

Code: Select all

smpl 2027 2087 series x = @mean(x)
?

kaywu814
Posts: 3
Joined: Tue Nov 13, 2012 9:39 am

Re: Replacing values in a series with a mean

Postby kaywu814 » Tue Nov 13, 2012 3:00 pm

Thanks Gareth, this is great.

We have another issue. Our code is currently:

Code: Select all

smpl 2027 2069 series r_0 = @mean(r_0)
However, we want this to be the value for everything up to 2087. The code as it is right now only fills in the values up to 2069. Note that we want all values from 2027 to 2087 to be the mean from 2027 to 2069. Also, is there anyway to incorporate this function into the model instead of as a part of the program? As of right now, we must first run the program, solve for R, then run the program again to fill in values as the mean and would like to automate this a little more.

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Replacing values in a series with a mean

Postby EViews Glenn » Thu Nov 15, 2012 11:06 am

smpl 2027 2087
series r_0 = @mean(r_0, "2027 2069")


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests