Description Usage Arguments Value See Also Examples
View source: R/prop_dom_optimal_allocation.R
The function computes optimal sample size allocation over strata and domain for proportion.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
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.
A list with two data objects:
datah |
An object as |
aggr_Dom |
An object as |
expsize, optsize, dom_optimal_allocation
1 2 3 4 5 6 7 8 9 10 11 12 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.