In a multinomial logit model you can estimate J-1 alternative specific constants (intercepts). The easiest way to make them random is to create alternative specific indicators.
For example, let's say that you have three alternatives: 1, 2 and 3, and that these are stored in the variable alt
. Now you can create two new variables called alt_1
and alt_2
, which are equal to 1 for alternative 1 and 2, respectively, and 0 otherwise.
data$alt_1 <- ifelse(data$alt == 1, 1, 0)
data$alt_2 <- ifelse(data$alt == 2, 1, 0)
Now use the mlogit.data()
function.
In your model you would then specify alt_1
and alt_2
to be random parameters following some distribution. Now you have random alternative specific constants and you estimate the mean and standard deviation. If you want them to be simple error components with zero mean and unit standard deviation, you can fix the mean and sd parameters for the intercepts to 0 and 1 respectively.