Description Usage Arguments Details Value Utility functions Note References See Also Examples
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).
1 2 3 4 5 6 7 8 9 | 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, ...)
|
x |
a numeric vector ( |
w |
a numeric vector of weights |
k |
a robustness tuning constant, k in [0, ∞) |
type |
type of estimator: |
info |
logical (default: |
na.rm |
a logical value indicating whether |
... |
additional arguments passed to the control object
(see |
design |
a |
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.
If the study variable 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).
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
huberwgt
is a generic name for the functions documented.
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
1 2 3 4 5 6 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.