Using hierarchical models for High dimensional (protein expression) data

Hello!

As you mentioned, you could try the R2D2M2 prior. We have tested the R2D2M2 prior in high dimensional real life settings as you see in our paper here.

Here is a small minimal working example that shows how to set the prior and could help you:

library(brms
# Read the data
# I am using the popularity dataset, which I found in this brms tutorial
# https://www.rensvandeschoot.com/tutorials/brms-started/

popular2data <- read_sav(file = "https://github.com/MultiLevelAnalysis/Datasets-third-edition-Multilevel-book/blob/master/chapter%202/popularity/SPSS/popular2.sav?raw=true")

popular2data <- dplyr::select(popular2data, pupil, class, extrav, sex, texp, popular)

# Specifiy the R2D2 prior 
bprior <- prior(R2D2(mean_R2= 0.5, prec_R2=1 ,cons_D2 = 2, main = TRUE), class = sd) + 
  prior(R2D2(), class = b)

# Model with varying slopes

fit1 <- brm(popular ~ 1 + sex + extrav + texp + (1 + extrav | class),  
              data = popular2data, 
              prior = bprior,
              warmup = 1000,
              iter = 2000, 
              cores = 4, 
              chains = 4, 
              seed = 123) 

summary(fit1)
plot(fit1)
3 Likes