Learn R Programming

vardpoor (version 0.2.0.8.1)

vardom: Variance estimation of the sample surveys in domain by the ultimate cluster method

Description

Computes the variance estimation in domain.

Usage

vardom(Y, H, PSU, w_final, id=NULL, Dom = NULL, 
       N_h = NULL, fh_zero=FALSE, PSU_level = TRUE, Z = NULL,
       X = NULL, ind_gr = NULL, g = NULL,  dataset = NULL, 
       q = rep(1, if (is.null(dataset)) nrow(data.frame(X)) else nrow(dataset)),
       confidence = .95, outp_lin=FALSE, outp_res=FALSE)

Arguments

Y
either a numeric data.frame, matrix, data.table with column names giving the variables of interest, or (if dataset is not NULL) a character string, an integer or a logical vector (length is the same as 'dataset' column
H
either 1 column data.frame, matrix, data.table with column name giving elements indicating the unit stratum, or (if dataset is not NULL) a character string, an integer or a logical vector (length is the same as 'dataset
PSU
either 1 column data.frame, matrix, data.table giving primary sampling unit, or (if dataset is not NULL) a character string, an integer or a logical vector (length is the same as 'dataset' column count) specifying the co
w_final
either a numeric vector, 1 column data.frame, matrix, data.table giving the final weights, or (if dataset is not NULL) a character string, an integer or a logical vector (length is the same as 'dataset' column count) sp
id
optional; either 1 column data.frame, matrix, data.table with column names giving the IDs, or (if dataset is not NULL) a character string, an integer or a logical vector (length is the same as 'dataset' column count)
Dom
optional; either a data.frame, matrix, data.table with column names giving different domains, or (if dataset is not NULL) character strings, integers or a logical vectors (length is the same as 'dataset' column count) sp
N_h
optional; either a matrix giving the first column - stratum, but the second column - the total of the population in each stratum.
fh_zero
by default FALSE; fh is calculated as division of n_h and N_h in each strata, if true, fh value is zero in each strata.
PSU_level
by default TRUE; if PSU_level is true, in each strata fh is calculated as division of count of PSU in sample (n_h) and count of PSU in frame(N_h). if PSU_level is false, in each strata fh is calculated as division of count of units in sample (n_
Z
optional; either a data.frame, matrix, data.table with column names giving variables of denominator, or (if dataset is not NULL) character strings, integers or a logical vectors (length is the same as 'dataset' column co
X
optional; either a data.frame, matrix, data.table giving auxiliary variables, or (if dataset is not NULL) character strings, integers or a logical vectors (length is the same as 'dataset' column count) specifying the cor
ind_gr
optional; either a vector, 1 column data.frame, matrix, data.table giving the variable by which divided independently auxiliary variables, or (if dataset is not NULL) a character string, an integer or a logical vector
g
optional; either a numeric vector, 1 column data.frame, matrix, data.table giving the g weights, or (if dataset is not NULL) a character string, an integer or a logical vector (length is the same as 'dataset' column cou
q
optional; either a numeric vector, 1 column data.frame, matrix, data.table giving the positive values accounting for heteroscedasticity, or (if dataset is not NULL) a character string, an integer or a logical vector (le
dataset
an optional; name of the individual dataset data.frame.
confidence
optional; either a positive value for confidence interval. This variable by default is 0.95 .
outp_lin
logical. if TRUE linearized values of the ratio estimator will be printed out
outp_res
logical. if TRUE estimated residuals of calibration will be printed out

Value

  • The function returns values:
  • estima data.table containing the estimation(s) by domain, or (if Dom is NULL) totals.
  • vara data.table containing the values of the variance estimation by domains or (if Dom is NULL) totals.
  • sea data.table containing the values of the standart error by domains or (if Dom is NULL) totals.
  • rsea data.table containing the values of the relative standart error (coefficient of variation) by domains or (if Dom is NULL) totals in percentage.
  • cva data.table containing the values of the relative standart error (coefficient of variation) by domains or (if Dom is NULL) totals.
  • absolute_margin_of_errora data.table containing the values of the absolute margin of error by domains or (if Dom is NULL) totals.
  • relative_margin_of_errora data.table containing the values of the relative margin of error by domains or (if Dom is NULL) totals.
  • CI_lowera data.table containing the values of the confidence interval lower bound by domains or (if Dom is NULL) totals.
  • CI_uppera data.table containing the values of the confidence interval upper bound by domains or (if Dom is NULL) totals.
  • var_srs_HTa matrix containing the values of the variance estimation of HT estimator under SRS by domains or (if Dom is NULL) totals.
  • var_cur_HTa matrix containing the values of the variance estimation of HT estimator under HT estimator under current design by domains or (if Dom is NULL) totals.
  • var_srs_caa matrix containing the values of the variance estimation of calibrated estimator under SRS by domains or (if Dom is NULL) totals.
  • deff_sama matrix containing the values of the estimation of the design effect of sample design by domains or (if Dom is NULL) totals.
  • deff_esta matrix containing the values of the estimation of the design effect of estimator by domains or (if Dom is NULL) totals.
  • deffa matrix containing the values of the estimation of the overall design effect of sample design and estimator by domains or (if Dom is NULL) totals.
  • lin_outa data.table containing the linearized values of the ratio estimator with id and PSU.
  • res_outa data.table containing the estimated residuals of calibration with id and PSU.
  • all_resulta data.frame containing all previosly definited values together by domains or (if Dom is NULL) totals.

Details

Calculate variance estimation on domains based on G. Osier documents.

References

Yves G. Berger, Tim Goedeme, Guillame Osier (2013). Handbook on standard error estimation and other related sampling issues in EU-SILC, URL http://www.cros-portal.eu/content/handbook-standard-error-estimation-and-other-related-sampling-issues-ver-29072013 Guillaume Osier and Emilio Di Meglio. The linearisation approach implemented by Eurostat for the first wave of EU-SILC: what could be done from the second wave onwards? 2012 Deville, J. C. (1999). Variance estimation for complex statistics and estimators: linearization and residual techniques. Survey Methodology, 25, 193-203, URL http://www5.statcan.gc.ca/bsolc/olc-cel/olc-cel?lang=eng&catno=12-001-X19990024882.

See Also

domain, lin.ratio, residual_est, vardomh, var_srs, variance_est, variance_othstr

Examples

Run this code
data(eusilc)
dataset <- data.frame(1:nrow(eusilc),eusilc)
colnames(dataset)[1] <- "IDd"

aa<-vardom("eqIncome", H="db040", PSU="db030", w_final="rb050",
           id="db030", Dom = "db040", N_h=NULL, Z = NULL,
           X = NULL, g = NULL, dataset = dataset,
           q = rep(1, if (is.null(dataset)) 
                       nrow(as.data.frame(H)) else nrow(dataset)),
           confidence = .95, outp_lin=TRUE, outp_res=TRUE)

Run the code above in your browser using DataLab