2012-11-26 43 views
2

對不起,如果這是一個新手問題,但我不明白。我對glm()的數據擬合了一個S形曲線。這可以工作,我可以繪製輸出,並看到一條很好的S形曲線。如何輸出模型係數的估計值?

但是,如何讓R返回它所適合的最終值?據我瞭解,R的數據適合於logit(y) = b0 + b1x,但是當我做> summary(glm.out)我只得到

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 

如何獲得B0和B1?

樣本數據集:

Z列可以被忽略。

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 
+0

請發送一個樣品的數據,請? – hd1

回答

3

您通過fitted()方法得到的擬合值,即fitted(glm.out)。但是,您希望估計係數不是擬合值,因此您需要coef()方法,如coef(glm.out)

+3

和'methods(class =「glm」)'用於查看您可以對擬合模型執行的其他操作... –

相關問題