[R-sig-ME] help with pdDiag and nlme
Anne Hoen
anniehoen at gmail.com
Thu Feb 6 23:17:38 CET 2014
Hi,
I am trying to fit a non-linear mixed effects model using a 3-parameter logistic function.
My data set can be made using this:
plate<-c(rep("A", 6), rep("B", 6), rep("C", 6), rep("D", 6))
preparation<-rep(c(rep("reference", 3), rep("test", 3)), 4)
concentration<-rep(c(1, 2, 3), 8)
OD<-runif(24, 0, 1)
data<-data.frame(plate, preparation, concentration, OD)
data<-groupedData(OD~concentration | plate, data=data)
I want to fit a model like this:
nlme(OD~SSlogis(concentration, Asym, xmid, scal),
fixed=preparation~1,
random=pdDiag(plate~1),
data=data)
But I get the error: Error in nlme.formula(OD ~ SSlogis(concentration, Asym, xmid, scal), fixed = preparation ~ :
subscript out of bounds
I've determined that (I think) the error comes from the random effect specification, because when I run: pdDiag(data$plate~1), I get: Uninitialized positive definite matrix structure of class pdDiag, which is not what I expected. I am not sure what is wrong. If anyone can help me, I would appreciate it so much!!
Thanks
Annie
More information about the R-sig-mixed-models
mailing list