How can I apply MRP when the dependent variable is not binary?

Hello all,

I am relatively new to bayesian approach and currently I am having a time of learning by doing. I have found a great MRP tutorial written by Austin Rochford. followed it through and even made it work with my own survey data and census data for predicting Turkish national elections. In the survey data the ruling party is represented 16% which is nowhere near matching the reality(40-45% for the ruling party).I binarized the Dependent variable by recoding the ruling party as 1 and the rest as 0. When I applied MRP it gave me 41.9%. It’s incredible(I hope it wasn’t just the beginner’s luck)

I have searched on google for different MRP tutorials. So far I couldn’t find any code which applies MRP to multinomial case.

Is it technically possible to make MRP work with non-binary dependent variables? If so, can anyone show me how to do it? If it only works with binary DV, what is the convenient way to make such predictions? I think there must be a way to make it work because some companies like Yougov Daliaresearch Civey etc use MRP.

What I have in my mind is to build different models for different parties each time making “one party vs rest” sort of binarization. Does that statistically make sense or am I committing a crime against the data?

I hope I was able to express my question clearly. Thanks in advance for your answers.

1 Like

@AlexAndorra does a lot of these kind of model for election forecasting - i am sure he can provide you some good examples :wink:


Interesting question! And always happy to talk about that topic, as Junpeng said :slight_smile:

I’ve never used MRP yet (definitely on my to-do list though :wink: ) but I built a model for Paris city-council elections last March at the district-level, using a hierarchical multinomial regression.

I don’t know how this relates to Turkish politics, but I hope this helps, and I’m happy to chat further about it :vulcan_salute:

1 Like

Hello again,

Thanks for the answers and sorry for my late reply.
@AlexAndorra I have checked the notebooks. It looks great and will help me a lot learning pymc by doing it. Thank you for sharing them.

I kept searching and could find an R code which applies MRP in multinomial setting. I am trying to translate those steps to pymc3. I hope I can manage that soon :slight_smile:

You’re welcome, and good luck with your project! And feel free to share your implementation of MRP in PyMC3 when you’re done – would be very interesting!