Using Robust Standard Errors lme4
Robust standard errors are available is GLMMadaptive. For more info, see here: https://drizopoulos.github.io/GLMMadaptive/articles/Methods.html#detailed-output-confidence-intervals-covariance-matrix-of-the-mles-and-robust-standard-errors-1 Best, Dimitris ?? Dimitris Rizopoulos Professor of Biostatistics Erasmus University Medical Center The Netherlands
From: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> on behalf of James Pustejovsky <jepusto at gmail.com>
Sent: Tuesday, November 9, 2021 11:44:44 PM
To: Daniel L?decke <d.luedecke at uke.de>
Cc: Suresh N Neupane <sneupane2 at student.gsu.edu>; r-sig-mixed-models <r-sig-mixed-models at r-project.org>
Subject: Re: [R-sig-ME] Using Robust Standard Errors lme4
Sent: Tuesday, November 9, 2021 11:44:44 PM
To: Daniel L?decke <d.luedecke at uke.de>
Cc: Suresh N Neupane <sneupane2 at student.gsu.edu>; r-sig-mixed-models <r-sig-mixed-models at r-project.org>
Subject: Re: [R-sig-ME] Using Robust Standard Errors lme4
Waarschuwing: Deze e-mail is afkomstig van buiten de organisatie. Klik niet op links en open geen bijlagen, tenzij u de afzender herkent en weet dat de inhoud veilig is.
Caution: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
I can confirm, clubSandwich does not currently support glmerMod
objects. It may be possible to implement methods for such models, but
it will take some time. I welcome feedback on whether this would be of
broad interest, as well as expressions of interest if anyone would
like to contribute to implementation.
James
On Tue, Nov 9, 2021 at 3:20 PM Daniel L?decke <d.luedecke at uke.de> wrote:
>
> Hi Suresh,
> I just tried to find an example with glmer(), but it indeed looks like the
> clubSandwich package only supports lmer() models, not glmer(). So my
> suggested approach unfortunately doesn't seem to work.
>
> Best
> Daniel
>
> Am Di., 9. Nov. 2021 um 17:24 Uhr schrieb Suresh N Neupane <
> sneupane2 at student.gsu.edu>:
>
> > Hi Daniel,
> > Thank you so much for your suggestions. I tried that but it gives me an
> > error:
> >
> > Error in UseMethod("estfun") :
> > no applicable method for 'estfun' applied to an object of class
> > "c('glmerMod', 'merMod')"
> >
> > My DV is death (0/1) and IV other variables:
> > Model: (with random county effects):
> > fit <- glmer(death ~ (1|county_fips_code) +white + black + pop.density ,
> > family = binomial("logit"), nAGQ=0, data = data.thesis)
> > I tried the code you sent and used "county_fips_code" as my cluster
> > variable but it says did not find "county_fips_code".
> > I was able to use parameters::model_parameters(fit) to extract some info
> > (This is great!) such as;
> > Parameter | Log-Odds | SE | 95% CI | z | p
> >
> > Thank you so much again,
> > I'd really appreciate if you would have more input on this.
> > Sincerely,
> > Suresh
> >
> >
> >
> >
> > ------------------------------
> > *From:* Daniel L?decke <d.luedecke at uke.de>
> > *Sent:* Tuesday, November 9, 2021 4:32 AM
> > *To:* Suresh N Neupane <sneupane2 at student.gsu.edu>
> > *Cc:* r-sig-mixed-models at r-project.org <r-sig-mixed-models at r-project.org>
> > *Subject:* AW: [R-sig-ME] Using Robust Standard Errors lme4
> >
> > Hi Suresh,
> >
> > you could try the "parameters" package, which should (easily) return
> > different types of robust standard errors, including cluster-robust
> > standard
> > errors for mixed models:
> >
> >
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Feasystats.github.io%2Fparameters%2Farticles%2Fmodel_parameters_robust.html&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C97ab93a935614522a3ef08d9a3d299dc%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C1%7C637720947192192478%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=EVr5Y257ErigeHaaeqjmOPQ1zka6ZQ%2BN%2BXxLIJUGarU%3D&reserved=0
> >
> > Maybe you try this out on a very small subset of your model to see if it
> > works. Also, since the "model_parameters()" function includes random
> > effects
> > variances by default, you may set the effects-argument to "fixed" to speed
> > up computation. The call to the function could then look like something
> > like
> > this:
> >
> > model_parameters(
> > model,
> > effects = "fixed",
> > robust = TRUE,
> > vcov_estimation = "CL",
> > vcov_type = "HC1",
> > vcov_args = list(cluster = <your cluster variable from the data>)
> > )
> >
> >
> > Best
> > Daniel
> >
> > -----Urspr?ngliche Nachricht-----
> > Von: R-sig-mixed-models <r-sig-mixed-models-bounces at r-project.org> Im
> > Auftrag von Suresh N Neupane via R-sig-mixed-models
> > Gesendet: Montag, 8. November 2021 12:49
> > An: r-sig-mixed-models at r-project.org
> > Betreff: [R-sig-ME] Using Robust Standard Errors lme4
> >
> > Dear all,
> > I am using lme4 package to run a hierarchical logistic regression model
> > (with random county effect) for my binomial dependent variable, COVID death
> > (0/1). This is a very large dataset with ~ 8 million observations.
> > I need to find the robust standard error but was not sure about any
> > package.
> > I tried robustlmm (although my DV is not continuous) and got this error
> > when
> > used MerDeriv (sandwich):
> > Error in UseMethod("estfun") :
> > no applicable method for 'estfun' applied to an object of class
> > "c('glmerMod', 'merMod')"
> > The real tricky part is it takes several hours to compute because of the
> > dataset length.
> > All I need is to get robust standard error values.
> > I already fit the models:
> > fit <- glmer(death ~ (1|county_fips_code) + IV).
> > Thank you so much,
> > Suresh Neupane
> >
> >
> --
>
> _____________________________________________________________________
>
> Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg | https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.uke.de%2F&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C97ab93a935614522a3ef08d9a3d299dc%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C1%7C637720947192192478%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=2Qofa4o0G55DGO3qEkRD%2BD0CT7Fy2%2F9LA0ETWfHOAMU%3D&reserved=0
> Vorstandsmitglieder: Prof. Dr. Burkhard G?ke (Vorsitzender), Joachim Pr?l?, Prof. Dr. Blanche Schwappach-Pignataro, Marya Verdel
> _____________________________________________________________________
>
> SAVE PAPER - THINK BEFORE PRINTING
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mixed-models&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C97ab93a935614522a3ef08d9a3d299dc%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C1%7C637720947192192478%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Jk8XBNlm94jgM%2BkqHQdOex2XgWtbUbq658amvA0kGG0%3D&reserved=0
_______________________________________________
R-sig-mixed-models at r-project.org mailing list
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-mixed-models&data=04%7C01%7Cd.rizopoulos%40erasmusmc.nl%7C97ab93a935614522a3ef08d9a3d299dc%7C526638ba6af34b0fa532a1a511f4ac80%7C0%7C1%7C637720947192192478%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Jk8XBNlm94jgM%2BkqHQdOex2XgWtbUbq658amvA0kGG0%3D&reserved=0