Create series for multinomial logit

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

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

fionakerr
Posts: 1
Joined: Sat Jan 31, 2009 4:18 am

Create series for multinomial logit

Postby fionakerr » Sat Jan 31, 2009 4:33 am

Hi,

I am trying to create an ordered series so I can perform multinomial logit regressions.

I am looking to create this;
y=0 if x<=0
y=1 if 0<x<=2.5
y=2 if 2.5<x<=7.5
etc...

So far I have used the below method without success.

series xordered=((x<=0,x,0) and (x>0 and x<=2.5,x,1) and (x>2.5 and x<=7.5,x,2) and (x>7.5 and x<=15,x,3) and (x>15 and x<=30,x,4) and (x>30,x,5))

Any advice would be greatly appreciated!
Thanks!

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

Re: Create series for multinomial logit

Postby startz » Sat Jan 31, 2009 6:06 am

fionakerr wrote:Hi,

I am trying to create an ordered series so I can perform multinomial logit regressions.

I am looking to create this;
y=0 if x<=0
y=1 if 0<x<=2.5
y=2 if 2.5<x<=7.5
etc...

So far I have used the below method without success.

series xordered=((x<=0,x,0) and (x>0 and x<=2.5,x,1) and (x>2.5 and x<=7.5,x,2) and (x>7.5 and x<=15,x,3) and (x>15 and x<=30,x,4) and (x>30,x,5))

Any advice would be greatly appreciated!
Thanks!

One method

Code: Select all

smpl if x<=0
y=0
smpl if 0<x and x<=2.5
y=1
smpl if 2.5<x and x<=7.5
y=2

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

Re: Create series for multinomial logit

Postby EViews Glenn » Mon Feb 02, 2009 10:24 am

Another method:

Code: Select all

x.classify(method=limits, rightclosed) 0 2.5 7.5 @ y

The one issue here is that the encoding will start from 1 instead of 0. You can, using the same proc, define value maps for the encoding which will be attached to the resulting series.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 22 guests