I tried to fit a curve to the black points using the following code. Why is the fit so bad? Do I need to fit another type of function?
fit <- nls(grad ~ theta1/(1 + exp(-(theta2 + theta3*x1))),
start=list(theta1 = 4, theta2 = 0.09, theta3 = 0.31), trace=TRUE)
p = predict(fit)
plot(x1, grad)
points(x1, p, col = "red")

x1andgrad? Why do you fix the lower limit ofgradat 0 but estimate the upper limit? Would it make substantive sense to either fix both limits or estimate both limits? – Ray Koopman Nov 04 '13 at 21:38