Dear Laura,
Please post your questions to the biogeme users group, so that everyone can benefit from the discussion.
> On 5 Jul 2023, at 19:23, Laura Marie Arena <
laura...@tum.de> wrote:
>
> Dear Prof. Bierlaire,
>
>
> I am currently writing my master's thesis as part of which I am conducting a choice experiment.
>
> Before I can start with the data collection, I would like to finalize my Python code (using BIOGEME) to analyze the choice data, however there is one question that I cannot solve myself and I was wondering if you could help me with this issue:
>
> I have a dummy variables with 3 levels (red, yellow & green).
> Therefore, I included 2 betas (performance_yellow & performance_green) for the variable (with red being the baseline level) in my utility function. However, I cannot find out how to index the specific levels within my utility function.
There is no automatic treatment of discrete variables, as they can be modeled in many ways.
You need to define two dummy variables, one called yellow, and one called red. They take the value one or zero.
Michel
>
> I tried the following:
> performance_yellow * a1_x6['1'] + performance_green * a1_x6['2']
> (the yellow level is represented by the number 1 in my choice set design and the green level is represented by the number 2 in my choice set design).
>
> However, the following error message appears: "TypeError: 'Variable' object is not subscriptable"
>
> Could you please tell me how to include my dummy variable with the 3 levels into my utility function, so that I get a beta for my yellow and a beta for my green level in my output and hence can interpret my results?
>
>
> Thank you for your time and help.
> Your input is highly appreciated!
>
> Kind regards
> Laura Arena
Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering
EPFL - Ecole Polytechnique Fédérale de Lausanne
http://transp-or.epfl.ch
http://people.epfl.ch/michel.bierlaire