svymean_huber: Weighted Huber Mean and Total - Robust Horvitz-Thompson...

View source: R/svymean_huber.R

svymean_huberR Documentation

Weighted Huber Mean and Total – Robust Horvitz-Thompson Estimator

Description

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

Arguments

x

a one-sided [formula], e.g., ~myVariable.

design

an object of class survey.design; see svydesign.

k

[double] robustness tuning constant (0 < k <= Inf).

type

[character] type of method: "rwm" or "rht".

asym

[logical] if TRUE, an asymmetric Huber psi-function is used (default: FALSE).

na.rm

[logical] indicating whether NA values should be removed before the computation proceeds (default: FALSE).

verbose

[logical] indicating whether additional information is printed to the console (default: TRUE).

...

additional arguments passed to the method (e.g., maxit: maxit number of iterations, etc.; see svyreg_control).

Details

Package survey must be loaded in order to use the functions.

Methods/ types

type = "rht" or type = "rwm"; see weighted_mean_huber for more details.

Variance estimation.

Taylor linearization (residual variance estimator).

Utility functions

summary, coef, SE, vcov, residuals, fitted, robweights.

Bare-bone functions

See weighted_mean_huber and weighted_total_huber.

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)

svymean_tukey and svytotal_tukey

Examples

data(workplace)

library(survey)
# Survey design for simple random sampling without replacement
dn <- 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")

# Summarize
summary(m)

# Extract estimate
coef(m)

# Extract estimate of scale
scale(m)

# Extract estimated standard error
SE(m)

robsurvey documentation built on Jan. 6, 2023, 5:09 p.m.