Creating new group with negative dependant variable

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Jason, EViews Moderator, EViews Pamela

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

Creating new group with negative dependant variable

Postby selvi » Mon Jun 04, 2018 5:49 pm

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

Postby EViews Gareth » Mon Jun 04, 2018 7:25 pm

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.
Follow us on Twitter @IHSEViews

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

Re: Creating new group with negative dependant variable

Postby selvi » Wed Jun 06, 2018 3:06 am

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

Postby startz » Wed Jun 06, 2018 5:48 am

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

Postby selvi » Wed Jun 06, 2018 6:12 am

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

Postby startz » Wed Jun 06, 2018 6:28 am

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


Return to “Data Manipulation”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests