reg_estima_media: Regression estimator of the population mean

View source: R/cap07-regressao.R

reg_estima_mediaR Documentation

Regression estimator of the population mean

Description

Estimates the population mean using the regression estimator (Eq. 7.22-7.25 of the course notes), which uses a known population mean X_barra of an auxiliary variable correlated with y.

Usage

reg_estima_media(x, y, X_barra, N = NULL, conf = 0.95, ...)

Arguments

x

Numeric vector with the auxiliary variable.

y

Numeric vector with the variable of interest.

X_barra

Known population mean of the auxiliary variable.

N

Optional population size, used for the finite-population correction f = n/N. If NULL, f = 0 is assumed.

conf

Confidence level, default 0.95.

...

Ignored (see package overview on tolerated extra arguments).

Value

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

Examples

x <- c(39, 43, 21, 64, 57, 47, 28, 75, 34, 52)
y <- c(65, 78, 52, 82, 92, 89, 73, 98, 56, 75)
reg_estima_media(x, y, X_barra = 52, N = 486)

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