estr_tamanho_amostra: Sample size for stratified sampling: automatic formula...

View source: R/cap04-estratificada-tamanho.R

estr_tamanho_amostraR Documentation

Sample size for stratified sampling: automatic formula selection (umbrella)

Description

Convenience "umbrella" function analogous to aas_tamanho_amostra(): accepts every input potentially relevant to a stratified sample-size problem and dispatches to estr_tamanho_media() or estr_tamanho_proporcao() depending on parametro, ignoring whichever inputs are not needed.

Usage

estr_tamanho_amostra(
  parametro = c("media", "proporcao"),
  Nk,
  sigmak2 = NULL,
  pk = NULL,
  d,
  conf = 0.95,
  ck = NULL,
  alocacao = c("proporcional", "neyman", "custo", "nenhuma"),
  arredondar = c("cima", "proximo"),
  ...
)

Arguments

parametro

Either "media" or "proporcao".

Nk

Numeric vector with the population size of each stratum.

sigmak2

Numeric vector with the population variance of each stratum.

pk

Numeric vector with the population proportion of each stratum (used only when parametro = "proporcao").

d

Tolerable margin of error.

conf

Confidence level, default 0.95.

ck

Optional numeric vector with the sampling cost per unit in each stratum. If supplied, the cost-based formula (Eq. 4.8) is used; otherwise the standard formula (Eq. 4.5) is used.

alocacao

How to allocate n across strata once computed: "proporcional" (default), "neyman", "custo" (requires ck), or "nenhuma" (only the total n is returned).

arredondar

Either "cima" (default, always round up – the conventional, conservative practice) or "proximo" (round to the nearest integer, reproducing the course notes' worked examples, which use a 2-decimal critical value and round to the nearest integer).

...

Ignored. Any other variables from a broader problem statement may be passed here without causing an error.

Value

A sampling_result object, as produced by estr_tamanho_media() or estr_tamanho_proporcao().

Examples

estr_tamanho_amostra(parametro = "media", Nk = c(1540, 770, 385),
                      sigmak2 = c(7, 9, 11), d = 0.5)

sampleone documentation built on Oct. 13, 2026, 5:07 p.m.