Page 1 of 1

Creating a new series from existing

Posted: Mon Oct 07, 2013 9:22 pm
by oconneld
Hi All,

I'm using Eviews 7 and am a novice.

I have a series of stock market returns covering 5500 daily observations.

1. I want to create a new series that only includes those observations that are less than the mean of the full sample. I've tried some IF statements but I get a series that has large blocks of NAs (and I can't - or don't know how to - remove them)

2. Depending upon how to do this I also want to transform the new series by subtracting the mean of full sample series and squaring that result before dividing by the number of observations of the new series (i.e. those that are less than the mean of the full sample).

My algebra is fine but when I try to attempt this in Eviews I either cannot use the mean of the full sample (Eview uses the mean of the new series) or the number of observations is not correct.

Any ideas on how to create this second series according to my criteria in one or two easy steps?

Regards,
D

Re: Creating a new series from existing

Posted: Mon Oct 07, 2013 9:39 pm
by oconneld
I should also add that doing this manipulation will reduce the number of observations in the generated series by about half which is what I expect. I do not want the original series altered or contracted in any way.

Re: Creating a new series from existing

Posted: Tue Oct 08, 2013 6:39 am
by startz
You might want to post the actual commands you used.

Re: Creating a new series from existing

Posted: Tue Oct 08, 2013 9:38 am
by EViews Glenn

Code: Select all

smpl if y < @mean(y, "@all") series z = (y - @mean(y, "@all"))^2 / @obs(y) smpl @all