Agriculture Reference
In-Depth Information
0
@
1
A
1
y 11
y 12
...
y 1 g
2
y 21
y 22
...
y 2 g
...
...
...
...
...
:
ð 1
:
4 Þ
k k 1
y k 2
...
y kg
...
...
...
...
...
n n 1
y n 2
...
y ng
For simplicity reasons, we will generally consider one study variable y, so the
second subscript is not needed.
Now, let
be the set of all possible samples, s . A sampling design, p ( s ), is a
probability distribution on
Ω
Ω
that satisfies
pðÞ 0, all s 2 Ω
,
X
ð 1
:
5 Þ
pðÞ ¼1
Ω
where s is the outcome of a random variable S . The function p ( . ) plays a central role
in the theory, because it has a one-to-one correspondence with the selection
criterion. For this reason it is called the sampling design.
Consider a particular sampling design, p ( s ). The inclusion probability of the unit
k in a sample is a random event that can be expressed using the indicator random
variable
1if k 2 S
0 otherwise
I k ¼
:
ð 1
:
6 Þ
The variable I k is called the sample membership indicator of element k , and denotes
whether the k- th element is a member of s .
The R code for generating the indicator random variable when drawing samples
of fixed size n is as follows. The most widely used R package in this field is
sampling. The reference manual can be downloaded from http://cran.r-project.
org/web/packages/sampling/sampling.pdf . In this example, we consider a popula-
tion with N ¼5 and a sample with n ¼3.
> library(sampling)
> set.seed(160964)
> n < -3
> N < -5
> indicator_matrix < - writesample(n,N)
> indicator_matrix
[,1] [,2] [,3] [,4] [,5]
[1,]
0
0
1
1
1
[2,]
0
1
0
1
1
Search WWH ::




Custom Search