# [R-sig-ME] Need help with Random Effect specification: nested Random Effects and a_priori known regimes (MCMCglmm)

Tue Nov 25 10:31:00 CET 2014

```Hi Linus,

In model 2 they are correlated, but its a bit weird. The 3x3
covariance matrix looks like

V1   V1   V1
V1 V1+V2  V1
V1   V1  V1+V3

where V1, V2 and V3 are the variances associated with town, D2:town
and D3:town. Amongst other things this model does not allow the
influence of town under regimes 2 and 3 to be less than that in regime
1.

In model 3 the effects are not correlated (because an idh structure is
used) and the 3x3 covariance matrix looks like:

V1 0  0
0  V2 0
0  0  V3

model 1 has constant variance and perfect correlation:

V1   V1  V1
V1   V1  V1
V1   V1  V1

Perhaps better options would be

a) us(regime):town which is a completely unstructured covariance
matrix with 6 parameters (3 variances and 3 covariances)

or

b) town+regime:town which has covariance matrix:

V1+V2  V1    V1
V1  V1+V2  V1
V1   V1   V1+V2

giving constant variance and constant (non-zero) correlation.

Cheers,

Jarrod

Quoting Linus Holtermann <holtermann at hwwi.org> on Mon, 24 Nov 2014
16:21:53 +0100:

> Dear list members,
>
> I need some advices with the specification of the Random Effects in
> my Mixed model.
> I got Panel data from 500 (i) district nested in 50 (j) towns over
> 10 (t) years.
> There are 3 ex-ante known regimes (r) that are district specific and
> vary with t. So every district is in regime 1 or 2 or 3 and that
> might change over
> time. I know a priori in which regime the districts are at time point t.
> My goal is to analyse asymetric impacts of covariates X on y. y is
> growth of Output. I apply a simple dummy specification, which uses
> regime 1 as reference.
> I estimated a mixed model via MCMCglmm (pooled mixed model):
>
> prior_1 <- list(R = list(V = 1, nu=0.002), G = list(G1 = list(V =
> diag(1), nu = 0.002)))
> model1 <- MCMCglmm(y~ int + D2:int + D3:int + X + D2:X + D3:X
> ,random=~town,prior=prior_1)
> int = intercept
> D2 and D3 are dummy-variables indicating that district i is in regime 2 or 3
>
> The random intercept for towns controls for the town specific
> impacts on growth of districts. But in the specification above, only
> "int" posseses a random intercept. So only the town specific impact
> on growth in the reference regime 1 is captured by the random
> intercept. If i assume that the town specific influence is different
> between the 3 regimes, can I fit the model as:
>
> prior_2 <- list(R = list(V = 1, nu=0.002), G = list(G1 = list(V =
> diag(1), nu = 0.002),G2 = list(V = diag(1), nu = 0.002),G3 = list(V
> = diag(1), nu = 0.002)))))
> model2 <- MCMCglmm(y~ int + D2:int + D3:int + X + D2:X + D3:X
> ,random=~town + D2:town + D3:town, prior=prior_2)
>
> Or are there better solutions to take care of the different town
> specific influence on district growth during the 3 regimes?
> Alternatively:
>
> prior_3 <- list(R = list(V = 1, nu=0.002), G = list(G1 = list(V =
> diag(3), nu = 0.002)))
> model3 <- MCMCglmm(y~ int + D2:int + D3:int + X + D2:X + D3:X
> ,random=~ idh(as.factor(regime)):town, prior=prior_3)
>
> This time the Random Effects are correlated, which is not the case
> in model2, right?
>
>
> Thanks in advance,
>
>
> Linus Holtermann
> Hamburgisches WeltWirtschaftsInstitut gemeinnützige GmbH (HWWI)
> Heimhuder Straße 71
> 20148 Hamburg
> Tel +49-(0)40-340576-336
> Fax+49-(0)40-340576-776
> Internet: www.hwwi.org
> Email: holtermann at hwwi.org
>
> Amtsgericht Hamburg HRB 94303
> Geschäftsführer: PD Dr. Christian Growitsch | Prof. Dr. Henning Vöpel
> Prokura: Dipl. Kauffrau Alexis Malchin
> Umsatzsteuer-ID: DE 241849425
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

```