[R-sig-ME] Modeling variance heterogeneity in lme4 + meaning of VarCorr values
ONKELINX, Thierry
Thierry.ONKELINX at inbo.be
Tue Oct 21 11:08:00 CEST 2014
Dear Emmanuel,
I think that the covariances between the random 'slopes' can be meaningful in your case. Suppose that the diameter changes over the length, the shapes are very similar, but the overall sizes different. In such a case the covariances would be high. Fixing the covariances at zero would be imply that the diameter at one position is independent of that of another position. Which is probably not what you want.
lme() has several varClasses(). Something like varConstPower(form = ~abs(distanceToCenter)) might be relevant to your problem.
Lmer with the random 'slope' and lme with the varIdent tackle the shape of the object in different manners. Calling those models equivalent is too strong. I would suggest that you write down the mathematical equation of both models. It helps me to understand how a model works.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data.
~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
-----Oorspronkelijk bericht-----
Van: Emmanuel Curis [mailto:emmanuel.curis op parisdescartes.fr]
Verzonden: maandag 20 oktober 2014 17:16
Aan: ONKELINX, Thierry
CC: r-sig-mixed-models op r-project.org
Onderwerp: Re: [R-sig-ME] Modeling variance heterogeneity in lme4 + meaning of VarCorr values
Dear Thierry,
Thanks for the answer, and the hints.
I created the dummy variables first to avoid correlations between random effects (sorry I forgot to mention it) to limit the number of parameters and because I don't really see what they would mean practically, and second (and more importantly) to try after some more refinate models like < is the variance at both ends higher that variance all along other points > (as suggested by the shape of the artery and the possible explanation of higher variances at both ends), with only two different variances in the model. Obviously, it asks the question of the meaning of correlations or not between random effects, for which I have no clear idea, especially for such a model: any help for interpreting (the origin of) such correlations would be very appreciated.
For the lme variant: thanks for clarifying the syntax. I was wondering what tools would be available to compare the random effects/models in such a case, since I think LRT is not appropriate in these cases --- that is why I tried first with lme4 to use after that PBmodcomp (which, incidentaly, fails with a message about different size in data frames, but I'm not sure yet that I correctly understood its usage). But I will try your suggestion, to see if I obtain similar results.
Would the lme model with different variances in residuals be equivalent to the model in lme4 without correlations between random effects? Or does it induce a different variance-covariance structure for the response?
Best regards,
On Mon, Oct 20, 2014 at 02:49:34PM +0000, ONKELINX, Thierry wrote:
< Dear Emmanuel,
<
< You don't need to create the dummy variables. Just convert Position to a new factor variable. It makes your code much more readable.
<
< d$fPosition <- factor(d$Position)
< lmer( Diametre ~ Lecteur + Position + ( 0 + fPosition|Lecture ), data = d, REML = FALSE ) < < This allows for different variances of the random effect over Lecture, depending on the value of fPosition. This comes at the cost of estimating all covariances as well. So you need to estimate 36 parameters (8 variances and 28 covariances). That is a high number of parameters given the size of your dataset.
<
< A more efficient solution would be to use lme() from the nlme() package and allow for heterogeneity in the variance of the residuals.
<
< lme(Diametre ~ Lecteur + Position, random = ~1|Lecture, weights = varIdent(~ 1|fPosition), data = d, REML = FALSE) < < Best regards, < < Thierry
--
Emmanuel CURIS
emmanuel.curis op parisdescartes.fr
Page WWW: http://emmanuel.curis.online.fr/index.html
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.
More information about the R-sig-mixed-models
mailing list