Start with the code for Lesson 3 - Task 6 (dummy coding) and/or the regression code from Stan User’s guide.
Convert the 3 categorical groups into a random intercept model, i.e.:
data
elements for the model to represent
the number of categories and the category each observation belongs
toarray[N] int
as a type for the cateogry input<lower = ..., upper = ...>
bounds for the category input - what would that be?parameter
elements:vector
by an array
to obtain a vector
the same length as the arraynormal(0, ...)
prior on the category random interceptsHow does the fit change from the fixed effect
Convert the above model to non-centered parametrization, i.e.:
normal(0, 1)
prior on the random intercept
vectortransformed parameters