# [R-sig-ME] comparing posterior means

Emmanuel Curis emmanuel.curis at parisdescartes.fr
Wed Oct 15 16:24:21 CEST 2014

```Hello,

This is only a very partial answer...

As your difference between countries j and k would be (b0j - b0k) =
(bb0 + u0j) - (bb0 + u0k) = (uu0j - uu0k), I guess only variances of uu0j
is needed, but I have no idea for the correlation between uu0j and uu0k.

However, I wonder if this test means anything: assuming that random
effects are Gaussian, you're (almost) certain that b0j will be
differents for different countries; the non-significance of the test
would only mean a lack of power.

Wouldnt' the fact that some differences may have practical interest
and some not be better investigated using approaches similar to
equivalence tests, by
1) defining what is the minimal difference of practical interest
2) building the confidence intervals of these differences and see if
it is comprised or completely outside the above region?

Hope this may help

On Wed, Oct 15, 2014 at 02:55:33PM +0200, Ben Pelzer wrote:
« Dear list,
«
« Suppose we have the following two-level null-model, for data from
« respondents (lowest level 1) living in countries (highest level 2):
«
« Y(ij) = b0j + eij = (b0 + u0j)  + eij
«
« b0j is the country-mean for country j
« b0 is the "grand mean"
« u0j is the deviation from the grand mean for country j, or the
« level-2 residual
« eij is the level-1 residual
«
« The model is estimated by :  lmer(Y ~ 1+(1|country))
«
« My question is about comparing two particular posterior
« country-means. As for as I know, for a given country j, the
« posterior mean is equal to bb0 + uu0j, where bb0 is the estimate of
« b0 and uu0j is the posterior residual estimate of u0j.
«
« Two compare two particular posterior country means and test whether
« they differ significantly, would it be necessary to know the
« variance of bb0+uu0j for each of the two countries, or would it be
« sufficient to only know the variance of uu0j?
«
« The latter variance (of uu0j) can be extracted using
«
« rr <- ranef(modela, condVar=TRUE)
« attr(rr[], "postVar")
«
« However, the variance of bb0+uu0j also depends on the variance of
« bb0 and the covariance of bb0 and uu0j (if this covariance is not
« equal to zero, of course, which I don't know...).
«
« On the other hand, the difference between two posterior country
« means for country A and B say, would
« equal bb0 + u0A -(bb0 + u0B) = u0A - u0B meaning that I wouldn't
« need to worry about the variance of bb0.
«
« So my main question is about comparing and testing the difference
« between two posterior country means. Thanks for any help,
«
« Ben.
«
« _______________________________________________
« R-sig-mixed-models at r-project.org mailing list
« https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

--
Emmanuel CURIS
emmanuel.curis at parisdescartes.fr

Page WWW: http://emmanuel.curis.online.fr/index.html

```