[Rd] [R] (PR#2720)

jerome at hivnet.ubc.ca jerome at hivnet.ubc.ca
Thu Apr 3 03:37:43 MEST 2003

I apologize for cross-posting.

In the reproducable example below, I fit the same model with lme() and 
nlme(). However, I get 12 degrees of freedom with lme() and 2 df with 


a <- 2
x <- rep(rnorm(3),rep(5,3))
id <- rep(c("a","b","c"),rep(5,3))
y <- a+x+rnorm(15)
data <- data.frame(y=y,id=id)
initx <- matrix(x[c(1,6,11)],dimnames=list(c("a","b","c"),"x"))

summary(fit.lme <-
              lme(y ~ 1,data=data,random=~1|id,method="ML"))
summary(fit.nlme <-
              nlme(y ~ a + x, fixed= a~1, random=x~1|id,
              data=data, start=list(fixed=c(a=2),

When I try the same thing with set.seed(18), I get 12 df for both.

I have submitted a bug report on that issue on Dec 20th and I have tried 
to find the source of the problem, but no success. You can check what I 
found so far at:

Can anyone help find the source of this problem?

Jerome Asselin

R 1.6.2 on Red Hat Linux 7.2
Package: nlme 3.1-38

R-help at stat.math.ethz.ch mailing list

More information about the R-devel mailing list