Creating a new series from existing

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

oconneld
Posts: 2
Joined: Mon Oct 07, 2013 9:11 pm

Creating a new series from existing

Postby oconneld » Mon Oct 07, 2013 9:22 pm

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
Last edited by oconneld on Mon Oct 07, 2013 11:18 pm, edited 1 time in total.

oconneld
Posts: 2
Joined: Mon Oct 07, 2013 9:11 pm

Re: Creating a new series from existing

Postby oconneld » Mon Oct 07, 2013 9:39 pm

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.

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

Re: Creating a new series from existing

Postby startz » Tue Oct 08, 2013 6:39 am

You might want to post the actual commands you used.

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

Re: Creating a new series from existing

Postby EViews Glenn » Tue Oct 08, 2013 9:38 am

Code: Select all

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 2 guests