svymean-m-estimator {robsurvey} | R Documentation |
Weighted Huber and Tukey Mean and Total (M-Estimator) – Robust Horvitz-Thompson Estimator
Description
Weighted Huber and Tukey M-estimator of the population mean and total (robust Horvitz-Thompson estimator)
Usage
svymean_huber(x, design, k, type = "rwm", asym = FALSE, na.rm = FALSE,
verbose = TRUE, ...)
svytotal_huber(x, design, k, type = "rwm", asym = FALSE, na.rm = FALSE,
verbose = TRUE, ...)
svymean_tukey(x, design, k, type = "rwm", na.rm = FALSE, verbose = TRUE, ...)
svytotal_tukey(x, design, k, type = "rwm", na.rm = FALSE, verbose = TRUE, ...)
Arguments
x |
a one-sided |
design |
an object of class |
k |
|
type |
|
asym |
|
na.rm |
|
verbose |
|
... |
additional arguments passed to the method (e.g., |
Details
Package survey must be attached to the search path in order to use
the functions (see library
or require
).
- Methods/ types
type = "rht"
ortype = "rwm"
; seeweighted_mean_huber
orweighted_mean_tukey
for more details.- Variance estimation.
Taylor linearization (residual variance estimator).
- Utility functions
- Bare-bone functions
See
weighted_mean_huber
weighted_mean_tukey
,weighted_total_huber
, andweighted_total_tukey
.
Value
Object of class svystat_rob
Failure of convergence
By default, the method assumes a maximum number of maxit = 100
iterations and a numerical tolerance criterion to stop the iterations of
tol = 1e-05
. If the algorithm fails to converge, you may
consider changing the default values; see svyreg_control
.
References
Hulliger, B. (1995). Outlier Robust Horvitz-Thompson Estimators. Survey Methodology 21, 79–87.
See Also
Overview (of all implemented functions)
Examples
head(workplace)
library(survey)
# Survey design for stratified 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)
}
# Robust Horvitz-Thompson M-estimator of the population total
svytotal_huber(~employment, dn, k = 9, type = "rht")
# Robust weighted M-estimator of the population mean
m <- svymean_huber(~employment, dn, k = 12, type = "rwm")
# Summary statistic
summary(m)
# Plot of the robustness weights of the M-estimate against its residuals
plot(residuals(m), robweights(m))
# Extract estimate
coef(m)
# Extract estimate of scale
scale(m)
# Extract estimated standard error
SE(m)