Search code examples
rregressioncoefficients

Coefficients table does not display results for both independent variables after running GEE


I have a simple question here. I use the gee package to run a gee regression on the data below. I used the same dataset in spss and took this table as result.

enter image description here

dataset

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)

When I run the same analysis in r

library(gee)  
    exmen<-summary(gee(round ~ square,
                        data = ex, id = ideo,
                        corstr = "independence"))
    exmen

I get:

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

The same happens with geepack package

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 *
---

So I wonder 2 things. 1. Why I get results only for square? 2.(optional)Is it possible to recreate exactly the same table with gee or geepack as with spss?


Solution

  • Because you have specified square to be the only explanatory variable. The dependent variable LeftvsRight does not exist in R. When you add it, specify the model like this:

    gee(LeftvsRight ~ square + round,data = ex, id = ideo,
                        corstr = "independence")