This is my data.
x <- c(0.5,3.0,22.2,46.0,77.3,97.0,98.9,100.0)
plot(x, pch = 19)
I want to fit a curve through these points and then calculate the slope at different points. Could anyone tell me how to do this in R
EDIT
Previously I had fitted a Gompertz that gave me a 'maximum' slope. I want to know what are the slopes for other points.
Best Answer
Your question is very broad. There are many ways to do this, even without assuming a specific function. For the following I assume that you have a good reason to use the Gompertz model.
First let's fit the model:
Now, in order to get the desired slopes, you'll need to calculate the first derivative of the fitted function. That is simple highschool maths. In fact, it's so simple that even R can do it although it is not a computer algebra system.