Description Usage Arguments Details Value Utility functions Note See Also Examples
Weighted trimmed estimators of the mean and total are available in two forms:
bare-bone functions: weighted_mean_trimmed
and
weighted_total_trimmed
,
estimation methods: svymean_trimmed
and
svytotal_trimmed
(incl. variance estimation
based on the functionality of the survey package).
1 2 3 4 5 6 7 | weighted_mean_trimmed(x, w, LB = 0.05, UB = 1 - LB, na.rm = FALSE)
weighted_total_trimmed(x, w, LB = 0.05, UB = 1 - LB, na.rm = FALSE)
svymean_trimmed(x, design, LB = 0.05, UB = 1 - LB, ...)
svytotal_trimmed(x, design, LB = 0.05, UB = 1 - LB, ...)
|
x |
numeric vector ( |
w |
numeric vector of weights |
LB |
lower bound of trimming, such that 0 ≤q LB < UB ≤q 1 |
UB |
upper bound of trimming, such that 0 ≤q LB < UB ≤q 1 |
na.rm |
a logical value indicating whether |
design |
a |
... |
additional arguments (not used) |
Robust trimmed 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_trimmed
and svytotal_trimmed
, 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
trimwgt
is a generic name for the functions documented.
svymean_huber
, svytotal_huber
,
svymean_winsorized
, svytotal_winsorized
,
weighted_mean_huber
, weighted_total_huber
,
weighted_mean_winsorized
, weighted_total_winsorized
1 2 3 4 5 6 | library(survey)
data(api)
dstrat <- svydesign(id=~1, strata=~stype, weights=~pw, data=apistrat, fpc=~fpc)
svymean_trimmed(~api00, dstrat, LB = 0.05)
# Domain estimates
svyby(~api00, by = ~stype, design = dstrat, svymean_trimmed, LB = 0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.