svyratio_huber function

Robust Survey Ratio M-Estimator

Robust Survey Ratio M-Estimator

svyratio_huber and svyratio_tukey compute the robust MM-estimator of the ratio of two variables with, respectively, Huber and Tukey biweight (bisquare) psi-function.

svyratio_huber(numerator, denominator, design, k, var = denominator, na.rm = FALSE, asym = FALSE, verbose = TRUE, ...) svyratio_tukey(numerator, denominator, design, k, var = denominator, na.rm = FALSE, verbose = TRUE, ...)

Arguments

  • numerator: a one-sided [formula] object (i.e., symbolic description, e.g., ~payroll).
  • denominator: a one-sided [formula] object (i.e., symbolic description, e.g., ~employment).
  • design: an object of class survey.design; see svydesign.
  • k: [double] robustness tuning constant (0<k<=Inf0 < k <= Inf).
  • var: a [formula] object that defines the heteroscedastic variance (default: numerator).
  • na.rm: [logical] indicating whether NA values should be removed before the computation proceeds (default: FALSE).
  • asym: [logical] toggle for asymmetric Huber psi-function (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.).

Details

Package survey must be attached to the search path in order to use the functions (see library or require).

The functions svyratio_huber and svyratio_tukey are implemented as wrapper functions of the regression estimators svyreg_huberM and svyreg_tukeyM. See the help files of these functions (e.g., on how additional parameters can be passed via ... or on the usage of the var argument).

Returns

Object of class svyreg.rob and ratio

See Also

Overview (of all implemented functions)

summary, coef, residuals, fitted, SE and vcov

plot for regression diagnostic plot methods

svyreg_huberM, svyreg_huberGM, svyreg_tukeyM and svyreg_tukeyGM for robust regression estimators

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) } # Compute regression M-estimate with Huber psi-function m <- svyratio_huber(~payroll, ~employment, dn, k = 8) # Regression inference summary(m) # Extract the coefficients coef(m) # Extract estimated standard error SE(m) # Extract variance/ covariance matrix vcov(m) # Diagnostic plots (e.g., standardized residuals against fitted values) plot(m, which = 1L) # Plot of the robustness weights of the M-estimate against its residuals plot(residuals(m), robweights(m))
  • Maintainer: Tobias Schoch
  • License: GPL (>= 2)
  • Last published: 2024-08-22