# NOT RUN {
ss4HHSm(N = 50000000, M = 3000, rho = 0.034,
mu = 10, sigma = 2, delta = 0.03, conf = 0.95,
m = c(5:15))
##################################
# Example with BigCity data #
# Sample size for the estimation #
# of the unemployment rate #
##################################
library(TeachingSampling)
data(BigCity)
BigCity1 <- BigCity %>%
group_by(HHID) %>%
summarise(IncomeHH = sum(Income),
PSU = unique(PSU))
summary(BigCity1$IncomeHH)
mean(BigCity1$IncomeHH)
sd(BigCity1$IncomeHH)
N <- nrow(BigCity)
M <- length(unique(BigCity$PSU))
rho <- ICC(BigCity1$IncomeHH, BigCity1$PSU)$ICC
mu <- mean(BigCity1$IncomeHH)
sigma <- sd(BigCity1$IncomeHH)
delta <- 0.05
conf <- 0.95
m <- c(5:15)
ss4HHSm(N, M, rho, mu, sigma, delta, conf, m)
# }
Run the code above in your browser using DataLab