I'm trying to run a random intercept multinomial logit model
| ID | Resolution | STATE | Index_1 | Index_2 |
|---|---|---|---|---|
| 6 | Settled | Indiana | 43.3267816 | 49.2 |
| 8 | Settled | Delaware | 72.6980536 | 48.5 |
| 9 | Dismissed | Delaware | 72.6980536 | 48.5 |
| 10 | Settled | New York | 72.0173234 | 48.4 |
| 11 | Stay | Texas | 84.8092534 | 49.8 |
The outcome variable is "Resolution" and the Index_1 and Index_2 are nested within the State.
Regardless if the shape is set to "wide" or "long" when attempting to set up the data I get this error: Error in guess(varying) : failed to guess time-varying variables from their names
mlogit_data <- mlogit.data(data, shape = "wide", choice = "_Resolution", varying = 3:5, alt.levels = NULL)
Does anyone know how to fix this?
As a preliminary note, here's a very relevant answer for you that might interest you if you want to compute multinomial mixed logit models.
Anyway, you probably made typos when specifying the parameters. In addition you need to use the
sep=parameter which refers to by which character suffixes are appended to the names, the default is"."but you have"_"; this is needed so the internally calledreshapecan guess the names correctly (see also?reshape).However, for some reason, they deprecated the
mlogit::mlogit.datafunction and call fordfidx::dfidxto be used instead.