A simple random sample is an individual being chosen randomly from the population. In this setting, a group instead of a individual is being chosen.
The combination of the two sample is predetermined. There is no chance for A and D being selected together and same goes for B and C.
population <- c(1,5,6,8,8,15)
samples <- t(merge(population, population))
samples
## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
## x 1 5 6 8 8 15 1 5 6 8 8 15 1
## y 1 1 1 1 1 1 5 5 5 5 5 5 6
## [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25]
## x 5 6 8 8 15 1 5 6 8 8 15 1
## y 6 6 6 6 6 8 8 8 8 8 8 8
## [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35] [,36]
## x 5 6 8 8 15 1 5 6 8 8 15
## y 8 8 8 8 8 15 15 15 15 15 15
means <- data.frame(sample_means = colMeans(samples))
hist(means$sample_means, main = "", xlab = "Sample Means", prob = T, col = "darkred")
lines(density(means$sample_means), col = "darkblue", lwd = 2)
abline(v=mean(means$sample_means), col="black")
q2 <- c(mean(population), mean(means$sample_means))
names(q2) <- c("Population Mean", "Sample Mean")
q2
## Population Mean Sample Mean
## 7.166667 7.166667
pnorm(q = 3, mean = 3.10, sd = 0.40 / sqrt(16), lower.tail = FALSE)
## [1] 0.8413447
qnorm(p = .85, mean = 3.10, sd = 0.40 / sqrt(16))
## [1] 3.203643
qnorm(p = .85, mean = 3.10, sd = 0.40 / sqrt(64))
## [1] 3.151822
n <- 200
se <- sqrt(0.15*(1 - 0.15)/n)
mu <- 0.15
pnorm(q = 0.15, mean = mu, sd = se)
## [1] 0.5
n <- 200
se <- sqrt(0.15*(1 - 0.15)/n)
mu <- 0.15
pnorm(q = 0.17, mean = mu, sd = se) - pnorm(q = 0.13, mean = mu, sd = se)
## [1] 0.5717081
p <- 303/326
z_value <- qnorm(p = .975)
se <- sqrt(p * (1 - p) / 326)
CI <- p + c(-1, 1) * z_value * se
CI
## [1] 0.9016503 0.9572454
We are 95% confident that the true percentage of people finding ringing cell phones disturb business presentations in the population is between 90.2% and 95.7%.
Although the interval from 0.9016503 to 0.9572454 may or may not contain the true proportion, 95% of intervals formed from samples of size 326 in this manner will contain the true proportion.
p <- 303/326
e <- 0.04
z_value <- qnorm(p = .975)
n <- p * (1 - p) / (e/z_value)^2
ceiling(n)
## [1] 158
x_bar <- 0.995
sigma <- 0.02
z_value <- qnorm(p = 0.995)
n <- 50
x_bar + c(-1, 1) * z_value * sigma/sqrt(n)
## [1] 0.9877145 1.0022855
No. The confidence interval contains the value 1; we are 95% confident that the true average volume of the paints is within this interval. Since the value 1 is within this interval, we do not complain.
No. According to Central Limit Therom, regardless the population distribution, as long as we have a large sample size, the sample distribution will approach normal.
sigma <- 25
e <- 4
z_value <- qnorm(p = 0.995)
n <- (sigma / (e/z_value))^2
ceiling(n)
## [1] 260