I'm trying to model the probability that somebody can do a 90 day Snapchat streak. I have some binary success data in the form of count data (the participant only reached 90 days once):
I've converted this count data into the probability that the person will successfully reach 90 days in future, based on the day they have reached:
The fitted curve was created using nls() in R, using the code below for a logistic growth curve:
# Logistic growth model
model5 <- nls(`Probability of success` ~ a/(1+exp(-(b+c*Day.number))),
data=prob_90,
start=list(a=1, b=1, c=1),
upper=list(a=1), # Set upper limit on a
algorithm='port')
However, I've since realised that because the count data is poisson or gamma distributed, a symmetrical function like the logistic curve won't work. It appears the CDF of the poisson distribution would work, however this includes a factorial term and the gamma function, which returns errors in nls().
Or am I doing this completely backwards? Should I be trying to model the count data in Figure 1, then converting that to a curve for Figure 2? Or some other method?
Thanks very much!
MASS::fitdistr
). If this is the case, it might be helpful to share the data as well to create a reprex. $\endgroup$