dom_optimal_allocation {surveyplanning} | R Documentation |
Optimal sample size allocation
Description
The function computes optimal sample size allocation over strata and domain for population.
Usage
dom_optimal_allocation(
id,
Dom,
H,
Y,
Rh = NULL,
deffh = NULL,
indicator,
sup_w,
sup_cv,
min_size = 3,
correction_before = FALSE,
dataset = NULL
)
Arguments
id |
Variable for unit ID codes. One dimensional object convertible to one-column |
Dom |
Optional variables used to define population domains. If supplied, values are calculated for each domain. An object convertible to |
H |
The unit stratum variable. One dimensional object convertible to one-column |
Y |
Variable of interest. Object convertible to |
Rh |
The expected response rate in each stratum (optional). If not defined, it is assumed to be 1 in each stratum (full-response). Object convertible to one-column |
deffh |
The expected design effect for the estimate of variable (optional). If not defined, it is assumed to be 1 for each variable in each stratum. If is defined, then variables is defined the same arrangement as |
indicator |
Variable for detection fully surveyed units. Object convertible to |
sup_w |
Variable for weight limit in domain of stratum. Object convertible to |
sup_cv |
Variable for maximum coeficient of variation (CV) in percentage for domain. Object convertible to |
min_size |
A numeric value for sample size. |
correction_before |
by default FALSE; correction of sample size is made before ending, if true, correction of sample size is made at the end. |
dataset |
Optional survey data object convertible to |
Value
A list with eights data objects:
data |
An object as |
nh_larger_then_Nh |
An object as |
dom_strata_size |
An object as |
dom_size |
An object as |
size |
An object as |
dom_strata_expected_precision |
An object as |
dom_expected_precision |
An object as |
total_expected_precision |
An object as |
See Also
expsize
, optsize
, prop_dom_optimal_allocation
Examples
library("laeken")
library("data.table")
data("ses")
data <- data.table(ses)
data[, H := paste(location, NACE1, size, sep = "_")]
data[, id := .I]
data[, full := 0]
data[, sup_cv := 10]
data[, sup_w := 20]
#vars <- dom_optimal_allocation(id = "id", dom = "sex",
# H = "H", Y = "earnings",
# indicator = "full",
# sup_w = "sup_w",
# sup_cv = "sup_cv",
# min_size = 3,
# correction_before = FALSE,
# dataset = data)
# dataset=data)
#vars