Re: [R] names() function and lmer()

From: ronggui <ronggui.huang_at_gmail.com>
Date: Sun 16 Jul 2006 - 02:31:39 EST

lme4 is S4 package.So you should use slotNames to see what slots an object has,and use @ instead of $ to extract the slot you want.
> library(lme4)

Loading required package: Matrix
Loading required package: lattice
Loading required package: lattice

> example(lmer)
> slotNames(fm2)
 [1] "assign"   "frame"    "terms"    "flist"    "Zt"       "X"
 [7] "y"        "wts"      "wrkres"   "method"   "useScale" "family"
[13] "call"     "cnames"   "nc"       "Gp"       "XtX"      "ZtZ"
[19] "ZtX"      "Zty"      "Xty"      "Omega"    "L"        "RZX"
[25] "RXX"      "rZy"      "rXy"      "devComp"  "deviance" "fixef"
[31] "ranef"    "RZXinv"   "bVar"     "gradComp" "status"

> fm2@ranef
 [1]   1.5127787 -40.3739988 -39.1811143  24.5188772  22.9144206   9.2219771
 [7]  17.1561300  -7.4517287   0.5786303  34.7680264 -25.7543295 -13.8649853
[13]   4.9159565  20.9290870   3.2586571 -26.4758005   0.9056393  12.4217767
[19]   9.3234692  -8.5991469  -5.3877753  -4.9686374  -3.1939301  -0.3084938
[25]  -0.2872083   1.1159883 -10.9059430   8.6275943   1.2806874   6.7563873
[31]  -3.0751268   3.5122002   0.8730485   4.9837782  -1.0052909   1.2583989

2006/7/15, A.R. Criswell <rstatistics@gmail.com>:
> Hello All,
>
> I would like to retrieve some of the results from the lmer(...)
> function in library lme4. If I run a model, say
>
> fm.1 <- lmer(y ~ 1 + (1 | x), data = dog)
>
> and try names(fm.1), I get NULL. Is there anyway to retrieve the information?
>
> Thanks
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
ٹ
Department of Sociology
Fudan University



______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Received on Sun Jul 16 02:39:36 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 16 Jul 2006 - 04:14:08 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.