I'm trying to run a series of non-linear regression in R. The models I'm trying to fit describe the progress of a viral population through time at three different temperatures. I'm trying to use the function nlsList() with a groupedData object:
surv <- groupedData(LOG10N ~ t | Temp, data.frame(cbind(rbind(surv4, surv22,surv56),
Temp=rep(c(4, 22, 56),
each=8))))
Where LOG10N is the log10 of the population, t is time and Temp the temperature. With the nlstools package I'm trying to fit the mafart model, so i used the mafart model formula to create a self starter:
mafart.self <- selfStart(~ LOG10N0-(t/delta)^p, surv,
parameters=c('p', 'delta', 'LOG10N0'))
getInitial(LOG10N~mafart.self, data=surv56)
When I try to get the initial values I get the following error:
Error in object[[3L]][[1L]] : object of type 'symbol' is not subsettable
If I skip the getInitial() step and use the nlsList() function like follows I get the same error:
> curve.maf <- nlsList(LOG10N~mafart.self, surv)
Error in model[[3]][[1]] : object of type 'symbol' is not subsettable
I've tried to run the regressions separately with nls2() but the results are totally disappointing, as they return the same values used as starters.