[R-sig-ME] [External] Re: nlme & varIdent
Louisell, Paul T PW
Paul.Louisell at pw.utc.com
Tue Apr 4 03:43:21 CEST 2017
Thierry,
Thanks for responding--apologies for not clarifying my question sooner. A simple way of explaining the model would be that I have factor F nested in G, also a factor, and a continuous covariate C. I want the residual variance to vary by levels of G (handled by the varIdent function, as you point out below). Additionally, the levels of F interact with the covariate C, and I want to test/fit a model where the random effect variance for F:C changes with G's levels.
E.g., say G has 2 levels, a and b. Then there should be two variance parameters (σa and σb), one applying to random slopes associated with F:C for levels of F nested in G level a, and one for levels of F nested in G level b. The appropriate covariance matrix is diagonal, but unlike pdDiag, it only has 2 unrestricted parameters (one for each level of G), but it has dimension nlevels(F).
Paul Louisell
Statistical Specialist
Paul.Louisell at pw.utc.com
860-565-8104
Still, tomorrow's going to be another working day, and I'm trying to get some rest.
That's all, I'm trying to get some rest.
Paul Simon, “American Tune”
From: Thierry Onkelinx [mailto:thierry.onkelinx at inbo.be]
Sent: Monday, November 14, 2016 4:04 AM
To: Louisell, Paul T PW
Cc: r-sig-mixed-models at r-project.org
Subject: [External] Re: [R-sig-ME] nlme & varIdent
Dear Paul,
Note that variance functions work on the residuals, not the random effect variances. I can't comment further on this as your question is not very clear to me. Can you provide a more detailed example. E.g. the formula and who you want to variance or correlation functions to work.
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
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
2016-11-12 0:52 GMT+01:00 Louisell, Paul T PW <Paul.Louisell at pw.utc.com>:
Hello,
All the help I've read (including Pinheiro and Bates book, 'Mixed Effects Models in S and S-PLUS') regarding how to fit a linear mixed-effects model where variances change with a factor's levels indicates this is done through the 'weights' argument to 'lme', using something like 'weights=varIdent(form=~v|g)' where 'v' is a variance covariate and 'g' is the grouping factor whose strata have different random effect variances.
My question: Suppose I have more than 1 variance covariate, say v1, ..., vk, and I want _each_ of these to have variances that change with the levels of g giving a total of k*nlevels(g) parameters (k*nlevels(g) - k allowing for identifiability). How is this handled in the nlme package? A simple example would be random slope and intercepts, _both_ of which have variances changing with the levels of g. I haven't found any examples of this online or in Pinheiro & Bates, and I haven't been able to figure this out using the various varFunc/pdMat classes. I'd use the 'lme4' package (instead of nlme), but I need the correlated residuals structure (e.g., 'corAR1', 'corARMA') provided in nlme.
Help/advice would be greatly appreciated.
Thanks,
Paul Louisell
Statistical Specialist
Paul.Louisell at pw.utc.com
860-565-8104
Still, tomorrow's going to be another working day, and I'm trying to get some rest.
That's all, I'm trying to get some rest.
Paul Simon, "American Tune"
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list