padronizar_idade: Directly standardize rates by age

View source: R/analytics.R

padronizar_idadeR Documentation

Directly standardize rates by age

Description

Calculates a weighted average of age-specific rates using a supplied standard population. Independent Poisson counts are assumed for the standard error. Optional confidence limits use a normal approximation.

Usage

padronizar_idade(
  eventos,
  populacao,
  idade,
  populacao_padrao,
  grupo = NULL,
  multiplicador = 1e+05,
  confianca = NULL,
  na_rm = FALSE
)

Arguments

eventos

Non-negative event counts by age stratum.

populacao

Positive population or person-time by age stratum.

idade

Age-stratum labels.

populacao_padrao

Standard population weights. Supply either one value per input row or a named vector whose names match 'idade'.

grupo

Optional analysis group, such as year or municipality. Each age stratum must occur at most once within a group.

multiplicador

Scale of the standardized rate, default 100,000.

confianca

Optional confidence level. 'NULL' omits confidence limits.

na_rm

Whether incomplete age strata should be removed and the remaining standard weights renormalized.

Value

A data frame with standardized rate, standard error, confidence limits, number of strata and proportion of standard weight represented.

References

Ahmad OB et al. (2001). Age standardization of rates: a new WHO standard. World Health Organization.

Examples

padronizar_idade(
  eventos = c(10, 40),
  populacao = c(1000, 1000),
  idade = c("0-49", "50+"),
  populacao_padrao = c("0-49" = 800, "50+" = 200)
)

datasus documentation built on Oct. 7, 2026, 1:07 a.m.