[R-sig-ME] MCMCglmm model for heteroskedasticity at level one

Jarrod Hadfield j.hadfield at ed.ac.uk
Tue Feb 18 19:22:55 CET 2014


Hi Maxim,

variance functions (e.g. us()) only take categorical terms in rcov.  
The closest you can get to the model given in:

https://dl.dropboxusercontent.com/u/18527706/mcmc-modexample.png

where I take ij indexes the ith observation for the jth individual (?) is:

MCMCglmm(y~x1+x2, random=~individual +idh(x2):units,rcov=~units,  
data=data, prior=prior)

the three fixed effects are 3.978, 2.222 & -0.049. The first variance  
is Omega_u[1], the second variance is Omega_e[2,2] and the third  
variance is Omega_e[1,1]. Omega_e[1,2] is set to zero by assumption,  
and it is not possible to relax this assumption in MCMCglmm.

Cheers,

Jarrod





Quoting Maxim Kovalenko <kovla123 at hotmail.com> on Tue, 18 Feb 2014  
18:58:35 +0100:

>
>
>
>
>
> Hello Jarrod,
> Thank you for your response. Your answer does help somewhat, but I  
> think my main difficulty is translating between the algebraic  
> representation of the model in MLwiN and the formula syntax of  
> MCMCglmm. The user manual for the latter does not elaborate much on  
> the 'rcov' argument, unfortunately; and I have trouble understanding  
> its relation to the specification of random effects on the  
> individual level in the 'random' argument.
> I have created a more simple model in MLwiN to provide a better  
> learning example:  
> https://dl.dropboxusercontent.com/u/18527706/mcmc-modexample.png
>  To clarify, x0 is the vector of 1's (the constant), x1 is a dummy  
> variable pertaining to the fixed part only, and x2 is a continuous  
> variable. My research question is whether individual-level variance  
> is dependent on x2. To keep things simple I only include the random  
> intercept on the country level.
> Now, on SO  
> (http://stats.stackexchange.com/questions/83148/specifying-a-multilevel-model-in-mcmcglmm-r-that-is-heteroskedastic-at-level) it has been suggested that the call for this model could be as  
> follows:
> MCMCglmm(y~x1+x2, random=~us(1):country + us(1+x2):individual,
>                   rcov=~us(x2):units, data=data,
>                   prior=prior)
> Would that be correct? What would be the difference for model with  
> and without the 'rcov' option?
> Unfortunately, the model does not converge in MCMCglmm, so I cannot  
> compare based on the estimates. In MLwiN I had to use hierarchical  
> clustering for the model to converge, is that functionality also  
> present in MCMCglmm?
>
> Thank you!
> Kind regards,Maxim
>
>
>
>> Date: Thu, 6 Feb 2014 15:32:31 +0000
>> From: j.hadfield at ed.ac.uk
>> To: kovla123 at hotmail.com
>> CC: r-sig-mixed-models at r-project.org
>> Subject: Re: [R-sig-ME] MCMCglmm model for heteroskedasticity at level one
>>
>> Hi Maxim,
>>
>> I'm not very clear about the model you want to fit. If we take your
>> stackexchange model, do you wish to fit a random intercept-slope model
>> (with the covariate x1) at the country level and the residual level?
>>
>> If so, then random=~us(1 + x1):country fits the country
>> intercept/slopes (with covariance between them). The between country
>> variance is quadratic in x1:
>>
>> V_i + 2*x1*V_is + (x1^2)*V_s
>>
>> where V_i is the variance in intercepts, V_s is the variance in slopes
>> and V_is is covariance between intercepts and slopes.
>>
>> This change in variance with respect to x1 is where the information
>> comes from for estimating level-1 heterogeneity. If you fit (assuming
>> x1 is always positive):
>>
>> idh(sqrt(x1)):units
>>
>> in the *random* effect part of the model, and leave the residual part
>> as the default units, then the level-1 variance is linear in x1:
>>
>> Vu+sqrt(x1)^2*Vs = Vu+x1*Vs
>>
>> where Vu is the units variance, and Vs is the variance associated with
>> the random `slopes' in the random effect part of the model.  Clearly
>> you could transform x1 differently.
>>
>> Not sure if this is useful?
>>
>> Jarrod
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Quoting Maxim Kovalenko <kovla123 at hotmail.com> on Wed, 29 Jan 2014
>> 15:34:08 +0100:
>>
>> >
>> >
>> > Dear all,
>> >
>> > I kindly ask the help of this community with the following issue. My
>> > research question is about individual-level variance of employment
>> > stability in several European countries. The number of countries is
>> > small (N=13), therefore MCMC is a more proper estimation method than
>> > ML. Variance on the country level doesn't interest me as much, but I
>> > do have to take it into account of course.
>> > When I run my model in R/MLwiN via R2MLwiN package, its formula is
>> > specified as approximately follows:
>> > y ~ (0|cons+careertype+gender) + (1|cons+careertype) + (2|cons)
>> > To decode: there fixed part contains the intercept, career type
>> > (more or less job mobility) and gender. Random effects on the
>> > individual level entail the constant and career type, whereas random
>> > effects on level to include only the constant. Therefore it is a
>> > random intercept model with heteroskedasticity on level one. For
>> > more details on this model please see
>> >  
>> http://stats.stackexchange.com/questions/83148/specifying-a-multilevel-model-in-mcmcglmm-r-that-is-heteroskedastic-at-level, I have included a screenshot there to give a  
>> better
>> > idea.
>> > Is it possible at all to estimate a similar model in MCMCglmm? I
>> > cannot figure out how to specify variance at level one to be
>> > dependent on one of the predictors.
>> > Thank you so much in advance for any tips!
>> > Kind regards,Maxim
>> > 	[[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > 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.
>>
>>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> 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.



More information about the R-sig-mixed-models mailing list