pps.sampling {samplingbook} | R Documentation |
Sampling with Probabilities Proportional to Size
Description
The function provides sample techniques with sampling probabilities which are proportional to the size of a quantity z.
Usage
pps.sampling(z, n, id = 1:N, method = 'sampford', return.PI = FALSE)
Arguments
z |
vector of quantities which determine the sampling probabilities in the population |
n |
positive integer for sample size |
id |
an optional vector with identification values for population elements. Default is |
method |
the sampling method to be used. Options are |
return.PI |
logical. If |
Details
The different methods vary in their run time. Therefore, method='sampford'
is stopped if N > 200
or if n/N < 0.3
. method='tille'
is stopped if N > 500
.
In case of large populations use method='midzuno'
or method='madow'
.
Value
The function pps.sampling
returns a value, which is a list consisting of the components
call |
is a list of call components: |
sample |
resulted sample |
pik |
inclusion probabilities |
PI |
sample second order inclusion probabilities |
PI.full |
full second order inclusion probabilities |
Author(s)
Juliane Manitz
References
Kauermann, Goeran/Kuechenhoff, Helmut (2010): Stichproben. Methoden und praktische Umsetzung mit R. Springer.
See Also
Examples
## 1) simple suppositious example
data <- data.frame(id = 1:7, z = c(1.8, 2 ,3.2 ,2.9 ,1.5 ,2.0 ,2.2))
# Usage of pps.sampling for Sampford method
set.seed(178209)
pps.sample_sampford <- pps.sampling(z=data$z, n=2, method='sampford', return.PI=FALSE)
pps.sample_sampford
# sampling elements
id.sample <- pps.sample_sampford$sample
id.sample
# other methods
set.seed(178209)
pps.sample_tille <- pps.sampling(z=data$z, n=2, method='tille')
pps.sample_tille
set.seed(178209)
pps.sample_midzuno <- pps.sampling(z=data$z, n=2, method='midzuno')
pps.sample_midzuno
set.seed(178209)
pps.sample_madow <- pps.sampling(z=data$z, n=2, method='madow')
pps.sample_madow
## 2) influenza
data(influenza)
summary(influenza)
set.seed(108506)
pps <- pps.sampling(z=influenza$population,n=20,method='midzuno')
pps
sample <- influenza[pps$sample,]
sample