Error message "At Least 2 Response Categories Required" when trying to run brm command

Hello!

I am currently trying to do a Bayesian analysis using brms in R. I am trying to run the command below (fit1); however, it keeps giving me the error message “at least 2 response categories required” and I am not sure what that means or entails. I will include
the dataset I am using so you can take a look at it.

fit1 <- brm(GestureType | trials(1) ~ Distance + (1 | Participant.ID), data=my_data, family=multinomial, prior = prior(student_t(5, 0, 2.5), class = b), save_all_pars = TRUE)

my_data <- gesture.csv (10.7 KB)

I am new to both R and Discourse, so let me know if you need anything else to help answer my question! Thanks for your help and time!

OS: macOS Catalina Version 10.15.5
brms Version: 2.13.0

Not sure if this helps but are gesturetype and participant.id both declared as factors?

No just gesturetype is; I will try that though and see if it works! Thanks!

Unfortunately, that didn’t work. I would really appreciate any other advice!

having looked at the dataset, i think the shape of your data needs to look different.

If you have 1 trial that could be one of A,D,or N you might want columns GA,GD and GN which would be 1 or 0 .
See this example for the layout https://discourse.mc-stan.org/t/example-with-family-multinomial/8707

Unfortunately, that is still not working. I am not sure why this analysis has so many errors; it might be worth it to switch environments. Do you have any recommendations for programs to do a Bayesian analysis? Thanks again for all your help!

For a single trial you should simply use the categorical() family with GestureType ~ …

Thank you so much for responding Mr. Buerkner! So I have tried that but I get a multitude of errors; again, I am not sure why this dataset has so many problems with it. I have included a screenshot of the error messages I am getting when I change the family to categorical and I would appreciate any sort of advice/knowledge you have on these. Thanks again!

These are not errors but warnings indicating non convergence. In the warnings you find links to documentation of what they mean.

1 Like

Oh ok I did not notice those; I will check them out. Thank you so much for your quick response!