Professional Documents
Culture Documents
Assignment
Assignment
2 (Course STA632)
BC220417996
SPRING 2023 (Total Marks 10)
Write R-program for computing estimate of population mean by probability proportional to size
(PPS) sampling from the following population with k=1000.
1 2 3 4 5 6
# Population data
# Population size
k <- 1000
# Number of samples
n <- 100
print(estimated_mean)
Question 2: Mark: 5
Calculate expected value for the ratio and product estimator using the following information.
Unit
1,2 11 5
1,3 13 9
2,3 16 2.4
2,4 24 9
3,4 35 24
# Data
data <- matrix(c(11, 5, 13, 9, 12.5, 7.6, 16, 2.4, 24, 9, 35, 24), ncol = 2, byrow = TRUE)
# Calculate ratios
ratios <- data[, 1] / data[, 2]
# Calculate products
products <- data[, 1] * data[, 2]