[R] lme cant get parameter estimated correctly

From: toby909 <toby909_at_gmail.com>
Date: Sun, 06 Apr 2008 05:26:33 +0000 (UTC)

I am caught in a mental trap. Why isn't the between groups variance estimated
(0.0038) to be around the value with which I generated the data (0.0002)?

Thanks Toby

set.seed(76589437887)

fph = 0.4

Sigh = sqrt(0.0002)
Sigi = sqrt(0.04)

ci = 1
fpi = matrix(,7200,3)
for (i in 1:90) {
 fph = rnorm(1, fph, Sigh)
 for (k in 1:80) {
  fpi[ci,1:3] = matrix(c(i, k, rnorm(1, fph, Sigi)),1)   ci = ci+1
 }
}

colnames(fpi) = c("hospid", "empid", "fpi1") dta = as.data.frame(fpi)

lme = lme(fpi1 ~ 1, dta, ~1|hospid)
summary(lme)

lme = lme(fpi1 ~ 1, dta, ~1|hospid)
summary(lme)
Linear mixed-effects model fit by REML
 Data: dta

        AIC BIC logLik
  -2555.416 -2534.771 1280.708

Random effects:
 Formula: ~1 | hospid

        (Intercept) Residual
StdDev: 0.06173257 0.1997302

Fixed effects: fpi1 ~ 1

               Value   Std.Error   DF  t-value p-value

(Intercept) 0.368082 0.006919828 7110 53.19236 0
Standardized Within-Group Residuals: Min Q1 Med Q3 Max
-3.4870696 -0.6747173 -0.0048658 0.6838012 4.2633384

Number of Observations: 7200
Number of Groups: 90

0.0617^2
[1] 0.00380689



R-help_at_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. Received on Sun 06 Apr 2008 - 05:28:29 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 06 Apr 2008 - 08:30:25 GMT.

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

list of date sections of archive