E.Trim: Weight Trimming and Redistribution

Description Usage Arguments Details Value Author(s) References Examples

View source: R/E.Trim.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# 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)

TeachingSampling documentation built on April 22, 2020, 1:05 a.m.