data(eusilc)
# overall value
prop("rb090", weights = "rb050", data = eusilc)
# values by region
p1 <- prop("rb090", weights = "rb050",
breakdown = "db040", cluster = "db030",
data = eusilc)
p1
if (FALSE) {
variance("rb090", weights = "rb050",
breakdown = "db040", data = eusilc, indicator=p1,
cluster="db030", X = calibVars(eusilc$db040))
}
eusilc$agecut <- cut(eusilc$age, 2)
p1 <- prop("agecut", weights = "rb050",
breakdown = "db040",
cluster="db030", data = eusilc)
p1
if (FALSE) {
variance("agecut", weights = "rb050",
breakdown = "db040", data = eusilc, indicator=p1,
X = calibVars(eusilc$db040), cluster="db030")
}
eusilc$eqIncomeCat <- factor(ifelse(eusilc$eqIncome < quantile(eusilc$eqIncome,0.2), "one", "two"))
p1 <- prop("eqIncomeCat", weights = "rb050",
breakdown = "db040", data = eusilc, cluster="db030")
p1
if (FALSE) {
variance("eqIncomeCat", weights = "rb050",
breakdown = "db040", data = eusilc, indicator=p1,
X = calibVars(eusilc$db040), cluster="db030")
}
Run the code above in your browser using DataLab