I'd like to fit a mixed-effects logistic growth curve to grouped data using the nlme package in R. The function has the following form:

$$y_t = \dfrac{Ay_0}{y_0+(A-y_0)e^{-rt}} $$

where the parameters $A$ (asymptote), $r$ (rate) and $y_0$ (initial value) are allowed to vary by group. Such a model can be fitted with nlme as follows:

grpdat <- groupedData(y ~ time | group, data=mydata)

logist <- deriv( ~A*y0/(y0+(A-y0)*exp(-r*t)),
                 c("A", "r", "y0"), 
                 function(t, A, r, y0){} )

# without random effects:
mod0 <- nlsList(model = y ~ logist(time, A, r, y0), 
                data = grpdat,
                start = list(A = 100, r = 1, y0 = 0.1)) 

# with random effects:
mod1 <- nlme(mod0, random = list(A ~ 1, r ~ 1, y0 ~ 1))

My question: I have actually observed the values of $y_0$ for each group. How can I specify these, rather than estimate them?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.