
Computes s2g and the variance estimation by the new stratification.
variance_othstr(
Y,
H,
H2,
w_final,
N_h = NULL,
N_h2,
period = NULL,
dataset = NULL,
checking = TRUE
)
Variables of interest. Object convertible to data.table
or variable names as character, column numbers or logical vector with only one TRUE
value (length of the vector has to be the same as the column count of dataset
).
The unit stratum 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 dataset
).
The unit new stratum 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 dataset
).
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 dataset
).
optional; either a data.frame
giving the first column - stratum, but the second column - the total of the population in each stratum.
optional; either a data.frame
giving the first column - new stratum, but the second column - the total of the population in each new stratum.
Optional variable for the survey periods. If supplied, the values for each period are computed independently. 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
).
Optional survey data object convertible to data.table
.
Optional variable if this variable is TRUE, then function checks data preparation errors, otherwise not checked. This variable by default is TRUE.
A list with objects are returned by the function:
betas A numeric data.table
containing the estimated coefficients of calibration.
s2g A data.table
containing the s^2g value.
var_est A data.table
containing the values of the variance estimation.
It is possible to compute population size
So the estimate of
Two conditions have to realize to estimate
Variance of
Estimate of
M. Liberts. (2004) Non-response Analysis and Bias Estimation in a Survey on Transportation of Goods by Road.
domain
, lin.ratio
, linarpr
,
linarpt
, lingini
, lingini2
,
lingpg
, linpoormed
, linqsr
,
linrmpg
, residual_est
, vardom
,
vardom_othstr
, vardomh
, varpoord
# NOT RUN {
library("data.table")
Y <- data.table(matrix(runif(50) * 5, ncol = 5))
H <- data.table(H = as.integer(trunc(5 * runif(10))))
H2 <- data.table(H2 = as.integer(trunc(3 * runif(10))))
N_h <- data.table(matrix(0 : 4, 5, 1))
setnames(N_h, names(N_h), "H")
N_h[, sk:= 10]
N_h2 <- data.table(matrix(0 : 2, 3, 1))
setnames(N_h2, names(N_h2), "H2")
N_h2[, sk2:= 4]
w_final <- rep(2, 10)
vo <- variance_othstr(Y = Y, H = H, H2 = H2,
w_final = w_final,
N_h = N_h, N_h2 = N_h2,
period = NULL,
dataset = NULL)
vo
# }
Run the code above in your browser using DataLab