Learn R Programming

robsurvey (version 0.1.0)

huberwgt: Huber M-estimators of the weighted mean and weighted total

Description

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).

Usage

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, ...)

Arguments

x

a numeric vector (weighted.[total/mean].huber or weighted.[total/mean].huber); a formula object or variable name (svymean_huber or svytotal_huber)

w

a numeric vector of weights

k

a robustness tuning constant, \(k\) in \([0, \infty)\)

type

type of estimator: "rht" (default) or "rwm"

info

logical (default: FALSE); if TRUE further estimation details are returned

na.rm

a logical value indicating whether NA values should be stripped before the computation proceeds.

...

additional arguments passed to the control object (see rht_control)

design

a survey.design object (see svydesign in survey)

Value

  • 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.

Utility functions

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

Details

Overview

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)

Type

Two types 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.

Scale

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

Variance estimates of the mean or total estimator are computed as first-order linearization using the design-based-estimation capabilities available in package survey.

Tuning

Additional arguments can be passed (via …) to specify the control parameters (e.g. number of iterations, psi-function, etc.); see rht_control for details.

Domain estimation

Estimates for domains can be obtained using the svyby wrapper in the survey package (see examples).

References

Hulliger, B. (1995). Outlier Robust Horvitz-Thompson Estimators, Survey Methodology 21(1): 79-87.

See Also

svymean_trimmed, svytotal_trimmed, svymean_winsorized, svytotal_winsorized, weighted_mean_trimmed, weighted_total_trimmed weighted_mean_winsorized, weighted_total_winsorized

Examples

Run this code
# 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