razao_estima_media: Ratio estimator of the population mean

View source: R/cap07-razao.R

razao_estima_mediaR Documentation

Ratio estimator of the population mean

Description

Estimates the population mean using the ratio estimator (Eq. 7.36-7.38 of the course notes). Unlike razao_estima_R(), this does not require knowing X (the population total of the auxiliary variable) – only N.

Usage

razao_estima_media(
  x = NULL,
  y = NULL,
  n = NULL,
  sum_x = NULL,
  sum_y = NULL,
  sum_x2 = NULL,
  sum_y2 = NULL,
  sum_xy = NULL,
  N,
  X = NULL,
  conf = 0.95,
  ...
)

Arguments

x, y

Optional raw numeric vectors (sample data).

n, sum_x, sum_y, sum_x2, sum_y2, sum_xy

Optional pre-aggregated summary statistics, used when raw data are not available (e.g. a problem statement that only gives totals).

N

Population size.

X

Optional population total of the auxiliary variable; not needed to compute the mean itself (only N is required), but accepted here so that a full problem statement (which usually supplies X) can be passed without error. Ignored if NULL.

conf

Confidence level, default 0.95.

...

Ignored (see package overview on tolerated extra arguments).

Value

A sampling_result object with the estimated mean, its variance, and confidence interval.

Examples

x <- c(1, 30, 44, 20, 0, 10, 15, 5, 2, 50, 35, 25)
y <- c(2, 35, 50, 27, 1, 15, 17, 7, 0, 53, 35, 30)
razao_estima_media(x = x, y = y, N = 1500)

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