aas_tamanho_proporcao: Sample size to estimate a population proportion (AAS)

View source: R/cap03-aas.R

aas_tamanho_proporcaoR Documentation

Sample size to estimate a population proportion (AAS)

Description

Computes the sample size needed to estimate a population proportion with a given margin of error, using the infinite/unknown-population formula (Eq. 3.23, or the conservative Eq. 3.24 when p is unknown) or the finite-population formula (Eq. 3.45) when N is supplied.

Usage

aas_tamanho_proporcao(
  p = NULL,
  d,
  conf = 0.95,
  N = NULL,
  perda = 0,
  arredondar = c("cima", "proximo"),
  ...
)

Arguments

p

Expected proportion. If NULL, the conservative value p = 0.5 is used (maximises p(1-p)), following Eq. (3.24).

d

Tolerable margin of error (same units as the variable).

conf

Confidence level, default 0.95.

N

Optional population size. If NULL or Inf, the infinite/unknown-population formula (3.15) is used; otherwise the finite-population formula (3.37) is used (cross-checked internally against the algebraically equivalent Eq. 3.38).

perda

Optional flat safety-margin proportion (e.g. 0.25 for a 25% buffer), applied via aas_ajustar_perdas() to inflate the raw sample size (n * (1 + perda), following Example 3.14 of the course notes). Not to be confused with a formal response-rate adjustment (dividing by an expected response rate, Section 4.7.2).

arredondar

Either "cima" (the default – always round up, the conventional, conservative practice in sampling theory, e.g. Cochran 1977) or "proximo" (round to the nearest integer). The course notes round to the nearest integer using a 2-decimal critical value (z = 1.96/1.64); use arredondar = "proximo" together with a matching conf to reproduce the worked examples exactly.

...

Ignored (see package overview on tolerated extra arguments).

Value

A sampling_result object with the required sample size.

References

Cochran, W.G. (1977). Sampling Techniques, 3rd ed. Wiley.

Examples

aas_tamanho_proporcao(p = 0.6, d = 0.03, conf = 0.95)
aas_tamanho_proporcao(d = 0.05, conf = 0.95) # p desconhecido -> conservador

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