Description Usage Arguments Details Value Utility functions Note See Also Examples
Weighted winsorized estimators of the mean and total are available in two forms:
bare-bone functions: weighted_mean_winsorized
and
weighted_total_winsorized
,
estimation methods: svymean_winsorized
and
svytotal_winsorized
(incl. variance estimation
based on the functionality of the survey package).
1 2 3 4 5 6 7 8 | weighted_mean_winsorized(x, w, LB = 0.05, UB = 1 - LB, na.rm = FALSE)
weighted_total_winsorized(x, w, LB = 0.05, UB = 1 - LB,
na.rm = FALSE)
svymean_winsorized(x, design, LB = 0.05, UB = 1 - LB, ...)
svytotal_winsorized(x, design, LB = 0.05, UB = 1 - LB, ...)
|
x |
numeric vector ( |
w |
numeric vector of weights |
LB |
lower bound of winsorizing, such that 0 ≤q LB < UB ≤q 1 |
UB |
upper bound of winsorizing, such that 0 ≤q LB < UB ≤q 1 |
na.rm |
a logical value indicating whether |
design |
a |
... |
additional arguments (not used) |
Robust winsorized Horvitz–Thompson total or Hajek mean
bare-bone functions: return the estimate (no variance estimation)
estimation methods on the basis of survey (incl. variance estimation)
Variance estimates of the mean or total estimator are computed as first-order linearization using the design-based-estimation capabilities available in package survey.
Estimates for domains can be obtained using the svyby wrapper in the survey package (see examples).
Estimate (scalar) or object of class svystat.rob
For the methods svymean_winsorized
and svytotal_winsorized
, 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, respectively, the estimate, variance, residuals and fitted
values
winswgt
is a generic name for the functions documented.
svymean_huber
, svytotal_huber
,
svymean_trimmed
, svytotal_trimmed
,
weighted_mean_huber
, weighted_total_huber
,
weighted_mean_trimmed
, weighted_total_trimmed
1 2 3 4 5 6 | library(survey)
data(api)
dstrat <- svydesign(id=~1, strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
svymean_winsorized(~api00, dstrat, LB = 0.05)
# Domain estimates
svyby(~api00, by = ~stype, design = dstrat, svymean_winsorized, LB = 0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.