Leverages for models fitted with complex survey data
Compute leverages for fixed effects, linear regression models fitted from complex survey data.
svyhat(mobj, doplot=FALSE)
mobj |
model object produced by |
doplot |
if |
svyhat computes the leverages from a model fitted with complex survey data. The model object mobj must be created by svyglm in the R survey package. The output is a vector of the leverages and a scatterplot of them versus the sequence number of the sample element used in fitting the model. By default, svyglm uses only complete cases (i.e., ones for which the dependent variable and all independent variables are non-missing) to fit the model. The rows of the data frame used in fitting the model can be retrieved from the svyglm object via as.numeric(names(mobj$y)). The data for those rows is in mobj$data.
Numeric vector whose names are the rows of the data frame in the svydesign object that were used in fitting the model.
Richard Valliant
Belsley, D.A., Kuh, E. and Welsch, R. (1980). Regression Diagnostics: Identifying Influential Data and Sources of Collinearity. New York: John Wiley & Sons, Inc.
Li, J., and Valliant, R. (2009). Survey weighted hat matrix and leverages. Survey Methodology, 35, 15-24.
Lumley, T. (2010). Complex Surveys. New York: John Wiley & Sons.
Lumley, T. (2014). survey: analysis of complex survey samples. R package version 3.30.
require(survey) data(api) dstrat <- svydesign(id=~1,strata=~stype, weights=~pw, data=apistrat) m1 <- svyglm(api00 ~ ell + meals + mobility, design=dstrat) h <- svyhat(mobj = m1, doplot=TRUE) 100*sum(h > 3*mean(h))/length(h) # percentage of leverages > 3*mean require(NHANES) data(NHANESraw) dnhanes <- svydesign(id=~SDMVPSU, strata=~SDMVSTRA, weights=~WTINT2YR, nest=TRUE, data=NHANESraw) m1 <- svyglm(BPDiaAve ~ as.factor(Race1) + BMI + AlcoholYear, design = dnhanes) h <- svyhat(mobj = m1, doplot=TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.