[R] Extracting elements from an reStruct

About this list Date view Thread view Subject view Author view Attachment view

From: Andrew Perrin (clists@perrin.socsci.unc.edu)
Date: Wed 21 May 2003 - 03:55:19 EST


Message-id: <Pine.LNX.4.53.0305201348270.29959@perrin.socsci.unc.edu>

Sorry if this is obvious, but my S skills aren't great and I haven't been
able to find it documented anywhere.

I want to write a new function for use with lme objects; the function will
simply calculate an ICC (aka "rho") for each level of a mixed-effects
model. What I need for this is pretty simple:

(c(var1..varn, residual)) / sum(c(var1..varn, residual))

where var1..varn are the variances of the intercepts of each level's
equation, and residual is the residual variance. The problem is getting
access to var1..varn (or, as R generally reports it, sd1..sdn)
programmatically. I can get the residual standard deviation with:

print(model$sigma)

and I can view the standard deviations with:

summary(model$modelStruct$lmeStruct)

But I can't figure out how to get at the standard deviations without the
human-readable print format.

Thanks-
Andy Perrin

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists@perrin.socsci.unc.edu * andrew_perrin (at) unc.edu

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:50 EST