class_svyreg_rob | R Documentation |
Methods and utility functions for objects of class svyreg_rob
.
## S3 method for class 'svyreg_rob'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'svyreg_rob'
summary(object, mode = c("design", "model", "compound"),
digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'svyreg_rob'
coef(object, ...)
## S3 method for class 'svyreg_rob'
vcov(object, mode = c("design", "model", "compound"), ...)
## S3 method for class 'svyreg_rob'
SE(object, mode = c("design", "model", "compound"), ...)
## S3 method for class 'svyreg_rob'
residuals(object, ...)
## S3 method for class 'svyreg_rob'
fitted(object, ...)
## S3 method for class 'svyreg_rob'
robweights(object)
## S3 method for class 'svyreg_rob'
plot(x, which = 1L:4L,
hex = FALSE, caption = c("Standardized residuals vs. Fitted Values",
"Normal Q-Q", "Response vs. Fitted values",
"Sqrt of abs(Residuals) vs. Fitted Values"),
panel = if (add.smooth) function(x, y, ...) panel.smooth(x, y,
iter = iter.smooth, ...) else points, sub.caption = NULL, main = "",
ask = prod(par("mfcol")) < length(which) && dev.interactive(), ...,
id.n = 3, labels.id = names(residuals(x)), cex.id = 0.75, qqline = TRUE,
add.smooth = getOption("add.smooth"), iter.smooth = 3,
label.pos = c(4, 2), cex.caption = 1, cex.oma.main = 1.25)
x |
object of class |
digits |
|
... |
additional arguments passed to the method. |
object |
object of class |
mode |
|
which |
|
hex |
|
caption |
|
panel |
panel function. The useful alternative to
|
sub.caption |
|
main |
|
ask |
|
id.n |
|
labels.id |
|
cex.id |
|
qqline |
|
add.smooth |
|
iter.smooth |
|
label.pos |
|
cex.caption |
|
cex.oma.main |
|
Package survey must be attached to the search path in order to use
the functions (see library
or require
).
For variance estimation (summary
, vcov
, and
SE
) three modes are available:
"design"
: design-based variance estimator using
linearization; see Binder (1983)
"model"
: model-based weighted variance estimator
(the sampling design is ignored)
"compound"
: design-model-based variance
estimator; see Rubin-Bleuer and Schiopu-Kratina (2005)
and Binder and Roberts (2009)
The following utility functions are available:
summary
gives a summary of the estimation
properties
plot
shows diagnostic plots for the estimated
regression model
robweights
extracts the robustness weights
(if available)
coef
extracts the estimated regression coefficients
vcov
extracts the (estimated) covariance matrix
residuals
extracts the residuals
fitted
extracts the fitted values
Binder, D. A. (1983). On the Variances of Asymptotically Normal Estimators from Complex Surveys. International Statistical Review 51, 279–292. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.2307/1402588")}
Binder, D. A. and Roberts, G. (2009). Design- and Model-Based Inference for Model Parameters. In: Sample Surveys: Inference and Analysis ed. by Pfeffermann, D. and Rao, C. R. Volume 29B of Handbook of Statistics, Amsterdam: Elsevier, Chap. 24, 33–54 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/S0169-7161(09)00224-7")}
Rubin-Bleuer, S. and Schiopu-Kratina, I. (2005). On the Two-phase framework for joint model and design-based inference. The Annals of Statistics 33, 2789–2810. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/009053605000000651")}
Weighted least squares: svyreg
; robust weighted regression
svyreg_huberM
, svyreg_huberGM
,
svyreg_tukeyM
and svyreg_tukeyGM
head(workplace)
library(survey)
# Survey design for simple random sampling without replacement
dn <- if (packageVersion("survey") >= "4.2") {
# survey design with pre-calibrated weights
svydesign(ids = ~ID, strata = ~strat, fpc = ~fpc, weights = ~weight,
data = workplace, calibrate.formula = ~-1 + strat)
} else {
# legacy mode
svydesign(ids = ~ID, strata = ~strat, fpc = ~fpc, weights = ~weight,
data = workplace)
}
# Compute regression M-estimate with Huber psi-function
m <- svyreg_huberM(payroll ~ employment, dn, k = 14)
# Diagnostic plots (e.g., standardized residuals against fitted values)
plot(m, which = 1L)
# Plot of the robustness weights of the M-estimate against its residuals
plot(residuals(m), robweights(m))
# Utility functions
summary(m)
coef(m)
SE(m)
vcov(m)
residuals(m)
fitted(m)
robweights(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.