Proportion of an alternative distribution
Estimate the proportion of an alternative distribution.
prop(bin, weights = NULL, sort = NULL, years = NULL, breakdown = NULL, design = NULL, cluster = NULL, data = NULL, var = NULL, alpha = 0.05, na.rm = FALSE, ...)
bin |
either a factor vector giving the values,
or (if |
weights |
optional; either a numeric vector giving the personal sample
weights, or (if |
sort |
optional; either a numeric vector giving the personal IDs to be
used as tie-breakers for sorting, or (if |
years |
optional; either a numeric vector giving the different years of
the survey, or (if |
breakdown |
optional; either a numeric vector giving different domains,
or (if |
design |
optional and only used if |
cluster |
optional and only used if |
data |
an optional |
var |
a character string specifying the type of variance estimation to
be used, or |
alpha |
numeric; if |
na.rm |
a logical indicating whether missing values should be removed. |
... |
if |
If weights are provided, the weighted proportion is estimated.
A list of class "prop"
(which inherits from the class
"indicator"
) with the following components:
value |
a numeric vector containing the overall value(s). |
valueByStratum |
a |
varMethod |
a character string specifying the type of variance
estimation used, or |
var |
a numeric vector containing the variance estimate(s), or
|
varByStratum |
a |
ci |
a numeric vector or matrix containing the lower and upper
endpoints of the confidence interval(s), or |
ciByStratum |
a |
alpha |
a numeric value giving the significance level used for
computing the confidence interval(s) (i.e., the confidence level is 1 -
|
years |
a numeric vector containing the different years of the survey. |
strata |
a character vector containing the different domains of the breakdown. |
Matthias Templ, using code for breaking down estimation by Andreas Alfons
A. Alfons and M. Templ (2013) Estimation of Social Exclusion Indicators from Complex Surveys: The R Package laeken. Journal of Statistical Software, 54(15), 1–25. URL http://www.jstatsoft.org/v54/i15/
Working group on Statistics on Income and Living Conditions (2004) Common cross-sectional EU indicators based on EU-SILC; the gender pay gap. EU-SILC 131-rev/04, Eurostat, Luxembourg.
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 ## Not run: variance("rb090", weights = "rb050", breakdown = "db040", data = eusilc, indicator=p1, cluster="db030", X = calibVars(eusilc$db040)) ## End(Not run) eusilc$agecut <- cut(eusilc$age, 2) p1 <- prop("agecut", weights = "rb050", breakdown = "db040", cluster="db030", data = eusilc) p1 ## Not run: variance("agecut", weights = "rb050", breakdown = "db040", data = eusilc, indicator=p1, X = calibVars(eusilc$db040), cluster="db030") ## End(Not run) 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 ## Not run: variance("eqIncomeCat", weights = "rb050", breakdown = "db040", data = eusilc, indicator=p1, X = calibVars(eusilc$db040), cluster="db030") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.