## Creating new group with negative dependant variable

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.
selvi
Posts: 8
Joined: Sun Jun 18, 2017 10:46 pm

### Creating new group with negative dependant variable

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).

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

### Re: Creating new group with negative dependant variable

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.

selvi
Posts: 8
Joined: Sun Jun 18, 2017 10:46 pm

### Re: Creating new group with negative dependant variable

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

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

### Re: Creating new group with negative dependant variable

Code: Select all

`smpl 16 30`

selvi
Posts: 8
Joined: Sun Jun 18, 2017 10:46 pm

### Re: Creating new group with negative dependant variable

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.

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

### Re: Creating new group with negative dependant variable

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 30yy = yxx1 = x1xx2 = x2xx3 = x3xx4 = x4smpl @allgroup gg yy xx1 xx2 xx3 xx4`