I have extracted my CBC data from Sawtooth and want to run a hierarchical bayes estimatation using the package bayesm. I have seen the vignette , however, I do not know how to get the matrix createx comment (should I use na and Xa or rather nd and Xd), and moreover, code the none alternative (Concept 4 in each task) and get the betas of all attribute levels.
I would be more than happy if somebody has an idea or has used the package before. Please see my example data below.
Bike is categorical, tire diameter as well and price is continuous. However, I would like to get the estimates of all attribute levels.
Bike has 4 attribute levels, Tire diameter 3 and Price 3 levels again.
structure(list(sys_RespNum = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L), Task = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L,
1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L,
3L, 3L, 3L), Concept = c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L,
2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L,
2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L,
2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L,
2L, 3L, 4L), Bike = c(2, 2, 1, 0, 2, 2, 1, 0, 1, 4, 4, 0, 3,
3, 4, 0, 3, 3, 3, 0, 4, 4, 2, 0, 3, 4, 2, 0, 4, 4, 3, 0, 4, 3,
4, 0, 4, 2, 4, 0, 1, 1, 3, 0, 1, 1, 3, 0, 1, 4, 3, 0, 4, 1, 1,
0, 2, 3, 1, 0), Tire_diameter = c(27, 27, 28, 0, 26, 27, 26,
0, 26, 27, 28, 0, 27, 27, 28, 0, 28, 27, 28, 0, 27, 27, 28, 0,
28, 26, 27, 0, 26, 28, 26, 0, 27, 28, 26, 0, 27, 27, 27, 0, 26,
28, 26, 0, 28, 26, 28, 0, 26, 28, 26, 0, 26, 26, 27, 0, 28, 27,
26, 0), Price = c(500, 500, 400, 0, 400, 300, 300, 0, 500, 300,
300, 0, 400, 500, 400, 0, 300, 400, 500, 0, 400, 400, 400, 0,
500, 400, 400, 0, 500, 300, 500, 0, 400, 400, 500, 0, 500, 400,
500, 0, 400, 500, 400, 0, 400, 500, 400, 0, 400, 400, 500, 0,
400, 500, 400, 0, 500, 300, 500, 0), choice = c(0L, 0L, 0L, 1L,
1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L,
1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L,
0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L,
0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L)), row.names = c(NA, -60L), class = "data.frame")