I'm trying to run a multinomial regression for the first time. I am attempting to build the code based on a built-in dataset, but I'm having trouble getting it to do what I need. I want to run a model with random effects only. Here is the code with one random effect which I think is fine:
library(MASS)
library(mlogit)
house.mblogit1 <- mblogit(Sat ~ 1, random=~1|Infl, maxit=1000, estimator = "REML",data = housing)
However, I can't find an example of how to add another random effect (e.g., Type). I tried it and I can't figure out the syntax. Both these are wrong apparently:
house.mblogit2 <- mblogit(Sat ~ 1, random=~1|Infl+ ~1|Type, data = housing)
house.mblogit3 <- mblogit(Sat ~ 1, random=~1|Infl+Type, data = housing)
Error: Invalid random formula
Is it even possible to do it?