# [R] Generalized Estimating Functions

ripley@stats.ox.ac.uk ripley at stats.ox.ac.uk
Mon May 13 19:09:46 CEST 2002

```On Mon, 13 May 2002, Frederico Zanqueta Poleto wrote:

> Hi Thomas,
>
> Thank you for your help.
> You are right. I've tried the OME example and the working correlation was
> right.
> Maybe it is a problem with Poisson, what do you think?

No, that works too in other examples.

It's most likely a problem with your use of gee, as the working
correlation matrix shows, plus the fact that it only did one iteration.

> > desreg<-gee
> viaveis,family=poisson,corstr="exchangeable")
> [1] "Beginning Cgee S-function, @(#) geeformula.q 4.13 98/01/27"
> [1] "running glm to get initial regression estimate"
> [1]  0.93464328  0.02317831  0.29278443  0.21399704  0.11593571
> 0.05833780 -0.11513896
> > summary(desreg)
>
>  GEE:  GENERALIZED LINEAR MODELS FOR DEPENDENT DATA
>  gee S-function, version 4.13 modified 98/01/27 (1998)
>
> Model:
>  Variance to Mean Relation: Poisson
>  Correlation Structure:     Exchangeable
>
> Call:
> gee(formula = desovas ~ ger + pop + fec + ger * pop + ger * fec +
>     pop * fec, id = unidade, data = desovas.ovos.inviaveis, family =
> poisson,
>     corstr = "exchangeable")
>
> Summary of Residuals:
>        Min         1Q     Median         3Q        Max
> -4.5893464 -1.5463047 -0.4124404  1.4106536  9.2329743
>
>
> Coefficients:
>                Estimate Naive S.E.    Naive z Robust S.E.   Robust z
> (Intercept)  0.93464317 0.06012985 15.5437480  0.05954487 15.6964517
> ger          0.02317832 0.07001297  0.3310576  0.06915388  0.3351702
> pop          0.29278452 0.06565443  4.4594785  0.06505729  4.5004104
> fec          0.21399711 0.07252180  2.9507967  0.07150063  2.9929402
> ger:pop      0.11593572 0.07355902  1.5760911  0.07318636  1.5841166
> ger:fec      0.05833782 0.07000740  0.8333093  0.07054498  0.8269592
> pop:fec     -0.11513904 0.07216442 -1.5955098  0.07149595 -1.6104274
>
> Estimated Scale Parameter:  1.366923
> Number of Iterations:  1
>
> Working Correlation
>       [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
>  [1,]    1    0    0    0    0    0    0    0    0     0     0     0
>  [2,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [3,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [4,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [5,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [6,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [7,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [8,]    0    0    0    0    0    0    0    0    0     0     0     0
>  [9,]    0    0    0    0    0    0    0    0    0     0     0     0
> [10,]    0    0    0    0    0    0    0    0    0     0     0     0
> [11,]    0    0    0    0    0    0    0    0    0     0     0     0
> [12,]    0    0    0    0    0    0    0    0    0     0     0     0
>
>
> Best regards,
> --
> Frederico Zanqueta Poleto
> fred at poleto.com
> --
> "It would be possible to describe everything scientifically, but it would
> make no sense; it would be without meaning, as if you described a
> Beethoven symphony as a variation of wave pressure." Albert Einstein
>
>
> ------------- Original message follows -------------
>
> On Sun, 12 May 2002, Frederico Zanqueta Poleto wrote:
>
> >   Hi,
> >
> > I'm trying to fit a marginal model via GEE but I'm getting strange
> > results and few problems.
> > If I set the working correlation as exchangeable I'm getting the same
> > fitting when I set as independent. Comparing to SAS results it shouldn't
> > happen.
> > If I try to use another working correlation (like AR-M or stat_M_dep), R
> > just exits without giving any error message.
>
> We probably need an example.  The `OME' example in help(gee) gives
> different results using exchangeable and independence working
> correlations, so it isn't a universal problem.
>
> > Another doubt is how R estimates the scale parameter for Poisson? I get
> > 1.36 in R, 1.25 in SAS (estimation by the square root of DEVIANCE/DOF)
> > and 1.17 (estimation by the square root of Pearson's Chi-Square/DOF).
> > I'm using R 1.4.1 but all the problems apply for S-Plus 2000 too.
>
> This is because 1.36=1.17^2, I should think.  The disperson parameter from
> gee() is a variance scale factor not a standard deviation scale factor.
>
> 	-thomas
>
> Thomas Lumley			Asst. Professor, Biostatistics
> tlumley at u.washington.edu	University of Washington, Seattle
>
>
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

--
Brian D. Ripley,                  ripley at 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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```