E.Trim {TeachingSampling} | R Documentation |
Weight Trimming and Redistribution
Description
This function performs a method of trimming sampling weights based on the evenly redistribution of the net ammount of weight loss among units whose weights were not trimmed. This way, the sum of the timmed sampling weights remains the same as the original weights.
Usage
E.Trim(dk, L, U)
Arguments
dk |
Vector of original sampling weights. |
L |
Lower bound for weights. |
U |
Upper bound for weights. |
Details
The function returns a vector of trimmed sampling weigths.
Value
This function returns a vector of trimmed weights.
Author(s)
Hugo Andres Gutierrez Rojas <hagutierrezro at gmail.com> with contributions from Javier Nunez <javier_nunez at inec.gob.ec>
References
Valliant, R. et. al. (2013), Practical Tools for Designing and
Weigthing Survey Samples. Springer.
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas
y estimacion de parametros. Editorial Universidad Santo Tomas.
Examples
# Example 1
dk <- c(1, 1, 1, 10)
summary(dk)
L <- 1
U <- 3.5 * median(dk)
dkTrim <- E.Trim(dk, L, U)
sum(dk)
sum(dkTrim)
# Example 2
dk <- rnorm(1000, 10, 10)
L <- 1
U <- 3.5 * median(dk)
dkTrim <- E.Trim(dk, L, U)
sum(dk)
sum(dkTrim)
summary(dk)
summary(dkTrim)
hist(dk)
hist(dkTrim)