Page 1 of 1

Creating new group with negative dependant variable

Posted: Mon Jun 04, 2018 5:49 pm
by selvi
Hi,

I would like to modify an existing group which contains 5 time-series, of which the first time series is the dependant variable.
I want to create a new group which only includes those rows of the old group, for which the dependant variable is less than zero.

Then save the adjusted data set as a new group (so I don't want to use sample).

Re: Creating new group with negative dependant variable

Posted: Mon Jun 04, 2018 7:25 pm
by EViews Gareth
Groups contain series, and series all have to have the same number of observations. Thus you can't create a group that contains a subset of of rows of another group. Groups all have the same number of rows.

Re: Creating new group with negative dependant variable

Posted: Wed Jun 06, 2018 3:06 am
by selvi
Thank you Gareth,

What I meant was: suppose a group has 5 series, 1st one being a dependant variable, and 30 rows.

Suppose, I only want the rows with a dependant variable that is negative. Dependant variables with negative values can be found in rows 16-30.

Then the new group contains a 15x5 matrix of the data that can be found in rows 16-30, and columns 1-5.

How do I do this?

Thanks

Re: Creating new group with negative dependant variable

Posted: Wed Jun 06, 2018 5:48 am
by startz

Code: Select all

smpl 16 30

Re: Creating new group with negative dependant variable

Posted: Wed Jun 06, 2018 6:12 am
by selvi
Thank you Startz

However, I would like to create a new group, which is a subset of an existing group.

I would need a function so that the new group contains data from the old group, but only with those rows where the dependant variable is negative.

Amy help would be greatly appreciated.

Re: Creating new group with negative dependant variable

Posted: Wed Jun 06, 2018 6:28 am
by startz
In EViews, groups are just collections of series and all series in a workfile page are the same length. You can exclude observations from processing by using the smpl command or by setting elements equal to NA.

If you want, I suppose you could do

Code: Select all

smpl 16 30
yy = y
xx1 = x1
xx2 = x2
xx3 = x3
xx4 = x4
smpl @all
group gg yy xx1 xx2 xx3 xx4