ratio_estimator: Ratio estimate of a total with an auxiliary variable

View source: R/sampling.R

ratio_estimatorR Documentation

Ratio estimate of a total with an auxiliary variable

Description

The ratio estimator X * Y_hat / X_hat, where X is the known population total of the auxiliary (the area of the segments, the number of farms from a census), with the variance of the residuals ⁠y - R x⁠ under the design, estimated as in design_variance(). The gain over the Horvitz-Thompson estimate is reported.

Usage

ratio_estimator(sample, y, x, x_total = NULL)

Arguments

sample

A fieldopt_sample.

y

Column of the study variable (observed on the sampled units; other rows may be NA).

x

Column of the auxiliary variable.

x_total

Known population total of x; the frame total of the column when NULL.

Value

A one-row tibble as in design_variance() plus ratio, x_total and variance_ht (the variance of the plain Horvitz-Thompson estimate).

Examples

cells <- expand.grid(x = 1:12, y = 1:12)
cells$unit <- paste0("c", 1:144)
cells$farmland <- runif(144, 20, 100)
cells$crop <- 0.4 * cells$farmland + rnorm(144, sd = 3)
s <- select_units(cells, n = 24, seed = 2)
ratio_estimator(s, y = "crop", x = "farmland")

fieldopt documentation built on Oct. 22, 2026, 1:07 a.m.