I am trying to run an nlme model for data that resembles this:

>head(test.dat)
  Time Meas       Rep   factor
1    0 12e+06    A    12
2    0 8e+06      A    12
3    2 5e+06      B    12
4    2 2e+06      B    12
5    4 9e+06      A     20
6    4 5e+06      A     20

factor is the variable with 4 levels upon which the curves vary and Time is continuous from 0 to 120.  I was able to model them using the drc package, but would like to add the random variable "Rep" to further account for variability.


## This function produces the 4-parameter weibull curves from the drc package.
>fct1 <- function(x,theta1,theta2,theta3,theta4) {
>     theta2 + (theta3 - theta2) * exp(-exp(theta1 * (log(x) - log(theta4))))
>     }
## Starting values from the drc modeling.
>coefs <- c(-2.347371,-2.140547,-2.429523,-2.130283,6.830780,6.599690,6.644721,
>           6.719952,8.599257,8.708562,8.622226,8.122782,36.264997,13.346892,
>           7.842881,4.555808)

>mod8 <- nlme(log10(Meas) ~ fct1(Time, theta1,theta2,theta3,theta4)|factor, data=test.dat,
>           fixed= theta1 + theta2 + theta3 + theta4 ~ 1,
>           random=Rep~1,
>           start=coefs)
Error in getGroups.data.frame(dataMix, eval(parse(text = paste("~1", deparse(groups[[2]]),  :
  Invalid formula for groups


This is the error that shows up regardless of anything I try to change.  Any suggestions as to how I might get it to work?


Kallie Horiuchi, MS
Mathematical Statistician
CDC/CCID/OD (CTR)
Northrop Grumman Information Technology
CDC Information Technology Support (CITS)
970-494-6567
jqe2@cdc.gov

I love the smell of data in the morning!


	[[alternative HTML version deleted]]


