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!
Create series for multinomial logit
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
-
- Non-normality and collinearity are NOT problems!
- Posts: 3775
- Joined: Wed Sep 17, 2008 2:25 pm
Re: Create series for multinomial logit
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 Developer
- Posts: 2672
- Joined: Wed Oct 15, 2008 9:17 am
Re: Create series for multinomial logit
Another method:
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.
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.
Who is online
Users browsing this forum: No registered users and 20 guests