[R] How to run a hierarchical bayes model using runiregGibbs

lululu greenapp2012 at gmail.com
Sun Feb 14 22:40:38 CET 2016


I want to run a hierarchical Bayes regression model using this runiregGibbs
function. My data is like the following:

      y  userid  Proximity   Time    Knowledge     Test     Purchase
Service1     8     1      4        2        2          1        32
7     1      2        2        2          2        23     9     2
1        4        2          1        34     7     2      2        1
     2          1        1

My X are the six attributes plus the userid listed above. They are
categorical variables. Each has 4 possible levels represented by number 1
to 4.

I have created the following code:

   y = c$Buy
   x = c[,4:10] #corresponding to the 7 X listed above
   df = list(y=y,X=x)
   R = 10000
   mcmc1 = list(R = R)
   try1 = runiregGibbs(df, Mcmc = mcmc1)

but it is giving me error saying

 Error: not compatible with requested type

I don't know how could this function be a hierarchical bayseian model. I
did not see the hierarchy. We are supposed to get both individual level
estimate and aggregate estimate. But I don't know how this can be achieved.
Am I supposed to use this function for each individual or just specify the
aggregate model is fine?

Also, I am not sure how to specify the MCMC chain. Is it sufficient to use
just specify the number of R and is there a general guideline in terms of
determining the suitable number of R?

I am new to Bayseian and I am confused about the basics. Would sincerely
appreciate if anyone could help. From google search, there is not much
about how to use this function and there is always only one example
provided which is also not very illuminating.

	[[alternative HTML version deleted]]



More information about the R-help mailing list