Weighted Huber M-estimators of the mean and total are available in two forms:
bare-bone functions: weighted_mean_huber
and
weighted_total_huber
,
estimation methods: svymean_huber
and
svytotal_huber
(incl. variance estimation
based on the functionality of the survey package).
weighted_mean_huber(x, w, k = 1.5, type = "rht", info = FALSE,
na.rm = FALSE, ...)weighted_total_huber(x, w, k = 1.5, type = "rht", info = FALSE,
na.rm = FALSE, ...)
svymean_huber(x, design, k = 1.5, type = "rht", ...)
svytotal_huber(x, design, k = 1.5, ...)
a numeric vector (weighted.[total/mean].huber
or
weighted.[total/mean].huber
); a formula object or variable
name (svymean_huber
or svytotal_huber
)
a numeric vector of weights
a robustness tuning constant, \(k\) in \([0, \infty)\)
type of estimator: "rht"
(default) or "rwm"
logical (default: FALSE
); if TRUE
further
estimation details are returned
a logical value indicating whether NA
values should
be stripped before the computation proceeds.
additional arguments passed to the control object
(see rht_control
)
a survey.design
object (see svydesign
in survey)
An estimate (scalar) for weighted.[total/mean].huber
(unless info=TRUE
)
An object of class svystat.rob
for functions of the type
msvy[total/mean]
, i.e. a list including the following components:
characteristic
, estimator
, estimate
, variance
,
robust
, optim
, residuals
, model
, design
,
and call
.
For the methods svymean_huber
and svytotal_huber
, the following
utility functions can be used
summary
gives a summary of the estimation properties
robweights
retrieves the robustness weights
coef
, vcov
, residuals
, and fitted
retrieve the estimate, variance, residuals and fitted
values, respectively
Robust M-estimator of the Horvitz--Thompson total or the Hajek mean
bare-bone functions: return the estimate (no variance estimation)
estimation methods on the basis of survey (incl. variance estimation)
Two type
s of estimation methods are available:
rht
(robust) Horvitz-Thompson M-estimator of the total/mean
rwm
(robust) weighted mean estimator of a Hajek-type estimator of the mean.
x
is positively correlated with the inclusion
probabilities, type "rht"
tends to be superior.M-estimators of location are not scale invariant. The unknown scale is
estimated simultaneously with the estimate of location (mean or total) as
the weighted median absolute deviation from the weighted median (MAD, see
weighted_mad
).
Variance estimates of the mean or total estimator are computed as first-order linearization using the design-based-estimation capabilities available in package survey.
Additional arguments can be passed (via …) to specify the control
parameters (e.g. number of iterations, psi-function, etc.); see
rht_control
for details.
Estimates for domains can be obtained using the svyby wrapper in the survey package (see examples).
Hulliger, B. (1995). Outlier Robust Horvitz-Thompson Estimators, Survey Methodology 21(1): 79-87.
svymean_trimmed
, svytotal_trimmed
,
svymean_winsorized
, svytotal_winsorized
,
weighted_mean_trimmed
, weighted_total_trimmed
weighted_mean_winsorized
, weighted_total_winsorized
# NOT RUN {
library(survey)
data(api)
dstrat <- svydesign(id=~1, strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
svymean_huber(~api00, dstrat, k = 2)
# Domain estimates
svyby(~api00, by = ~stype, design = dstrat, svymean_huber, k = 1.34)
# }
Run the code above in your browser using DataLab