Clinical Trial data - request help on variable number of comparisons per trial

If you want to track differences between different studies, you should not compare the posterior plots directly. You should keep track of it via something like

dif_mu = pm.Deterministic("dif_mu", mu - mu.T)

Here dif_mu[i,j] will give you the difference between mean of study i and j. Don’t mind the warnings about scalar divide, they happen because mu[i,i] - mu[i,i] is always zero.