Multilevel modelling multiple binary covariates vs stratification

Readin this document it seems that random intercept + random slope (binary covariate) requires a covariance matrix

for this model

 for (i in 1:n) {
    mu[i] = a_county[county[i]] + b_floor[county[i]] * vfloor[i] + b_uranium * log_uranium[i];

In the manual for post-stratification

we see this formula

alpha + beta[age] + ...

which would be also represented by

alpha + x_age_strata_1 * beta_1 + x_age_strata_2 * beta_2 + ...

Why does this not require multivariate?

In my case I have repeated measures data of 3 conditions, do I need to use multivariate?

Hi, @stemangiola! You don’t need a prior with covariance. For example, Andrew Gelman and I didn’t use multivariate priors in our Covid sensitivity and specificity paper because we didn’t have the kind of data required to fit it. But I’d recommend doing it if your data supports it, especially if you don’t have much data and there are strong correlations.

We explain how to code the multivariate priors efficiently following Gelman and Hill’s Red-State/Blue-State example in their original regression book.

Luckily, it doesn’t change the stratification logic at all—MRP still works exactly the same way.

1 Like