Generalization of every with replacement sampling design
Computes the selection probability (sampling design) of each with replacement sample
p.WR(N, m, pk)
N |
Population size |
m |
Sample size |
pk |
A vector containing selection probabilities for each unit in the population |
Every with replacement sampling design is a particular case of a multinomial distribution.
p(\mathbf{S}=\mathbf{s})=\frac{m!}{n_1!n_2!\cdots n_N!}∏_{i=1}^N p_k^{n_k}
where n_k is the number of times that the k-th unit is selected in a sample.
The function returns a vector of selection probabilities for every with-replacement sample.
Hugo Andres Gutierrez Rojas hagutierrezro@gmail.com
Sarndal, C-E. and Swensson, B. and Wretman, J. (1992), Model Assisted Survey Sampling. Springer.
Gutierrez, H. A. (2009), Estrategias de muestreo: Diseno de encuestas y estimacion de parametros.
Editorial Universidad Santo Tomas.
############ ## Example 1 ############ # With replacement simple random sampling # Vector U contains the label of a population of size N=5 U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie") # Vector pk is the sel?ection probability of the units in the finite population pk <- c(0.2, 0.2, 0.2, 0.2, 0.2) sum(pk) N <- length(pk) m <- 3 # The smapling design p <- p.WR(N, m, pk) p sum(p) ############ ## Example 2 ############ # With replacement PPS random sampling # Vector U contains the label of a population of size N=5 U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie") # Vector x is the auxiliary information and y is the variables of interest x<-c(32, 34, 46, 89, 35) y<-c(52, 60, 75, 100, 50) # Vector pk is the sel?ection probability of the units in the finite population pk <- x/sum(x) sum(pk) N <- length(pk) m <- 3 # The smapling design p <- p.WR(N, m, pk) p sum(p)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.