Ranked ordered logit model / exploded logit model

29 views
Skip to first unread message

Jingzhu Shan

unread,
Oct 7, 2021, 9:17:21 AMOct 7
to Biogeme
Dear Professor,

In my study, I obtained full rankings of 4 alternatives in each choice card. Is it possible to do a rank ordered logit model using Biogeme? How can we do that?

I have read some paper about rank ordered logit model, and some said we could explode the data manually to estimate the model (but their example is 'long form' data). As we need 'wide form' data in Biogeme, how can we explode data to do a rank ordered logit model?

Hope to hear from you.

Thanks.

Jingzhu

Bierlaire Michel

unread,
Oct 7, 2021, 9:30:52 AMOct 7
to jingz...@gmail.com, Bierlaire Michel, Biogeme
Yes, you can. You need to write a script that generates, for each “ranked” observation, 3 choice observations, each time with a different choice set.
The data will have a panel structure. And you will probably need to take care of serial correlation. 

--
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/d5ec1971-1949-4baf-a821-ab0e1e944a1fn%40googlegroups.com.

Jingzhu Shan

unread,
Oct 8, 2021, 5:24:49 AMOct 8
to Biogeme
Thanks for your quick reply, Professor. 

You mean if we have A,B,C,D alternatives in a choice set,  and respondents most preferred A, and then B, C, D. In this situation, 
we will have A,B,C,D in the first choice observation, B,C,D  in the second observation, and C,D in the third observation?

 If we format data like this, Biogeme will have an error "The database contains NaN value(s).". How can we deal with this?


Bierlaire Michel

unread,
Oct 8, 2021, 8:40:28 AMOct 8
to jingz...@gmail.com, Bierlaire Michel, Biogeme

On 8 Oct 2021, at 11:24, Jingzhu Shan <jingz...@gmail.com> wrote:

Thanks for your quick reply, Professor. 

You mean if we have A,B,C,D alternatives in a choice set,  and respondents most preferred A, and then B, C, D. In this situation, 
we will have A,B,C,D in the first choice observation, B,C,D  in the second observation, and C,D in the third observation?

Yes.


 If we format data like this, Biogeme will have an error "The database contains NaN value(s).". How can we deal with this?



On Thursday, October 7, 2021 at 9:30:52 PM UTC+8 michel.b...@epfl.ch wrote:
Yes, you can. You need to write a script that generates, for each “ranked” observation, 3 choice observations, each time with a different choice set.
The data will have a panel structure. And you will probably need to take care of serial correlation. 

On 7 Oct 2021, at 14:55, Jingzhu Shan <jingz...@gmail.com> wrote:

Dear Professor,

In my study, I obtained full rankings of 4 alternatives in each choice card. Is it possible to do a rank ordered logit model using Biogeme? How can we do that?

I have read some paper about rank ordered logit model, and some said we could explode the data manually to estimate the model (but their example is 'long form' data). As we need 'wide form' data in Biogeme, how can we explode data to do a rank ordered logit model?

Hope to hear from you.

Thanks.

Jingzhu

--
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/d5ec1971-1949-4baf-a821-ab0e1e944a1fn%40googlegroups.com.


--
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.

Jingzhu Shan

unread,
Oct 19, 2021, 8:18:00 AMOct 19
to Biogeme
Thanks for your quick reply, Professor. 

You mean if we have A,B,C,D alternatives in a choice set,  and respondents most preferred A, and then B, C, D. In this situation, 
we will have A,B,C,D in the first choice observation, B,C,D  in the second observation, and C,D in the third observation?

 If we format data like this, Biogeme will have an error "The database contains NaN value(s).". How can we deal with this?

Bierlaire Michel

unread,
Oct 19, 2021, 11:17:36 AMOct 19
to jingz...@gmail.com, Bierlaire Michel, Biogeme

On 8 Oct 2021, at 14:14, Jingzhu Shan <jingz...@gmail.com> wrote:

Thanks for your quick reply, Professor. 

You mean if we have A,B,C,D alternatives in a choice set,  and respondents most preferred A, and then B, C, D. In this situation, 
we will have A,B,C,D in the first choice observation, B,C,D  in the second observation, and C,D in the third observation?

 If we format data like this, Biogeme will have an error "The database contains NaN value(s).". How can we deal with this?

You obtain this error because your data contain NaN value. It should not. The default value for missing data in Biogeme is 99999.



On Friday, October 8, 2021 at 5:24:49 PM UTC+8 Jingzhu Shan wrote:
Thanks for your quick reply, Professor. 

You mean if we have A,B,C,D alternatives in a choice set,  and respondents most preferred A, and then B, C, D. In this situation, 
we will have A,B,C,D in the first choice observation, B,C,D  in the second observation, and C,D in the third observation?

 If we format data like this, Biogeme will have an error "The database contains NaN value(s).". How can we deal with this?


On Thursday, October 7, 2021 at 9:30:52 PM UTC+8 michel.b...@epfl.ch wrote:
Yes, you can. You need to write a script that generates, for each “ranked” observation, 3 choice observations, each time with a different choice set.
The data will have a panel structure. And you will probably need to take care of serial correlation. 

On 7 Oct 2021, at 14:55, Jingzhu Shan <jingz...@gmail.com> wrote:

Dear Professor,

In my study, I obtained full rankings of 4 alternatives in each choice card. Is it possible to do a rank ordered logit model using Biogeme? How can we do that?

I have read some paper about rank ordered logit model, and some said we could explode the data manually to estimate the model (but their example is 'long form' data). As we need 'wide form' data in Biogeme, how can we explode data to do a rank ordered logit model?

Hope to hear from you.

Thanks.

Jingzhu

-- 
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/d5ec1971-1949-4baf-a821-ab0e1e944a1fn%40googlegroups.com.


-- 
You received this message because you are subscribed to the Google Groups "Biogeme" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages