Getting 'make_stancode() ' data match my dataset

Hi, I’m using make_stancode() to produce the stan code from a brms model. But in the output the variable names in my data block don’t at all match the names in my dataset. This is also true using stancode(). This is causing some confusion and difficulty.

I’m wondering what I’m missing. Essentially, I’m trying to use the stan code output as a separate .stan file that is then sampled via rstan. The reason I’m doing this is because I need to run the stan code on the cloud and I can not install brms there.

Thanks!

2 Likes

Use make_standata to create the data for use in stan.

2 Likes

Thanks. One question on that topic- a random, nested effect was split into two parameters, “Z_1_1” and “R_1_1.” Do these represent fixed and random effects respectively?

No, they don’t r_1_1 are the random effects and Z_1_1 are the vector of the corresponding design matrix (data).

1 Like