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

Thanks @Bob_Carpenter , I kept working on this.

So far for discrete covariates I allow multilevel model without any multivariate prior. Now, I have a design matrix with these columns

tissue_heart (binary) | tissue_blood (binary) | age (continuous)

Does the statement

is valid even if I have now also a continuous covariate? for a model like

~ 0 + tissue + age + (tissue + age | GROUPING)

If I get your point is that I might need prior with covariance only if tissue and age are very correlated (e.g. a tissue have mostly young and another tissue have mostly old).

thanks!