运行GEE模型摘要后,顶部的答案行丢失了

时间:2015-07-28 11:31:54

标签: r

我正在使用Rstudio运行一个广义的估算方程式,其公式如下:

    new <- gee(deaths~ subtypes,
       data = hi, family = "binomial", id = iso,
       corstr = "exchangeable", scale.fix = TRUE, scale.value = 1)

然后,我想通过运行来获得强大的标准化错误:

    summary(new)

但是控制台中的答案从中间开始就像这样

    [71,] 0.01557088 0.01557088
    [72,] 0.01557088 0.01557088
    [73,] 0.01557088 0.01557088
    [74,] 0.01557088 0.01557088
    [ reached getOption("max.print") -- omitted 60 rows ]

我希望它看起来像这样(通过R而不是Rstudio获得)。

    GEE:  GENERALIZED LINEAR MODELS FOR DEPENDENT DATA
    gee S-function, version 4.13 modified 98/01/27 (1998) 

    Model:
    Link:                      Logit 
    Variance to Mean Relation: Binomial 
    Correlation Structure:     Exchangeable 

    Call:
    gee(formula = deaths ~ subtypes, id = iso, data = hi, family =    "binomial", 
corstr = "exchangeable", scale.fix = TRUE, scale.value = 1)

    Summary of Residuals:
    Min         1Q     Median         3Q        Max 
    -0.5882720 -0.5824096  0.4175904  0.4175904  0.4909421 


    Coefficients:
                    Estimate Naive S.E.     Naive z Robust S.E.    Robust z
     (Intercept)  0.33267295  0.1214047  2.74019759   0.1604175  2.07379434
     subtypes2   -0.29643730  0.3437622 -0.86233233   0.4620348 -0.64159083
     subtypes3    0.02415334  0.2680558  0.09010566   0.2650652  0.09112226

     Estimated Scale Parameter:  1
     Number of Iterations:  3

如果没有省略答案的顶部,我怎样才能在Rstudio中实现这一点。

1 个答案:

答案 0 :(得分:0)

如果代码已实现,summary.gee有一个标志可能会隐藏工作关联的显示。

> gee:::summary.gee
function (object, correlation = TRUE, ...)
{
...
    if (correlation) {
    }
...
}

如果实施此功能,summary(new, correlation=FALSE)可能有所帮助。

在此之前,您可以操纵summary.gee对象。

> g <- gee(breaks ~ tension, id=wool, data=warpbreaks, corstr="exchangeable")
> s <- summary(g)
> s
...
Working Correlation
            [,1]       [,2]       [,3]       [,4]       [,5]       [,6]
 [1,] 1.00000000 0.02518404 0.02518404 0.02518404 0.02518404 0.02518404
 [2,] 0.02518404 1.00000000 0.02518404 0.02518404 0.02518404 0.02518404
 [3,] 0.02518404 0.02518404 1.00000000 0.02518404 0.02518404 0.02518404
...
> s$working.correlation <- NULL
> s
...
Working Correlation
NULL

(您可以在实际的working.correlation对象中将gee设置为NULL,但在摘要中执行此操作会保留原始输出。)