Example dataset:
x <- 1:5
y <- c(0.01,0.02,0.05,0.1,0.2)
df <- data.frame(x, y)
My goal is to fit this data to a logistic function. I know logistic functions are normally used for binomial data, but in this case my data is continuous.
Since the y variable represents a proportion, the maximum possible value is 1. So I need to specify the asymptote as 1.
I know I can create a self-starting logistic function with nls and SSlogis like this:
model <- nls(y ~ SSlogis(x, Asym, xmid, scal),df)
But I'm unsure of how (or if I can) specify the asymptote.
Additionally, once I have the model, how can I forecast/plot future values? Similar to what this person did here.
Help much appreciated!