Kenneth Roy Cabrera Torres
2009-May-20 04:31 UTC
[R] Extracting correlation in a nlme model
Hi R users: Is there a function to obtain the correlation within groups from this very simple lme model?> modeloMx1Linear mixed-effects model fit by REML Data: barrag Log-restricted-likelihood: -70.92739 Fixed: fza_tension ~ 1 (Intercept) 90.86667 Random effects: Formula: ~1 | molde (Intercept) Residual StdDev: 2.610052 2.412176 Number of Observations: 30 Number of Groups: 3 I want to obtain \rho = \sigma_b^2 / (\sigma_b^2 + \sigma^2) I know that I obtain \sigma_b^2 and \sigma^2 with> VarCorr(modeloMx1)molde = pdLogChol(1) Variance StdDev (Intercept) 6.812374 2.610052 Residual 5.818593 2.412176 But, I want to know if I can obtain \rho = 6.8123/(6.8123 + 5.8185) = 0.53934 straightforward. Thank you for you help. Kenneth
Hello, for calculation of intraclass correlation coefficient for a simple Random Intercept model, the function ICC1.lme() in the package "psychometric" can be applied. Best regards, Christine Adrion Kenneth Roy Cabrera Torres wrote:> > Hi R users: > > Is there a function to obtain the correlation within groups > from this very simple lme model? > >> modeloMx1 > Linear mixed-effects model fit by REML > Data: barrag > Log-restricted-likelihood: -70.92739 > Fixed: fza_tension ~ 1 > (Intercept) > 90.86667 > > Random effects: > Formula: ~1 | molde > (Intercept) Residual > StdDev: 2.610052 2.412176 > > Number of Observations: 30 > Number of Groups: 3 > > I want to obtain \rho = \sigma_b^2 / (\sigma_b^2 + \sigma^2) > > I know that I obtain \sigma_b^2 and \sigma^2 with > >> VarCorr(modeloMx1) > > molde = pdLogChol(1) > Variance StdDev > (Intercept) 6.812374 2.610052 > Residual 5.818593 2.412176 > > But, I want to know if I can obtain > \rho = 6.8123/(6.8123 + 5.8185) = 0.53934 straightforward. > > Thank you for you help. > > Kenneth > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >----- Christine Adrion, Dipl.-Stat., MPH Ludwig-Maximilians-Universitaet Muenchen IBE – Institut für Medizinische Informations- verarbeitung, Biometrie und Epidemiologie Marchioninistr. 15 81377 Muenchen GERMANY Tel.: +49 (0)89 7095-4483 eMail: adrion@ibe.med.uni-muenchen.de Internet: http://ibe.web.med.uni-muenchen.de -- View this message in context: http://www.nabble.com/Extracting-correlation-in-a-nlme-model-tp23628854p23632075.html Sent from the R help mailing list archive at Nabble.com. [[alternative HTML version deleted]]