0% found this document useful (0 votes)
369 views4 pages

STA632 Assignment Solution by Pin

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
369 views4 pages

STA632 Assignment Solution by Pin

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

STA632 Assignment Solution By Pin✌️.

Spring 2024

Answer:1

To estimate the Mean Square Error (MSE) of the ratio estimator Y^R\hat{Y}_RY^R for the area
under paddy harvested with combine in the entire district, we can use the following formula:

MSE(Y^R)≈N−nNn(∑i=1n(yi−Rxi)2n−1)\text{MSE}(\hat{Y}_R) \approx \frac{N - n}{Nn} \


left(\frac{\sum_{i=1}^n (y_i - R x_i)^2}{n - 1}\right)MSE(Y^R)≈NnN−n(n−1∑i=1n(yi−Rxi)2)

where:

● NNN is the total number of villages in the district.


● nnn is the number of sampled villages.
● xix_ixi is the area under paddy in the iii-th village.
● yiy_iyi is the area harvested with combine in the iii-th village.
● R=∑i=1nyi∑i=1nxiR = \frac{\sum_{i=1}^n y_i}{\sum_{i=1}^n x_i}R=∑i=1nxi∑i=1nyi
is the ratio of the total area harvested with combine to the total area under paddy in the
sampled villages.

Given data:

● N=420N = 420N=420
● n=18n = 18n=18

Let's calculate the ratio RRR and then the MSE.

First, calculate the total area under paddy (∑xi\sum x_i∑xi) and the total area harvested with
combine (∑yi\sum y_i∑yi) for the sampled villages.

Then, use these totals to find RRR.

Finally, compute the MSE using the provided formula.

Let's perform these calculations step by step.

The ratio RRR of the total area harvested with combine to the total area under paddy in the
sampled villages is approximately 0.8820.8820.882.

The estimated Mean Square Error (MSE) of the ratio estimator Y^R\hat{Y}_RY^R is
approximately 62.50362.50362.503.
Answer 2

To tackle this problem, we need to follow the given steps for both parts:

Part a) Simple Random Sampling with Replacement (SRSWR)

1. Generate all possible samples of size two under SRSWR:

Given data:

Yi Zi

0.16 1

0.22 2

0.13 3

0.25 4

0.14 5

0.10 6

Here, Yi represents the variable of interest and Zi represents the size measure.

Under SRSWR, each element can be chosen more than once. The possible samples of size two
are:

(0.16, 0.16), (0.16, 0.22), (0.16, 0.13), (0.16, 0.25), (0.16, 0.14), (0.16, 0.10),

(0.22, 0.16), (0.22, 0.22), (0.22, 0.13), (0.22, 0.25), (0.22, 0.14), (0.22, 0.10),

(0.13, 0.16), (0.13, 0.22), (0.13, 0.13), (0.13, 0.25), (0.13, 0.14), (0.13, 0.10),

(0.25, 0.16), (0.25, 0.22), (0.25, 0.13), (0.25, 0.25), (0.25, 0.14), (0.25, 0.10),

(0.14, 0.16), (0.14, 0.22), (0.14, 0.13), (0.14, 0.25), (0.14, 0.14), (0.14, 0.10),

(0.10, 0.16), (0.10, 0.22), (0.10, 0.13), (0.10, 0.25), (0.10, 0.14), (0.10, 0.10)

2. Calculate the Hansen-Hurwitz Estimator:

The Hansen-Hurwitz estimator for a sample y1,y2,…,yny_1, y_2, \ldots, y_ny1,y2,…,yn taken
with replacement is given by: Y^HH=1n∑i=1nyipi\hat{Y}_{HH} = \frac{1}{n} \sum_{i=1}^n \
frac{y_i}{p_i}Y^HH=n1∑i=1npiyi where pip_ipi is the probability of selecting the iii-th unit.

Since the sampling is with replacement, the probability of selecting any unit is equal, i.e.,
pi=1Np_i = \frac{1}{N}pi=N1 where NNN is the total number of units.
For our case, n=2n = 2n=2 and N=6N = 6N=6, so pi=16p_i = \frac{1}{6}pi=61.

The Hansen-Hurwitz estimator for each sample can be calculated as:


Y^HH=12(6y1+6y2)=3(y1+y2)\hat{Y}_{HH} = \frac{1}{2} \left( 6 y_1 + 6 y_2 \right) = 3
(y_1 + y_2)Y^HH=21(6y1+6y2)=3(y1+y2)

3. Find its variance:

The variance of the Hansen-Hurwitz estimator is given by: Var(Y^HH)=1n2(1pi−1)∑i=1nyi2\


text{Var}(\hat{Y}_{HH}) = \frac{1}{n^2} \left( \frac{1}{p_i} - 1 \right) \sum_{i=1}^n
y_i^2Var(Y^HH)=n21(pi1−1)∑i=1nyi2

For our case, since n=2n = 2n=2 and pi=16p_i = \frac{1}{6}pi=61:


Var(Y^HH)=14(6−1)∑i=12yi2=54∑i=12yi2\text{Var}(\hat{Y}_{HH}) = \frac{1}{4} \left( 6 - 1
\right) \sum_{i=1}^2 y_i^2 = \frac{5}{4} \sum_{i=1}^2 y_i^2Var(Y^HH)=41(6−1)∑i=12yi2
=45∑i=12yi2

Part b) Probability Proportional to Size (PPS) Sampling

To implement this in R:

1. Select 10,000 samples with replacement using PPS sampling.


2. Calculate the mean of each sample.
3. Determine the mean of these means.

Here is the R code to accomplish this:

# Define the data

data <- data.frame(

Yi = c(0.16, 0.22, 0.13, 0.25, 0.14, 0.10),

Zi = c(1, 2, 3, 4, 5, 6)

# Number of samples

num_samples <- 10000

# Initialize vector to store means

sample_means <- numeric(num_samples)


# Set seed for reproducibility

set.seed(123)

# Perform PPS sampling with replacement

for (i in 1:num_samples) {

sample_indices <- sample(1:nrow(data), size=2, replace=TRUE, prob=data$Zi)

sample_values <- data$Yi[sample_indices]

sample_means[i] <- mean(sample_values)

# Calculate the mean of these means

mean_of_means <- mean(sample_means)

# Print the result

mean_of_means

In the code above:

● We define the data.


● We specify the number of samples.
● We initialize a vector to store the means of the samples.
● We use the sample function with prob parameter to perform PPS sampling with
replacement.
● We calculate the mean of each sample and store it in sample_means.
● Finally, we calculate the mean of these means.

By running this code, you will get the mean of the means of the samples selected using PPS
sampling.

You might also like