系数 table 在 运行 GEE 之后不显示两个自变量的结果
Coefficients table does not display results for both independent variables after running GEE
我有一个简单的问题。我使用 gee
包对下面的数据进行 运行 极速回归。我在 spss 中使用了相同的数据集,并将此 table 作为结果。
数据集
round<-c( 0.125150, 0.045800, -0.955299, -0.232007, 0.120880, -0.041525, 0.290473, -0.648752, 0.113264, -0.403685)
square<-c(-0.634753, 0.000492, -0.178591, -0.202462, -0.592054, -0.583173, -0.632375, -0.176673, -0.680557, -0.062127)
ideo<-c(0,1,0,1,0,1,0,0,1,1)
ex<-data.frame(round,square,ideo)
当我运行在r中同样分析
library(gee)
exmen<-summary(gee(round ~ square,
data = ex, id = ideo,
corstr = "independence"))
exmen
我得到:
Coefficients:
Estimate Naive S.E. Naive z Robust S.E. Robust z
(Intercept) -0.510 0.181 -2.82 0.229 -2.23
square -0.939 0.399 -2.36 0.404 -2.32
geepack
包
也是如此
library(geepack)
exmen<-summary(geeglm(round ~ square,
data = ex, id = ideo,
corstr = "independence"))
exmen
Coefficients:
Estimate Std.err Wald Pr(>|W|)
(Intercept) -0.510 0.229 4.95 0.026 *
square -0.939 0.404 5.40 0.020 *
---
所以我想知道两件事。
1. 为什么我只得到方形的结果?
2.(可选)是否可以使用 gee
或 geepack
重新创建与 spss 完全相同的 table?
因为您已将平方指定为唯一的解释变量。 R中不存在因变量LeftvsRight。添加时,指定模型,如下所示:
gee(LeftvsRight ~ square + round,data = ex, id = ideo,
corstr = "independence")
我有一个简单的问题。我使用 gee
包对下面的数据进行 运行 极速回归。我在 spss 中使用了相同的数据集,并将此 table 作为结果。
数据集
round<-c( 0.125150, 0.045800, -0.955299, -0.232007, 0.120880, -0.041525, 0.290473, -0.648752, 0.113264, -0.403685)
square<-c(-0.634753, 0.000492, -0.178591, -0.202462, -0.592054, -0.583173, -0.632375, -0.176673, -0.680557, -0.062127)
ideo<-c(0,1,0,1,0,1,0,0,1,1)
ex<-data.frame(round,square,ideo)
当我运行在r中同样分析
library(gee)
exmen<-summary(gee(round ~ square,
data = ex, id = ideo,
corstr = "independence"))
exmen
我得到:
Coefficients:
Estimate Naive S.E. Naive z Robust S.E. Robust z
(Intercept) -0.510 0.181 -2.82 0.229 -2.23
square -0.939 0.399 -2.36 0.404 -2.32
geepack
包
library(geepack)
exmen<-summary(geeglm(round ~ square,
data = ex, id = ideo,
corstr = "independence"))
exmen
Coefficients:
Estimate Std.err Wald Pr(>|W|)
(Intercept) -0.510 0.229 4.95 0.026 *
square -0.939 0.404 5.40 0.020 *
---
所以我想知道两件事。
1. 为什么我只得到方形的结果?
2.(可选)是否可以使用 gee
或 geepack
重新创建与 spss 完全相同的 table?
因为您已将平方指定为唯一的解释变量。 R中不存在因变量LeftvsRight。添加时,指定模型,如下所示:
gee(LeftvsRight ~ square + round,data = ex, id = ideo,
corstr = "independence")