pps.sampling: Sampling with Probabilities Proportional to Size

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/pps.sampling.R

Description

The function provides sample techniques with sampling probabilities which are proportional to the size of a quantity z.

Usage

1
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 'id = 1:N', where 'N' is length of 'z'.

method

the sampling method to be used. Options are 'sampford', 'tille', 'midzuno' or 'madow'.

return.PI

logical. If TRUE the pairwise inclusion probabilities for all individuals in the population are returned.

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: z vector of quantity data, n sample size, id identification values, and method sampling method

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

htestimate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## 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

jmanitz/samplingbook documentation built on April 10, 2021, 4:44 p.m.