I am trying to estimate a latent class logit model using panel data. I tried following this example: https://rpubs.com/msarrias1986/335556.
I was told that the following code should work:
RM <- mlogit.data(rm01, id.var = "ID",
choice = "Choice",
varying = 3:14,
shape = "wide", sep = "")
I get the error:
Error in reshapeLong(data, idvar = idvar, timevar = timevar, varying = varying, :
'varying' arguments must be the same length
What am I doing wrong?