[R-meta] sandwhich estimator with geeglm object

Yefeng Yang ye|eng@y@ng1 @end|ng |rom un@w@edu@@u
Tue May 2 05:27:27 CEST 2023


Hi James,

Brilliant! You addressed my another question beforehand. I compared the results from geepack::geeglm() and nlme::gls() + clubSandwich::vcovCR(), and found slight differences between them. I am going to ask why. But you addressed it already. Very much appreciated.

BTW, what is your opinion of using this interactive way (moment estimator) to estimate within-group correlations (e.g., auto-correlation terms). I mean likelihood approach won't work if the distribution is misspecified (because we do not know the within-group correlations and we need to estimate it in geepack::geeglm()). This is a sort of dilemma. If we put this in the context of meta-analysis, metafor::rma.mv does not allow for estimating within-group correlations from data, although it can by using an iterative way to find the maximum likelihood. What do you think?

Cheers,
Yefeng


________________________________
From: James Pustejovsky <jepusto using gmail.com>
Sent: Tuesday, 2 May 2023 12:39
To: Yefeng Yang <yefeng.yang1 using unsw.edu.au>
Cc: R Special Interest Group for Meta-Analysis <r-sig-meta-analysis using r-project.org>
Subject: Re: [R-meta] sandwhich estimator with geeglm object

Hi Yefeng,

Yes, this is correct if we're speaking on a very broad level. Broadly, geepack::geeglm() with an identity link function fits the same type of model as nlme::gls(), but geepack::geeglm() uses sandwich variance estimation whereas nlme::gls() uses model-based variance estimation. Running nlme::gls() with clubSandwich::vcovCR() will give you sandwich variance estimation. The CR1 and CR3 sandwich estimators can be calculated from both packages for comparison purposes.

There is one other difference that should be noted though: geepack::geeglm() uses moment estimators for the parameters of the working model (such as variance coefficients, auto-correlation terms, etc.). In contrast, nlme::gls() uses maximum likelihood or restricted maximum likelihood estimation for these parameters. This difference in estimation strategies can lead to numerical differences in the model coefficient estimates calculated by the two packages  (and therefore also differences in the sandwich standard errors generated by geepack::geeglm versus by clubSandwich::vcovCR.gls).

James

On Mon, May 1, 2023 at 7:19 PM Yefeng Yang <yefeng.yang1 using unsw.edu.au<mailto:yefeng.yang1 using unsw.edu.au>> wrote:
Dear James,
Probably, it is more clear if I ask "whether glm + RVE is equal to gee?". gee is doing RVE on the fly, while glm + RVE uses a post-hoc way to calculate robust errors when dealing with correlated errors (e.g., repeated measurements).
Best,
Yefeng

________________________________
From: James Pustejovsky <jepusto using gmail.com<mailto:jepusto using gmail.com>>
Sent: Tuesday, 2 May 2023 0:55
To: R Special Interest Group for Meta-Analysis <r-sig-meta-analysis using r-project.org<mailto:r-sig-meta-analysis using r-project.org>>
Cc: Yefeng Yang <yefeng.yang1 using unsw.edu.au<mailto:yefeng.yang1 using unsw.edu.au>>
Subject: Re: [R-meta] sandwhich estimator with geeglm object

Hi Yefeng,

geeglm is currently available in the development version of clubSandwich. We are including support for GEE models because clubSandwich implements small-sample corrections to the sandwich variance estimator and to the degrees of freedom, which are not available in geepack. McCaffrey and Bell (2006; https://doi.org/10.1002/sim.2502) showed that these small-sample corrections perform better than the standard sandwich estimators and large-sample test statistics implemented in geepack.

GEE is not equivalent to GLS. Rather, geepack::geeglm() is to glm() as nlme::gls() is to lm(). GEE models allow non-linear link functions for the conditional expectation of the outcome. Of course, gls is a special case of geeglm with an identity link function (just as lm is a special case of glm).

James

On Mon, May 1, 2023 at 4:15 AM Yefeng Yang via R-sig-meta-analysis <r-sig-meta-analysis using r-project.org<mailto:r-sig-meta-analysis using r-project.org>> wrote:
Dear experts,

I would be grateful if anyone can address my confusion concerning robust variance estimation (especially via the implementation of clubsandwich package).

First question:
geeglm object refers to the regression model fitted by Generalized Estimating Equations (GEE), which can be implemented in package geepack. Given that GEE already calculates cluster robust errors to account for mids-specified var-cov structure (e.g., autocorrelation), why clubsandwich still calculate robust errors for geeglm object

Second question:
GEE basically relaxes the assumption about var-cov structure and it uses a working var-cov structure (usually misspecified) to get beta coefficient and then uses the sandwich estimator to estimate sampling variances Var(beta) or standard error SE(beta). In this sense, GEE is equivalent to generalized least squares (say fitted by gls()) with CRVE. Am I correct?


Best,
Yefeng


        [[alternative HTML version deleted]]

_______________________________________________
R-sig-meta-analysis mailing list @ R-sig-meta-analysis using r-project.org<mailto:R-sig-meta-analysis using r-project.org>
To manage your subscription to this mailing list, go to:
https://stat.ethz.ch/mailman/listinfo/r-sig-meta-analysis

	[[alternative HTML version deleted]]



More information about the R-sig-meta-analysis mailing list