Page 1 of 1

Replacing values in a series with a mean

Posted: Tue Nov 13, 2012 2:20 pm
by kaywu814
12345

Re: Replacing values in a series with a mean

Posted: Tue Nov 13, 2012 2:25 pm
by EViews Gareth

Code: Select all

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

Re: Replacing values in a series with a mean

Posted: Tue Nov 13, 2012 3:00 pm
by kaywu814
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.

Re: Replacing values in a series with a mean

Posted: Thu Nov 15, 2012 11:06 am
by EViews Glenn
smpl 2027 2087
series r_0 = @mean(r_0, "2027 2069")