[R] syntax of nlme

Thomas Wutzler thomas.wutzler at web.de
Mon Sep 11 17:41:52 CEST 2006


Hello,


How do I specify the formula and random effects without a startup object 
? I thought it would be a mixture of nls and lme.
after trying very hard, I ask for help on using nlme.

Can someone hint me to some examples?

I constructed a try using the example from nls:

#variables are density, conc and Run
#all works fine with nls
DNase1 <- subset(DNase, Run == 1 )
fm2DNase1 <- nls( density ~ 1/(1 + exp((xmid - log(conc))/scal)),
                   data = DNase1,
                   start = list(xmid = 0, scal = 1),
                   trace = TRUE)

#Now I want to do a mixed model with covariate Run
#how is the syntax?
DNase12 <- subset(DNase, Run == 1 | Run == 2)
fm2DNase1 <- nlme( density ~ 1/(1 + exp((xmid - log(conc))/scal)),
                   data = DNase12,
                   fixed = conc ~ 1,
                   random = Run ~ 1,
                   start = list(xmid = 0, scal = 1)
)
#gives: Error in eval(expr, envir, enclos) : object "xmid" not found


Thomas



More information about the R-help mailing list