From jerome@hivnet.ubc.ca  Wed Dec 11 22:30:03 2002
From: jerome@hivnet.ubc.ca (jerome@hivnet.ubc.ca)
Date: Wed Dec 11 22:30:03 2002
Subject: [Rd] nlme() and parameters "model", "fixed" and "random" (PR#2363)
Message-ID: <200212112129.WAA17784@pubhealth.ku.dk>

Full_Name: Jerome Asselin
Version: 1.6.1
OS: linux redhat 7.2
Submission from: (NULL) (142.103.173.179)



print.lme() fails when the parameters "model", "fixed" and "random"
are input as objects in nlme(). To show how this occurs, below is a
slightly modified example from the nlme help page.


     library(nlme)
     data(Loblolly)
     fm1 <- nlme(height ~ SSasymp(age, Asym, R0, lrc),
                 data = Loblolly,
                 fixed = Asym + R0 + lrc ~ 1,
                 random = Asym ~ 1,
                 start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
     fm1 # THIS WORKS...

     model <- height ~ SSasymp(age, Asym, R0, lrc)
     fixed <- Asym + R0 + lrc ~ 1
     random <- Asym ~ 1
     start <- c(Asym = 103, R0 = -8.5, lrc = -3.3)
     fm2 <- nlme(model,
                 data = Loblolly,
                 fixed = fixed,
                 random = random,
                 start = start)
     fm2 # ERROR
     #Nonlinear mixed-effects model fit by maximum likelihood
     #Error in as.vector(x, mode) : cannot coerce to vector

     all(unlist(fm1$coefficients)==unlist(fm2$coefficients)) # TRUE



[Rd] nlme() and parameters "model", "fixed" and "random" (PR#2363)
jerome@hivnet.ubc.ca