I have a response variable y ranging from 0 to 7. The data nicely show a S-shaped curve and I would like to fit a logistic growth model. The potentially explanatory variables are time t (continuous) and Condition C (categorical, 3 levels). The data are from a designed experiment, therefore I have the random effect block B (categorical, 5 levels). As the same spots were measured more than once, I group the Blocks in the time steps (t|B) and I include the interaction between Block and Condition as a further random effect (t|B:C).
As I do not have binomial data, my approach would be to transform the response variable y with the limit K = 7:
y' = log(K/y - 1) = a + bx
which then can be modeled linearly in the form:
model <- glmer(P ~ t*C + (t|B) + (t|B:C), data=data)
and can then (hopefully) be reduced using anova(model0, model1), etc.
My problem now is that for P=0 K/P is not defined and for P=7 log(0) is of course also not defined. I cannot set K just a little big higher than 7, since the value of the log would decrease to very negative values. I could set my values for P from 1-8 instead of 0-7 but I guess values of the logistic regression will always be between 0 and K.
Is there another way to fit a logistic model to my data?
EDIT (sorry, not allowed to comment):
The goal: My dependent variable y evolves over time. I want to see differences between conditions C.
To fit a nls model I imagine it should somehow look like this:
model.nls <- nls(y ~ K / (1 + exp(-(A - b*t))), start=startlist, data=data, trace=T)
Do I have to fit a separate model for each level of my condition C? How do I test for differences between conditions?
And how do I include my random effects (with grouping)?