Computes the variance estimation for sample surveys in domain by the two stratification.
1 2 3 4 5 6 
Y 
Variables of interest. Object convertible to 
H 
The unit stratum variable. One dimensional object convertible to onecolumn 
H2 
The unit new stratum variable. One dimensional object convertible to onecolumn 
PSU 
Primary sampling unit variable. One dimensional object convertible to onecolumn 
w_final 
Weight variable. One dimensional object convertible to onecolumn 
id 
Optional variable for unit ID codes. One dimensional object convertible to onecolumn 
Dom 
Optional variables used to define population domains. If supplied, linearization of the atriskofpoverty rate is done for each domain. An object convertible to 
period 
Optional variable for survey period. If supplied, residual estimation of calibration is done independently for each time period. One dimensional object convertible to onecolumn 
N_h 
optional data object convertible to 
N_h2 
optional data object convertible to 
Z 
optional variables of denominator for ratio estimation. Object convertible to 
X 
Optional matrix of the auxiliary variables for the calibration estimator. Object convertible to 
g 
Optional variable of the g weights. One dimensional object convertible to onecolumn 
q 
Variable of the positive values accounting for heteroscedasticity. One dimensional object convertible to onecolumn 
dataset 
Optional survey data object convertible to 
confidence 
Optional positive value for confidence interval. This variable by default is 0.95. 
percentratio 
Positive numeric value. All linearized variables are multiplied with 
outp_lin 
Logical value. If 
outp_res 
Logical value. If 
A list with objects are returned by the function:
lin_out 
A 
res_out 
A 
s2g 
A 
all_result 
A

JeanClaude Deville (1999). Variance estimation for complex statistics
and estimators: linearization and residual techniques. Survey
Methodology, 25, 193203, URL http://www.statcan.gc.ca/pub/12001x/1999002/article/4882eng.pdf.
M. Liberts. (2004) Nonresponse Analysis and Bias Estimation in a Survey on Transportation of Goods by Road.
domain
, lin.ratio
, residual_est
,
vardomh
, var_srs
, variance_est
,
variance_othstr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  data(eusilc)
# Example 1
eusilc1 < eusilc[1:1000, ]
dataset < data.table(IDd = paste0("V", 1:nrow(eusilc1)), eusilc1)
dataset[, db040_2 := get("db040")]
N_h2 < dataset[, sum(rb050, na.rm = FALSE), keyby = "db040_2"]
aa<vardom_othstr(Y = "eqIncome", H = "db040", H2 = "db040_2",
PSU = "db030", w_final = "rb050", id = "rb030",
Dom = "db040", period = NULL, N_h = NULL,
N_h2 = N_h2, Z = NULL, X = NULL, g = NULL,
q = NULL, dataset = dataset, confidence = .95,
outp_lin = TRUE, outp_res = TRUE)
## Not run:
# Example 2
dataset < data.table(IDd = 1:nrow(eusilc), eusilc)
dataset[, db040_2 := get("db040")]
N_h2 < dataset[, sum(rb050, na.rm = FALSE), keyby = "db040_2"]
aa < vardom_othstr(Y = "eqIncome", H = "db040", H2 = "db040_2",
PSU = "db030", w_final = "rb050", id = "rb030",
Dom = "db040", period = NULL, N_h2 = N_h2,
Z = NULL, X = NULL, g = NULL, dataset = dataset,
q = NULL, confidence = .95, outp_lin = TRUE,
outp_res = TRUE)
## End(Not run)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.