[R] naive variance in GEE

0 views
Skip to first unread message

Qiong Yang

unread,
Sep 8, 2008, 8:32:31 PM9/8/08
to r-h...@r-project.org
Hi,

The standard error from logistic regression is slightly different
from the naive SE from GEE under independence working correlation structure.

Shouldn't they be identical? Anyone has insight about this?

Thanks,
Qiong

a<-rbinom(1000,1)
b<-rbinom(1000,2,0.1)
c<-rbinom(1000,10,0.5)
summary(gee(a~b, id=c,family="binomial",corstr="independence"))$coef
summary(glm(a~b,family="binomial"))

______________________________________________
R-h...@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Prof Brian Ripley

unread,
Sep 9, 2008, 3:21:25 AM9/9/08
to Qiong Yang, r-h...@r-project.org
On Mon, 8 Sep 2008, Qiong Yang wrote:

> The standard error from logistic regression is slightly different from the
> naive SE from GEE under independence working correlation structure.
>
> Shouldn't they be identical? Anyone has insight about this?

They are computed quantities from iterations with different stopping
criteria. The coefficients are not 'identical' either.

Your example is incorrect (the first line) and not reproducible (no seed
is set, no library gee), so we don't know what you saw. But with

set.seed(1)
a <- rbinom(1000, 1, 0.2)
b <- rbinom(1000, 2, 0.1)
c <- rbinom(1000, 10, 0.5)
library(gee)
summary(gee(a ~ b, id=c, family="binomial", corstr="independence"))$coef
summary(glm(a ~ b, family="binomial"))$coef

the differences I see are negligible. I suggest you talk to your
supervisor about some courses on numerical methods.

>
> Thanks,
> Qiong
>
> a<-rbinom(1000,1)
> b<-rbinom(1000,2,0.1)
> c<-rbinom(1000,10,0.5)
> summary(gee(a~b, id=c,family="binomial",corstr="independence"))$coef
> summary(glm(a~b,family="binomial"))
>
> ______________________________________________
> R-h...@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Brian D. Ripley, rip...@stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595

Thomas Lumley

unread,
Sep 9, 2008, 5:21:34 PM9/9/08
to Qiong Yang, r-h...@r-project.org

Sorry, I misread your message. Prof Ripley is right, as usual -- the
estimates use different stopping criteria and so are just numerically
different.

-thomas

On Tue, 9 Sep 2008, Thomas Lumley wrote:

> On Mon, 8 Sep 2008, Qiong Yang wrote:
>

>> Hi,
>>
>> The standard error from logistic regression is slightly different from the
>> naive SE from GEE under independence working correlation structure.
>

> Yes


>
>> Shouldn't they be identical? Anyone has insight about this?
>

> No, they shouldn't. They are different estimators of the same quantity, like
> the mean and median of a symmetric distribution.
>
> -thomas


>
>
>
>
>> Thanks,
>> Qiong
>>
>> a<-rbinom(1000,1)
>> b<-rbinom(1000,2,0.1)
>> c<-rbinom(1000,10,0.5)
>> summary(gee(a~b, id=c,family="binomial",corstr="independence"))$coef
>> summary(glm(a~b,family="binomial"))
>>
>> ______________________________________________
>> R-h...@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>

> Thomas Lumley Assoc. Professor, Biostatistics
> tlu...@u.washington.edu University of Washington, Seattle
>

Thomas Lumley Assoc. Professor, Biostatistics
tlu...@u.washington.edu University of Washington, Seattle

Thomas Lumley

unread,
Sep 9, 2008, 5:19:41 PM9/9/08
to Qiong Yang, r-h...@r-project.org
On Mon, 8 Sep 2008, Qiong Yang wrote:

> Hi,
>
> The standard error from logistic regression is slightly different from the
> naive SE from GEE under independence working correlation structure.

Yes

> Shouldn't they be identical? Anyone has insight about this?

No, they shouldn't. They are different estimators of the same quantity,

like the mean and median of a symmetric distribution.

-thomas


> Thanks,
> Qiong
>
> a<-rbinom(1000,1)
> b<-rbinom(1000,2,0.1)
> c<-rbinom(1000,10,0.5)
> summary(gee(a~b, id=c,family="binomial",corstr="independence"))$coef
> summary(glm(a~b,family="binomial"))
>
> ______________________________________________
> R-h...@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

Thomas Lumley Assoc. Professor, Biostatistics


tlu...@u.washington.edu University of Washington, Seattle

______________________________________________

Qiong Yang

unread,
Sep 10, 2008, 9:31:37 AM9/10/08
to Thomas Lumley, r-h...@r-project.org
Thanks Thomas. Here is a further question I asked and the answer from
Prof Ripley. This agrees with your previous response.

Is it true that the same algorithm was used in calculation of GLM S.E.
and GEE naive S.E.,
and the only difference is the stopping criteria?

Professor Ripley: No, but it is one of the more important ones.
-----------------------------------------

Thanks,
Qiong

Reply all
Reply to author
Forward
0 new messages