I am trying to get robust standard errors in a logistic regression. Is there any way to do it, either in car or in MASS? Thanks for the help, Celso [[alternative HTML version deleted]]
Frank E Harrell Jr
2006-Jul-04 16:23 UTC
[R] Robust standard errors in logistic regression
Celso Barros wrote:> I am trying to get robust standard errors in a logistic regression. Is there > any way to do it, either in car or in MASS? > > Thanks for the help, > > CelsoOne way to do it is to install the Hmisc and Design packages then f <- lrm(y ~ rcs(age,5)*sex+race, x=TRUE, y=TRUE) g <- robcov(f) # replaces variance-covariance matrix with sandwich estimator; can also adjust for intra-cluster correlations h <- bootcov(f) # bootstrap covariance matrix, also allows clusters -- Frank E Harrell Jr Professor and Chair School of Medicine Department of Biostatistics Vanderbilt University
On Tue, 4 Jul 2006 13:14:24 -0300 Celso Barros wrote:> I am trying to get robust standard errors in a logistic regression. > Is there any way to do it, either in car or in MASS?Package sandwich offers various types of sandwich estimators that can also be applied to objects of class "glm", in particular sandwich() which computes the standard Eicker-Huber-White estimate. These robust covariance matrices can be plugged into various inference functions such as linear.hypothesis() in car, or coeftest() and waldtest() in lmtest. See the man pages and package vignettes for examples. Z> Thanks for the help, > > Celso > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html >