Learn R Programming

vardpoor (version 0.6.2)

vardchangespoor: Variance estimation for measures of change for sample surveys for indicators on social exclusion and poverty

Description

Computes the variance estimation for measures of change for indicators on social exclusion and poverty.

Usage

vardchangespoor(Y, 
                     age=NULL,
                     pl085 = NULL,
                     month_at_work = NULL,
                     Y_den = NULL,
                     Y_thres = NULL,
                     wght_thres = NULL,
                     H, PSU, w_final, id,
                     Dom = NULL, 
                     country, periods,
                     sort=NULL,
                     gender = NULL,
                     percentage=60,
                     order_quant=50,
                     alpha = 20,
                     dataset = NULL,
                     period1, period2,
                     use.estVar = FALSE,
                     confidence=0.95,
                     type="linrmpg",
                     change_type="absolute")

Arguments

Y
Study variable (for example equalized disposable income or gross pension income). One dimensional object convertible to one-column data.table or variable name as character, column number.
age
Age variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
pl085
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.
month_at_work
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
Y_den
Denominator variable (for example gross individual earnings). One dimensional object convertible to one-column data.table or variable name as character, column number.
Y_thres
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. Variable specified for <
wght_thres
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
H
The unit stratum variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
PSU
Primary sampling unit variable. One dimensional object convertible to one-column data.table or variable name as character, column number.
w_final
Weight variable. 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
id
variable for unit ID codes (for household surveys - secondary unit id number). One dimensional object convertible to one-column data.table or variable name as character, column number.
Dom
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.
country
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.
periods
Variable for the all survey periods. The values for each period are computed independently. Object convertible to data.table or variable names as character, column numbers.
sort
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.
gender
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.
percentage
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.
order_quant
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
alpha
a numeric value in range $[0,100]$ for the order of the income quantile share ratio (in percentage).
dataset
Optional survey data object convertible to data.frame.
period1
The vector from variable periods describes the first period.
period2
The vector from variable periods describes the second period.
use.estVar
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
confidence
optional; either a positive value for confidence interval. This variable by default is 0.95.
type
a character vector (of length one unless several.ok is TRUE), example "linarpr","linarpt", "lingpg", "linpoormed", "linrmpg", "lingini", "lingini2", "linqsr", "linarr", "linrmir", "all_choices".
change_type
character value net changes type - absolute or relative.

Value

  • A list with objects are returned by the function:
  • crossectional_resultsA 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.
  • changes_resultsA data.table containing: period - survey periods, country - survey countries, Dom - optional variable of the population domains, type - type variable, estim_1 - the estimated value for period1, estim_2 - the estimated value for period2, 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.

References

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 http://ec.europa.eu/eurostat/documents/3888793/5855973/KS-RA-13-024-EN.PDF. Eurostat Methodologies and Working papers, Handbook on precision requirements and variance estimation for ESS household surveys, 2013, URL http://ec.europa.eu/eurostat/documents/3859598/5927001/KS-RA-13-029-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://ec.europa.eu/eurostat/cros/content/handbook-standard-error-estimation-and-other-related-sampling-issues-ver-29072013_en

See Also

domain, vardchanges, vardcros, vardcrospoor

Examples

Run this code
### Example 

data(eusilc)
set.seed(1)

data <- data.table(rbind(eusilc, eusilc),
                   year=c(rep(2010, nrow(eusilc)),
                          rep(2011, nrow(eusilc))),
                   country=c(rep("AT", nrow(eusilc)),
                             rep("AT", nrow(eusilc))))
data[age<0, age:=0]
PSU <- data[,.N, keyby="db030"]
PSU[, N:=NULL]
PSU[, PSU:=trunc(runif(nrow(PSU), 0, 100))]
PSU$inc <- runif(nrow(PSU), 20, 100000)
setkeyv(PSU, "db030")
setkeyv(data, "db030")
data <- merge(data, PSU, all=TRUE)
PSU <- eusilc <- NULL
data[, strata:=c("XXXX")]
data[, strata:=as.character(strata)]
data$pl085 <- 12*trunc(runif(nrow(data),0,2))
data$month_at_work <- 12*trunc(runif(nrow(data),0,2))

result <- vardchangespoor(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=NULL, Dom = c("rb090"),
                     country="country", periods="year",
                     sort=NULL, gender = NULL,
                     percentage=60, order_quant=50,
                     alpha = 20, dataset = data,
                     period1=c(2010, 2011),
                     period2=c(2011, 2010),
                     confidence=0.95,
                     type="linrmpg")

Run the code above in your browser using DataLab