//Hints for assignment 1...
//Below .mod file components to include for a basic model
//Start simple!
[Choice]
//The column that indicates the choice for each respondent, in Optima data called 'Choice'
Choice
[Beta]
//what matters in the choice between public transit and car?
//Name Value LowerBound UpperBound status (0=variable,1=fixed)
[Utilities]
// Id Name Avail linear-in-parameter expression (beta1 * x1 + beta2 * x2 + ... )
0 PT
1 CAR
[Expressions]
// Define here arithmetic expressions for names that are not directly available from the data
// Example of creating of a socio-demographic dummy variable (e.g. french language as opposed to German)
one = 1
French = (CodeLangue == 1)
//There are two ways to turn a variable e.g. gender that takes values of 1 for male and 2 female to a dummy i.e. 0 and 1:
dummy_female = ( gender == 2 )
//In this case biogeme gives the value of 1 if the statement in the () holds --i.e. if the person is female-- and 0 otherwise.
//A more simple/ rough way to do it is:
dummy_female = gender - 1
//In this case male turns to 0 and female to 1 which gives the same result.
//You should be just careful the way you code it!
//Similarly an example for age:
young = ( ( age >= 20 ) && ( age <= 30 ) )
//In this case we use && so that both statements hold. Young takes the value of 1 if 20<=age<=30 and 0 otherwise.
[Model]
// Currently, only $MNL (multinomial logit), $NL (nested logit), $CNL
// (cross-nested logit) and $NGEV (Network GEV model) are valid keywords
$MNL
[Exclude]
//Define rules for excluding certain observations
//here we exclude situations when choice equals 2, that is soft modes, given that we need to work with a binary logit
//we also exclude the cases where age is negative, indicative of a missing value. This is relevant if we want to use age in the [Utilities]
( Choice == 2 ) + ( age < 1 )