Hi,

I assessed the ecological condition (EC) of rivers located inside and outside of six estates (1,…6). EC values are between 0 and 10. These estates are under three management regimes (1,2,3). I also measured EC on two least disturbed areas for reference.

My goal is to compare EC values in estates under different management regimes to determine which regime deliver the best results. I’m also interested in comparing EC under these three regimes with EC on least disturbed areas.

I decided to start with a simple ANOVA type model.

```
data {
int<lower=0> N;
int<lower=0> N_regimes;
vector[N] EC;
int<lower=1,upper=N_regimes> regimes[N];
}
parameters {
real<lower=0> sigma;
vector[N_regimes] mu;
}
model {
EC~normal(mu[regimes],sigma);
sigma ~ normal(0,2);
mu~normal(5,2);
}
generated quantities{
real mu_42= mu[4]-mu[2];
real mu_43= mu[4]-mu[3];
real mu_41= mu[4]-mu[1];
real mu_32= mu[3]-mu[2];
real mu_31= mu[3]-mu[1];
real mu_21= mu[2]-mu[1];
}
```

Now I need to improve it. On each estate (both inside and outside) I obtained several EC samples. EC samples inside the same estate are likely to be more similar to each other, therefore I need to incorporate this dependence in the model. I guess I need to add hierarchical priors to account for this dependence, but I’m not sure how I should do it. I have an additional covariate called “Estate” which identifies the location where each EC value was obtained that seems to be a good candidate for inclusion as a varying effect.

Thanks.