Dear Community,

I hope that some of you are a bit experienced with the R package ChoiceModelR by Sermas and Colias, to estimate a Hierarchical Bayes Multinomial Logit Model. Actually, I am quite a newbie on both R and Hierarchical Bayes. However, I tried to get some estimates by using the script provided by Sermas and Colias in the help file. I have a data set in the same structure as they use (ID, choice set, alternative, independent variables, and choice variable). I have four independent variables all of them binary coded as categorical variables, none of them restricted. I have eight choice sets with three alternatives within each set as well as one no-choice-option as fourth alternative. I tried the following script:

library (ChoiceModelR)
data <- read.delim("Z:/KLU/CSR/CBC/mp3_vio.txt")
xcoding=c(0,0,0,0)
mcmc = list(R = 10, use = 10)
options = list(none=FALSE, save=TRUE, keep=1)
attlevels=c(2,2,2,2)
c1=matrix(c(0,0,0,0),2,2)
c2=matrix(c(0,0,0,0),2,2)
c3=matrix(c(0,0,0,0),2,2)
c4=matrix(c(0,0,0,0),2,2)
constraints = list(c1, c2, c3, c4)
out = choicemodelr(data, xcoding, mcmc = mcmc, options = options, constraints = constraints)

and have got the following error message:

Error in 1:nalts[i] : result would be too long a vector
In addition: There were 50 or more warnings (use warnings() to see the first 50)

The mentioned warnings are of the following:
Warning messages:
1: In max(temp[temp[, 2] == j, 3]) :
  no non-missing arguments to max; returning -Inf
2: In max(temp[temp[, 2] == j, 3]) :
  no non-missing arguments to max; returning -Inf
3: In max(temp[temp[, 2] == j, 3]) :
  no non-missing arguments to max; returning -Inf
...

Actually, I have no idea what went wrong so far as I used the same data structure even I have more independent variables, more choice sets, and more alternatives within a choice set. I would be fantastic if anybody can shed some light into the darkness ;-) Thanks in advance!

Cheers,
Michael

--
Michael Riechert
Ph.D. Candidate

Kühne Logistics University - The KLU
Wissenschaftliche Hochschule für Logistik und Unternehmensführung
Brooktorkai 20
20457 Hamburg, Germany

Tel.: +49 40 328707-302
Fax:  +49 40 328707-209

E-Mail: Michael.Riechert@the-klu.org<mailto:Michael.Riechert@the-klu.org>
Website: www.the-klu.org<http://www.the-klu.org/>

-------------------------------------------------------------------------------------------------------------

Executive Board: Prof. Dr. Dr. h.c. Sönke Albers, Prof. Dr. Alan McKinnon, Dr. Reimar Palte

Contracting Body: Kühne Logistics University GmbH
Managing Directors: Dr. Marc Gottschald, Dr. Reimar Palte
Chairman of the Supervisory Board: Prof. Dr. h.c. Klaus-Michael Kühne
Register of Companies: Amtsgericht Hamburg HRB 88234
-------------------------------------------------------------------------------------------------------------


	[[alternative HTML version deleted]]

