[R] Robust standard errors in logistic regression

Frank E Harrell Jr f.harrell at vanderbilt.edu
Tue Jul 4 18:23:34 CEST 2006


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,
> 
>                                           Celso

One 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



More information about the R-help mailing list