admin に投稿
R

データセット取り込み

🔗

 

Image
Rcmdr

 

Image
Rcmdr

 

変数 二値データ(V3)から順番にダブルクリックする。

Image
Rcmdr

 

Console 表示

Rcmdr>  GLM.2 <- glm(V3 ~ V2, family=binomial(logit), data=ロジスティック回帰分析)

Rcmdr>  summary(GLM.2)

Call:
glm(formula = V3 ~ V2, family = binomial(logit), data = ロジスティック回帰分析)

Coefficients:
            Estimate Std. Error z value Pr(>|z|)
(Intercept)   -7.125      4.868  -1.464    0.143
V2             1.583      1.060   1.494    0.135

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 13.8629  on 9  degrees of freedom
Residual deviance:  6.6033  on 8  degrees of freedom
AIC: 10.603

Number of Fisher Scoring iterations: 6


Rcmdr>  exp(coef(GLM.2))  # Exponentiated coefficients ("odds ratios")
 (Intercept)           V2 
0.0008049878 4.8708233355 

Coefficients:
           Estimate Std. Error z value Pr(>|z|)
(Intercept)   -7.125      4.868  -1.464    0.143
V2             1.583      1.060   1.494    0.135

i = exp( -7.125 + 1.586xi ) / ( 1 +  exp( -7.125 + 1.586xi ) )