Hello, I am trying to run a mixed logit model (panel form) with the mlogit package. I am running into the following error: "Error in random.nb[, sel, drop = F] : subscript out of bounds".
I have searched the R Help forum (and online) and see no instances of this error. Below is the coding that I used which follows along with "Discrete-Choice Logit Models with R" by Philip A. Viton (http://facweb.knowlton.ohio-state.edu/pviton/courses2/crp5700/5700-mlogit.pdf). My dataset consists of 244 individuals each answering 8 choices between 3 alternatives. > clogit <- read.csv("/Users/name/Desktop/DCEinR/R365.csv") > save(clogit,file="/Users/name/Desktop/DCEinR/clogit.rdata") > load("/Users/name/Desktop/DCEinR/clogit.rdata") > clogit$mode.ids<-factor(rep(1:3,244)) > clogit$mode.ids<-factor(rep(1:3, 244), labels=c("c1","c2","sq")) > clogit$indivs<-factor(rep(1:244,each=24)) > CLOGIT<-mlogit.data(clogit,shape="long", > choice="choice",alt.var="mode.ids", id.var="indivs") > CLOGIT.mxl <- mlogit(Choice~-1+ASC+Price+Payment+Penalty+Length+Local|0, > CLOGIT, rpar=c(ASC='n', Price='n', Payment='n', Penalty='n', Length='n', > Local='n'), R=100, halton=NA, print.level=0, panel=TRUE) Are there any suggestions on: 1) what does this error mean; and 2) how to fix this issue? Thanks in advance. -- View this message in context: http://r.789695.n4.nabble.com/mlogit-error-tp4708706.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.