Functions to compute robust (outlier-resistant) estimates of finite population characteristics. The package supports the computations of robust means, totals, ratios, etc. Available methods are regression M- and GM-estimators, trimming, and winsorization, etc. The package complements the survey package.
A key design pattern of the package is that the majority of the estimating methods is available in two "flavors":
Bare-bone methods are stripped-down versions of the survey methods in terms of functionality and informativeness. These functions may serve users and other package developers as building blocks. In particular, bare-bone functions cannot compute variances. The survey methods are much more capable and depend, for variance estimation, on the survey package.
Trimming
Bare-bone methods | Survey methods |
---|---|
weighted_mean_trimmed() |
svymean_trimmed() |
weighted_total_trimmed() |
svytotal_trimmed() |
Winsorization
Bare-bone methods | Survey methods |
---|---|
weighted_mean_winsorized() |
svymean_winsorized() |
weighted_mean_k_winsorized() |
svymean_k_winsorized() |
weighted_total_winsorized() |
svytotal_winsorized() |
weighted_total_k_winsorized() |
svytotal_k_winsorized() |
Dalen's estimators (weight reduction methods)
Bare-bone methods | Survey methods |
---|---|
weighted_mean_dalen() |
svymean_dalen() |
weighted_total_dalen() |
svytotal_dalen() |
M-estimators
Bare-bone methods | Survey methods |
---|---|
weighted_mean_huber() |
svymean_huber() |
weighted_mean_tukey() |
svymean_tukey() |
weighted_total_huber() |
svytotal_huber() |
weighted_total_tukey() |
svytotal_tukey() |
The M-estimators have a type
argument taking the values "rht"
or "rhj"
to specify, respectively, the robust Horvitz–Thompson (RHT) or the robust Hajek (RHJ) estimator.
In addition, huber2()
implements a weighted Huber "Proposal 2" estimator (only bare-bone function). Function mer()
(minimum estimated risk estimator) implements an adaptive M-estimator.
Utility functions
weighted_quantile()
and weighted_median()
weighted_mad()
and weighted_IQR()
weighted_mean()
and weighted_total()
Weighted least squares
svyreg()
Weighted regression M-estimator
svyreg_huberM()
svyreg_tukeyM()
Weighted regression GM-estimator (Mallows and Schweppe type)
svyreg_huberGM()
svyreg_tukeyGM()
Weighted ratio M-estimator
svyratio_huber()
svyratio_tukey()
Robust ratio estimator of the mean or total
svymean_ratio()
svytotal_ratio()
Robust regression estimator of the mean or total
svymean_reg()
svytotal_reg()
weighted_line()
weighted_median_line()
weighted_median_ratio()
The package can be installed from CRAN using
install.packages("robsurvey")
Make sure that the R package devtools
is installed. Then, the robsurvey
package can be pulled from this GitHub repository and installed by
devtools::install_github("tobiasschoch/robsurvey")
The package includes four vignettes. Vignettes illustrate the problems and applications the package is designed to solve; see:
If you have any suggestions for feature additions or any problems with the software that you would like addressed with the development community, please submit an issue on the Issues tab of the project GitHub repository. You may want to search the existing issues before submitting, to avoid asking a question or requesting a feature that has already been discussed.
If you are interested in modifying the code, you may fork the project for your own use, as detailed in the GPL-2.0 License we have adopted for the project. In order to contribute, please contact the developer by Tobias Schoch at gmail dot com (the names are separated by a dot) after making the desired changes.
If you have questions about how to use the software, or would like to seek out collaborations related to this project, you may contact Tobias Schoch (see contact details above).