質問

    Call:
glm(formula = Y1 ~ 0 + x1 + x2 + x3 + x4 + x5, family = quasibinomial(link = cauchit))

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-2.5415   0.2132   0.3988   0.6614   1.8426  

Coefficients:
   Estimate Std. Error t value Pr(>|t|)    
x1  -0.7280     0.3509  -2.075  0.03884 *  
x2  -0.9108     0.3491  -2.609  0.00951 ** 
x3   0.2377     0.1592   1.494  0.13629    
x4  -0.2106     0.1573  -1.339  0.18151    
x5   3.6982     0.8658   4.271 2.57e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for quasibinomial family taken to be 0.8782731)

    Null deviance: 443.61  on 320  degrees of freedom
Residual deviance: 270.17  on 315  degrees of freedom
AIC: NA

Number of Fisher Scoring iterations: 12

Here is the output from glm in R. Do you know a way to pull out Dispersion parameter which is 0.8782731 in this case, instead of just copy and paste. Thanks.

役に立ちましたか?

解決

You can extract it from the output of summary:

data(iris)
mod <- glm((Petal.Length > 5) ~ Sepal.Width, data=iris)
summary(mod)
# 
# Call:
# glm(formula = (Petal.Length > 5) ~ Sepal.Width, data = iris)
# 
# Deviance Residuals: 
#     Min       1Q   Median       3Q      Max  
# -0.3176  -0.2856  -0.2714   0.7073   0.7464  
# 
# Coefficients:
#             Estimate Std. Error t value Pr(>|t|)
# (Intercept)  0.38887    0.26220   1.483    0.140
# Sepal.Width -0.03561    0.08491  -0.419    0.676
# 
# (Dispersion parameter for gaussian family taken to be 0.2040818)
# 
#     Null deviance: 30.240  on 149  degrees of freedom
# Residual deviance: 30.204  on 148  degrees of freedom
# AIC: 191.28
# 
# Number of Fisher Scoring iterations: 2
summary(mod)$dispersion
# [1] 0.2040818

The str function in R is often helpful to solve these sorts of questions. For instance, I looked at str(summary(mod)) to answer the question.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top