# NOT RUN {
### Example
data("eusilc")
set.seed(1)
eusilc1 <- eusilc[1 : 100,]
set.seed(1)
require(data.table)
datas <- data.table(rbind(eusilc1, eusilc1),
year = c(rep(2010, nrow(eusilc1)),
rep(2011, nrow(eusilc1))))
PSU <- datas[, .N, keyby = "db030"][, N:= NULL]
PSU[, PSU:= trunc(runif(nrow(PSU), 0, 5))]
datas <- merge(datas, PSU, all = TRUE, by = "db030")
datas[, strata := c("XXXX")]
datas[, calc := trunc(runif(nrow(datas), 0, 2))]
datas[, id_lv2 := paste0("V", .I)]
# }
# NOT RUN {
result <- vardchangstrs(Y = "calc", H = "strata",
PSU = "PSU", w_final = "rb050",
ID_level1 = "db030", ID_level1 = "id_lv2",
periods = "year", dataset = datas,
periods1 = 2010, periods2 = 2011,
percentratio = 100, confidence = 0.95)
# }
Run the code above in your browser using DataLab