Computes the variance estimation for cross-sectional and longitudinal measures for indicators on social exclusion and poverty.
vardcrospoor(
Y,
age = NULL,
pl085 = NULL,
month_at_work = NULL,
Y_den = NULL,
Y_thres = NULL,
wght_thres = NULL,
H,
PSU,
w_final,
ID_level1,
ID_level2,
Dom = NULL,
country = NULL,
period,
sort = NULL,
gender = NULL,
dataset = NULL,
X = NULL,
countryX = NULL,
periodX = NULL,
X_ID_level1 = NULL,
ind_gr = NULL,
g = NULL,
q = NULL,
datasetX = NULL,
percentage = 60,
order_quant = 50,
alpha = 20,
use.estVar = FALSE,
withperiod = TRUE,
netchanges = TRUE,
confidence = 0.95,
outp_lin = FALSE,
outp_res = FALSE,
type = "linrmpg",
checking = TRUE
)A list with objects are returned by the function:
lin_out - a data.table containing the linearized values of the ratio estimator with ID_level2 and PSU.
res_out - a data.table containing the estimated residuals of calibration with ID_level1 and PSU.
data_net_changes - a data.table containing aggregation of weighted data by period (if available), country, strata, PSU.
results - a data.table containing:
period - survey periods,
country - survey countries,
Dom - optional variable of the population domains,
type - type variable,
count_respondents - the count of respondents,
pop_size - the population size (in numbers of individuals),
estim - the estimated value,
se - the estimated standard error,
var - the estimated variance,
rse - the estimated relative standard error (coefficient of variation),
cv - the estimated relative standard error (coefficient of variation) in percentage.
Variables of interest. Object convertible to data.table or variable names as character, column numbers.
Age variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
Retirement variable (Number of months spent in retirement or early retirement). One dimensional object convertible to one-column data.table or variable name as character, column number.
Variable for total number of month at work (sum of the number of months spent at full-time work as employee, number of months spent at part-time work as employee, number of months spent at full-time work as self-employed (including family worker), number of months spent at part-time work as self-employed (including family worker)). One dimensional object convertible to one-column data.table or variable name as character, column number.
Denominator variable (for example gross individual earnings). One dimensional object convertible to one-column data.table or variable name as character, column number.
Variable (for example equalized disposable income) used for computation and linearization of poverty threshold. One dimensional object convertible to one-column data.table or variable name as character, column number or logical vector with only one TRUE value (length of the vector has to be the same as the column count of dataset). Variable specified for inc is used as income_thres if income_thres is not defined.
Weight variable used for computation and linearization of poverty threshold. One dimensional object convertible to one-column data.table or variable name as character, column number. Variable specified for weight is used as wght_thres if wght_thres is not defined.
The unit stratum variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
Primary sampling unit variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
Weight variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
Variable for level1 ID codes. One dimensional object convertible to one-column data.table or variable name as character, column number.
Optional variable for unit ID codes. One dimensional object convertible to one-column data.table or variable name as character, column number.
Optional variables used to define population domains. If supplied, variables are calculated for each domain. An object convertible to data.table or variable names as character vector, column numbers.
Variable for the survey countries. The values for each country are computed independently. Object convertible to data.table or variable names as character, column numbers.
Variable for the survey periods. The values for each period are computed independently. Object convertible to data.table or variable names as character, column numbers.
Optional variable to be used as tie-breaker for sorting. One dimensional object convertible to one-column data.table or variable name as character, column number.
Numerical variable for gender, where 1 is for males, but 2 is for females. One dimensional object convertible to one-column data.table or variable name as character, column number.
Optional survey data object convertible to data.table.
Optional matrix of the auxiliary variables for the calibration estimator. Object convertible to data.table or variable names as character, column numbers.
Optional variable for the survey countries. The values for each country are computed independently. Object convertible to data.table or variable names as character, column numbers.
Optional variable of the survey periods and countries. If supplied, residual estimation of calibration is done independently for each time period. Object convertible to data.table or variable names as character, column numbers.
Variable for level1 ID codes. One dimensional object convertible to one-column data.table or variable name as character, column number.
Optional variable by which divided independently X matrix of the auxiliary variables for the calibration. One dimensional object convertible to one-column data.table or variable name as character, column number.
Optional variable of the g weights. One dimensional object convertible to one-column data.table or variable name as character, column number.
Variable of the positive values accounting for heteroscedasticity. One dimensional object convertible to one-column data.table or variable name as character, column number.
Optional survey data object in household level convertible to data.table.
A numeric value in range \([0,100]\) for \(p\) in the formula for poverty threshold computation: $$\frac{p}{100} \cdot Z_{\frac{\alpha}{100}}.$$ For example, to compute poverty threshold equal to 60% of some income quantile, \(p\) should be set equal to 60.
A numeric value in range \([0,100]\) for \(\alpha\) in the formula for poverty threshold computation: $$\frac{p}{100} \cdot Z_{\frac{\alpha}{100}}.$$ For example, to compute poverty threshold equal to some percentage of median income, \(\alpha\) should be set equal to 50.
a numeric value in range \([0,100]\) for the order of the income quantile share ratio (in percentage).
Logical value. If value is TRUE, then R function estVar is used for the estimation of covariance matrix of the residuals. If value is FALSE, then R function estVar is not used for the estimation of covariance matrix of the residuals.
Logical value. If TRUE is value, the results is with period, if FALSE, without period.
Logical value. If value is TRUE, then produce two objects: the first object is aggregation of weighted data by period (if available), country, strata and PSU, the second object is an estimation for Y, the variance, gradient for numerator and denominator by country and period (if available). If value is FALSE, then both objects containing NULL.
Optional positive value for confidence interval. This variable by default is 0.95.
Logical value. If TRUE linearized values of the ratio estimator will be printed out.
Logical value. If TRUE estimated residuals of calibration will be printed out.
a character vector (of length one unless several.ok is TRUE), example "linarpr","linarpt", "lingpg", "linpoormed", "linrmpg", "lingini", "lingini2", "linqsr", "linarr", "linrmir".
Optional variable if this variable is TRUE, then function checks data preparation errors, otherwise not checked. This variable by default is TRUE.
Guillaume Osier, Yves Berger, Tim Goedeme, (2013), Standard error estimation for the EU-SILC indicators of poverty and social exclusion, Eurostat Methodologies and Working papers, URL https://ec.europa.eu/eurostat/documents/3888793/5855973/KS-RA-13-024-EN.PDF. Yves G. Berger, Tim Goedeme, Guillame Osier (2013). Handbook on standard error estimation and other related sampling issues in EU-SILC, URL https://wayback.archive-it.org/12090/20231228140953/https://cros-legacy.ec.europa.eu/content/handbook-standard-error-estimation-and-other-related-sampling-issues-ver-29072013_en Eurostat Methodologies and Working papers, Handbook on precision requirements and variance estimation for ESS household surveys, 2013, URL https://ec.europa.eu/eurostat/documents/3859598/5927001/KS-RA-13-029-EN.PDF
linrmir,
linarr,
vardchanges
library("data.table")
data("eusilc", package = "laeken")
setDT(eusilc)
set.seed(1)
eusilc <- eusilc[sample(x = .N, size = 3000)]
dataset1 <- data.table(rbindlist(list(eusilc, eusilc)),
year = c(rep(2010, nrow(eusilc)),
rep(2011, nrow(eusilc))))
dataset1[age < 0, age := 0]
PSU <- dataset1[, .N, keyby = "db030"][, N := NULL]
PSU[, PSU := trunc(runif(nrow(PSU), 0, 100))]
PSU[, inc := runif(.N, 20, 100000)]
dataset1 <- merge(dataset1, PSU, all = TRUE, by = "db030")
dataset1[, strata := "XXXX"]
dataset1[, pl085 := 12 * trunc(runif(.N, 0, 2))]
dataset1[, month_at_work := 12 * trunc(runif(.N, 0, 2))]
dataset1[, id_l2 := paste0("V", .I)]
vardcrospoor(Y = "inc", age = "age",
pl085 = "pl085",
month_at_work = "month_at_work",
Y_den = "inc", Y_thres = "inc",
wght_thres = "rb050",
H = "strata", PSU = "PSU",
w_final = "rb050", ID_level1 = "db030",
ID_level2 = "id_l2",
Dom = c("rb090", "db040"),
country = NULL, period = "year",
sort = NULL, gender = NULL,
dataset = dataset1,
percentage = 60,
order_quant = 50L,
alpha = 20,
confidence = 0.95,
type = "linrmpg")
Run the code above in your browser using DataLab