prop_dom_optimal_allocation {surveyplanning} | R Documentation |
Optimal sample size allocation for proportion
Description
The function computes optimal sample size allocation over strata and domain for proportion.
Usage
prop_dom_optimal_allocation(
H,
Dom,
pop = NULL,
R = NULL,
deff = NULL,
se_max = 0.5,
prop = 0.5,
min_size = 3,
step = 1,
unit_level = TRUE,
dataset = NULL
)
Arguments
H |
The stratum variable. One dimensional object convertible to one-column |
Dom |
Variables |
used to define population domains. An object convertible to data.table
or variable names as character vector, column numbers.
pop |
The |
population size in each stratum.
R |
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 data.table
, variable name as character, or column number.
deff |
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 Yh
. Object convertible to data.table
, variable name as character vector, or column numbers.
se_max |
Variable |
for maximum standarterror (se) in domain.
prop |
The |
excepted ratio proportion.
min_size |
A |
numeric value for minimal sample size.
step |
A |
value for pace.
unit_level |
A |
logical value, if dataset is prepared for unit level then value TRUE, othercase FALSE.
dataset |
Optional |
agrregated survey data object convertible to data.table
with one row for each stratum.
Value
A list with two data objects:
datah |
An object as |
aggr_Dom |
An object as |
See Also
expsize
, optsize
, dom_optimal_allocation
Examples
library("data.table")
library("laeken")
data("eusilc")
eusilc <- data.table(eusilc)
dataset <- eusilc[, .(poph = sum(db090)), by = c("db040")]
dataset[, dom := "1"]
res <- prop_dom_optimal_allocation(H = "db040", Dom = "dom",
pop = "poph", R = NULL,
deff = NULL, se_max = 0.5,
prop = 0.5, min_size = 3,
step = 1, unit_level = FALSE,
dataset = dataset)