mjskay / tidybayes

Bayesian analysis + tidy data + geoms (R package)
http://mjskay.github.io/tidybayes
GNU General Public License v3.0
725 stars 59 forks source link

Clarify the effect of compose_data on factors #168

Closed Denise-Colombano closed 3 years ago

Denise-Colombano commented 5 years ago

Hi Matthew Kay,

When I use the function compose_data() to prepare my data frame for a brms multilevel model, and that dataframe has a factor in it, I understand that it converts the factor to a numeric value and then attaches the number of dimensions of that factor.

Question: When I run use the above approach on a suite of models, my results (i.e., looic and model weights) are different than if I had just converted my data frame to a regular list (no "compose_data()" transformation). This seems like a nontrivial problem for my model selection/ comparison process. What am I missing?

Thank you, Denise C.

mjskay commented 5 years ago

Could you give some example code? In general, compose_data is more useful for passing data directly to Stan than for input into brms---I think brms typically expects a data frame, and you don't need to pre-process a data frame with compose_data to pass it into brms.

mjskay commented 3 years ago

Closing this as being old. Happy to revisit if it's still a problem and you can provide a reprex.