surveyplanning (version 4.0)

prop_dom_optimal_allocation: 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 data.table or variable name as character, column number.

Dom

Variables

pop

The

R

The

deff

The

se_max

Variable

prop

The

min_size

A

step

A

unit_level

A

dataset

Optional

Value

A list with two data objects:

datah

An object as data.table, with variables: H - the unit stratum variable, Dom - variables used to define population domains, poph - the population size in each stratum, Rh - the expected response rate in each stratum, deffh - the expected design effect, s2h - variance in domain of stratum, sup_cv - Variable for maximum coeficient of variation, poph - population size, nh - sample size .

aggr_Dom

An object as data.table, with variables: Dom - optional variables used to define population domains, pop_Dom - population size, sample_size_Dom - optional variables used to define population domains, sample_size - optional variables used to define population domains, pop - sample size

See Also

expsize, optsize, dom_optimal_allocation

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab