Tutorial 10 v2
Tutorial 10 v2
cluster sampling
1 396
= (90 + 35 + 67 + 36 + 132 + 36) = = 7.9200
8.3333 ∗ 6 49.9998
Estimate of variance:
𝑛
(𝑁 − 𝑛) 1
𝑣𝑎𝑟(𝑦̅𝑐𝑙 ) = ̅ 𝑦̅𝑐𝑙 )2
∑(𝑦𝑖. − 𝑀
̅
𝑁𝑛 𝑀 2 𝑛 − 1
𝑖=1
7.9200 ± 2 ∗ (1.7189)
[ 4.4822, 11.3578]
> y = c(90,35,67,36,132,36)
> M.vec = c(7,3,6,4,9,4)
>
> Mo=250
> N= 30
> n=length(y)
>
> ybar.c = (1/(n*(Mo/N)))*sum(y)
> ybar.c
[1] 7.92
>
> s2.c= sum((y-mean(y))^2 )/(n-1)
> var.c = ((N-n)/(N*n*(Mo/N)^2))*s2.c
> var.c
[1] 2.954496
>
> ME = 2*sqrt(var.c) #margin of error(precision of estimate)
> lower.CI= ybar.c-ME
> upper.CI= ybar.c+ME
> lower.CI; upper.CI
[1] 4.482271
[1] 11.35773
> # for finding the estimate of total?!!!!
> # when Mo is known, we can use both estimators BUT
> #check correlation between cluster means and the size of cluster
> # if low, estimator 2 is preferred, if high, estimator 1 is preferred.
> y_bar=y/M.vec
> cor(y_bar,M.vec)
[1] 0.8025784
#using the first method
> ytotal.c= Mo*ybar.c
> ytotal.c
[1] 1980
>
> var_ytotal.c= Mo^2 *var.c
> var_ytotal.c
[1] 184656
> ytotal.c= Mo*ybar.c
> ytotal.c
[1] 1980
>
> var_ytotal.c= Mo^2 *var.c
> var_ytotal.c
[1] 184656
Solution: 𝑀𝑜 = ∑𝑁
𝑖=1 𝑀𝑖 is unknown, we use estimator 2
1 7 32 4.5714
2 11 61 5.5455
3 4 25 6.25
4 5 30 6
5 8 48 6
6 6 32 5.3333
7 4 22 5.5
8 7 43 6.1429
9 9 49 5.4444
𝑛
1
𝑦̅𝑐𝑙 = ∑ 𝑦̅𝑖
𝑛
𝑖=1
1 50.7875
= (4.5714 + 5.5455 + 6.25 + 6 + 6 + 5.3333 + 5.5 + 6.1429 + 5.4444) =
9 9
= 5.6431
Estimate of variance:
𝑛
(𝑁 − 𝑛) 1
𝑣𝑎𝑟(𝑦̅𝑐𝑙 ) = ∑(𝑦𝑖 − 𝑦̅𝑐𝑙 )2
𝑁𝑛 𝑛 − 1
𝑖=1
70 − 9 1
=( ) [(4.5714 − 5.6431)2 + (5.5455 − 5.6431)2 +
70 ∗ 9 8
(6.25 − 5.6431)2 + (6 − 5.6431)2 + (6 − 5.6431)2 + (5.3333 − 5.6431)2
+ (5.5 − 5.6431)2 + (6.1429 − 5.6431)2 + (5.4444 − 5.6431)2 ]
= (0.0121) ∗ (2.186885) = 0.0265
Using above calculated estimate of variance, the standard error of mean will be
5.6431 ± 2 ∗ (0.1628)
[ 5.3175, 5.9687]
Example 10.2 and 10.3 by R are going to very similar to exercise 10.4 and 10.6, so It’s left for
students as HW