# Multilevel regression and poststratification with effects

Hello,

I am trying to fit a model where there is some effect of age and treatment.

Y_i = \alpha + \beta_1 \cdot \text{Age} + \beta_2 \cdot T

However, there is also a known selection bias. Those in my sample are not the same as the population as a whole.

I know how to calculate weights in a frequentist setting to reweight my population. But how do I do this with MrP? Is it possible to just add my cells like so:

Y_i = \alpha + \beta_1 \cdot \text{Age} + \beta_2 \cdot T + \alpha^{\text{ethnicity}}_{\text{ethnicity}[i]} + ...

Or, do I need to include a random effect for age and T at each cell?

The question is what is the effect of age and treatment at the population level? What should I do?

Thanks!

1 Like

Hi,
sorry for not getting to you earlier.

There are multiple potential problems. The easiest to handle is if you can assume that the effect of age and treatment is the same in the full population as in the selected population. Then you can fit the model to the selected population and then use the posterior to make predictions for the full population. (e.g. you make predictions from the fitted coefficients using the known distribution of age, ethnicity or other covariates).

If you can’t assume that, then you probably need something like “the population effect is similar to the effect in the observed data”, one way to do this is to use a varying/random effect of age/treatment. Once again, you can then use the known distribution of the covaraites in the full population to make predictions, but it is in no way guaranteed that you get sensible results and there are no completely general ways to handle the potential biases. What is best will depend hugely on the specific application and the assumptions you can make…

Does that help at least a bit?

Best of luck with your model!