View source: R/svymean_trimmed.R
svymean_trimmed | R Documentation |
Weighted trimmed population mean and total.
svymean_trimmed(x, design, LB = 0.05, UB = 1 - LB, na.rm = FALSE) svytotal_trimmed(x, design, LB = 0.05, UB = 1 - LB, na.rm = FALSE)
x |
a one-sided |
design |
an object of class |
LB |
|
UB |
|
na.rm |
|
Package survey must be loaded in order to use the functions.
Population mean or total. Let μ denote the estimated trimmed population mean; then, the estimated trimmed total is given by Nhat μ with Nhat = sum(w[i]), where summation is over all observations in the sample.
The methods trims the LB
~\cdot 100\%
of the smallest observations and the (1 - UB
)~\cdot 100\%
of the largest observations from the data.
Large-sample approximation based on the influence function; see Huber and Ronchetti (2009, Chap. 3.3) and Shao (1994).
summary
,
coef
, SE
,
vcov
, residuals
,
fitted
,
robweights
.
See weighted_mean_trimmed
and
weighted_total_trimmed
.
Object of class svystat_rob
Huber, P. J. and Ronchetti, E. (2009). Robust Statistics, New York: John Wiley and Sons, 2nd edition. doi: 10.1002/9780470434697
Shao, J. (1994). L-Statistics in Complex Survey Problems. The Annals of Statistics 22, 976–967. doi: 10.1214/aos/1176325505
Overview (of all implemented functions)
weighted_mean_trimmed
and weighted_total_trimmed
data(workplace) library(survey) # Survey design for simple random sampling without replacement dn <- svydesign(ids = ~ID, strata = ~strat, fpc = ~fpc, weights = ~weight, data = workplace) # Estimated trimmed population total (5% symmetric trimming) svytotal_trimmed(~employment, dn, LB = 0.05, UB = 0.95) # Estimated trimmed population mean (5% trimming at the top of the distr.) svymean_trimmed(~employment, dn, UB = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.