GMNL function error

Hi I am trying to use gmnl function in r. There are three alternative-specific variables beat1,beta2, and beta3. There are two individual-specific variables Z1 and Z2. I want to set Z1 and Z2 as scale varies and observed heterogeneity random parameters. I get the error saying"The following random variables are not in the data: Z1, Z2". In my Data file, I do have Beta1 to 3 , Z1&2, id and TID.
image
Does anyone have comments or suggestions?
My code is below:

MData=mlogit.data(Data,choice="Choice",shape = "long",id.var= ("id"),chid.var=("TID"), drop.index = TRUE)

GMNL=gmnl(Choice~Beta1+Beta2+Beta3|1|0|0| Z1 + Z2-1,
data=MData,
model='gmnl',
halton = NA,
panel = TRUE,
R=60,
notscale = c(1,1,1,1,rep(0, 5)),
ranp=c(Beta1="n", Beta2="n", Beta3="n", Z1="n", Z2="n"),
init.gamma = 0,
hgamma="indirect",
method="nr")

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.