My Problem
I just started using the R library 'choicemodelr' and succeded in getting some beta values as a solution. But I wonder how do I assign these values to the specific attribute-levels. As a result I only get values for A1B1, A1B2, A1B3,... etc. How does this generic output generally connect to my Design?
Didn't find a hint in the documentation. Neither for the choicemodelr libraray, nor the bayesm library (rhierMnlRwMixture) to which it is connected to. I hope you can help me with this one.
Thanks in advance, Phil
to illustrate this, some code and output:
my code in R
# loading neccesary librarys
library(bayesm)
library(MASS)
library(lattice)
library(Matrix)
library(ChoiceModelR)
library(XLConnect)
#DATENSATZ:
setwd("C:/DATA/CBC/") # set workingdirectory
.Workbook <- loadWorkbook("DataCBC-R2.xls")
data <- data.frame(readWorksheet(.Workbook, "DataCBC-R"))
remove(.Workbook)
#set parameter for calculation
R = 50000 #Total Iterations of the Markov Chain Monte Carlo
use = 100 #Iterations for Paramerter-Estimation
#Parameter of datainput
none = TRUE #TRUE, if the questionaire has a none-Option but is not coded in the data
xcoding = c(0,0,0,0,0,0,1,1) #0=nominal scale; 1=metric scale
#Parameter dataoutput
save = TRUE #TRUE saves the calculated parameters
keep = 500 #number of random parameter draws to save (thinnig Parameter)
mcmc = list (R=R, use=use)
options = list(none=none, save=save, keep=keep, restart=restart)
#final calculation of the betas
out = choicemodelr(data, xcoding, mcmc = mcmc, demos = demos, options = options, constraints = constraints)
I get the following Output (excerpt):
Resp A1B1 A1B2 A1B3 A1B4 A2B1 A2B2 NONE
001 -2,56 -6,54 -18,49 27,59 -1,74 1,74 -1,94
002 -3,18 -6,52 -19,79 29,49 0,50 -0,50 -0,58
Hope that piece of information helps. Let me know, if you need further information.
Here is the input data:
respondent choice-set stimulus Attr. Color Attr. Shape Choice
1 1 1 1 2 1
1 1 2 3 1 0
1 1 3 2 1 0
1 2 1 1 2 4
1 2 2 3 1 0
1 2 3 2 1 0
1 3 1 4 1 3
1 3 2 1 2 0
1 3 3 3 1 0
1 4 1 2 1 2
... ... ... ... ... ...
Find the complete answer at cross validated (where it should have been in the first place): https://stats.stackexchange.com/questions/85362/how-to-interpret-the-output-of-choicemodelr-rhiermnlrwmixture-in-r/86102#86102
来源:https://stackoverflow.com/questions/21518092/how-to-interpret-the-output-of-choicemodelr-rhiermnlrwmixture-in-r