Sorry if this is a novice question, but I don’t understand it. I am fitting a sigmoid curve to my data with glm(). This works, I can plot the output and I see a nice sigmoid curve.
However, how do I get R to return the final values it has fit? As I understand it, R fits the data to logit(y) = b0 + b1x, but when I do > summary(glm.out) I only get
Call:
glm(formula = e$V2 ~ e$V1, family = binomial(logit), data = e)
Deviance Residuals:
1 2 3 4 5 6 7
-0.00001 -0.06612 -0.15118 -0.34237 0.20874 0.08724 -0.19557
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -24.784 20.509 -1.208 0.227
e$V1 2.073 1.725 1.202 0.229
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 4.60338 on 6 degrees of freedom
Residual deviance: 0.23388 on 5 degrees of freedom
AIC: 5.8525
Number of Fisher Scoring iterations: 8
How do I get b0 and b1?
A sample dataset:
The Z column can be ignored.
X Y Z
0.0 0.0 6
6.5 0.0 3
8.8 0.333333333333 3
10.5 0.2 10
11.1 0.0 3
11.25 0.166666666667 6
12.0 0.2 5
12.75 0.5 6
13.4 0.333333333333 3
13.5 0.2 5
14.25 0.5 6
15.0 0.333333333333 6
15.7 0.666666666667 3
15.75 0.666666666667 6
16.5 0.833333333333 6
17.25 0.555555555556 9
18.0 1.0 3
You get the fitted values via the
fitted()method, i.e.fitted(glm.out). However, you want the estimated coefficients not the fitted values, and for that you want thecoef()method, as incoef(glm.out).