Dear professor, I'm using package nlme, but I can't find a way to specify two uncorrelated random effects. For example, a random intercept and a random slope. In package lme4, we can specify x + (x ll g) to realize, but how in nlme? Thanks! ???????????????????????? Zhen Wang Graduate student, Department of Medical Statistics, School of Public Health, Sun Yat-sen University E-mail: wangzh597 at mail2.sysu.edu.cn ?? ????????????????2022?????? [[alternative HTML version deleted]]
Viechtbauer, Wolfgang (NP)
2024-Jan-09 12:22 UTC
[R] how to specify uncorrelated random effects in nlme::lme()
Dear Zhen, You can use this with pdDiag(). An example: library(nlme) res <- lme(distance ~ age*Sex, random = list(Subject = pdDiag(~ age)), data=Orthodont) summary(res) Best, Wolfgang> -----Original Message----- > From: R-help <r-help-bounces at r-project.org> On Behalf Of ?? > Sent: Monday, January 8, 2024 12:43 > To: R-help <R-help at r-project.org> > Subject: [R] how to specify uncorrelated random effects in nlme::lme() > > Dear professor, > > I'm using package nlme, but I can't find a way to specify two uncorrelated > random effects. For example, a random intercept and a random slope. In package > lme4, we can specify x + (x ll g) to realize, but how in nlme? > > Thanks! > > ???????????????????????? > Zhen Wang > Graduate student, Department of Medical Statistics, School of Public Health, > Sun Yat-sen University > E-mail: wangzh597 at mail2.sysu.edu.cn > ?? > ????????????????2022??????
Reasonably Related Threads
- How to setup own i686 buildenv for CentOS7
- How can I test if a not independently and not identicallydistributed time series residuals' are uncorrelated ?
- How can I test if a not independently and not identically distributed time series residuals' are uncorrelated ?
- How can I test if time series residuals' are uncorrelated ?
- Uncorrelated random vectors