# [R-sig-ME] properties posterior means and ordinary means

ben pelzer benpe|zer @end|ng |rom gm@||@com
Thu Apr 22 14:33:43 CEST 2021

``` Dear list,

I'm looking for some advice on the properties of posterior means as
produced by lmer and coef() and of ordinary means, provided by, say,
mean().

Say we use the null-model Y = b0 + u0j + eij, with b0 being the grand mean
en u0j the deviation for "school" j, which is normally distributed.
eij is the pupil's deviation from the schoolmean b0+u0j, and is also
normally distributed.
Let's assume the number of pupils in each school is the same.

In my understanding, the coef(nullmodel) posterior means are "best" in the
sense of smallest expected quadratic deviation from the true unknown school
means, where the expectation is taken over all schools in the population of
schools. This holds only, however, if the true schoolmeans are normally
distributed. Is that correct?

The ordinary mean of one school, is "best" for that particular school, also
in the sense of smallest expected quadratic deviation from the true mean of
that particular school, the expectation taken over repeated sampling from
that same school. And the ordinary mean is also unbiased. Is that correct
too?

----

Suppose I would simulate data based on the above null-model, for 1000
schools. One of these schools is school A. This produces dataset 1.
Next, I repeat the simulation for 999 new schools, and for school A,
producing dataset 2.
Next, I repeat the simulation for 999 new schools, and for school A,
producing dataset 3.
And so on, each time taking 999 new schools, and school A, producing e.g.
5000 datasets.

For each of these 5000 datasets,  I calculate the squared deviation of the
posterior mean of school A from the true mean of school A, and this would,
averaged over the 5000 datasets, be equal to say "averagePosterior".

Next, I calculate the squared deviation from the true mean, for each of the
5000 ordinary means of school A, and take the average, leading to
"averageOrdinary".

It then would appear that averageOrdinary  <  averagePosterior. Is that
indeed what one would expect to find?

----

Thanks for any help,

Ben.

[[alternative HTML version deleted]]

```