Ratio estimator of a population total using known X_pop.
Usage
morie_survey_ratio(y, x, weights, X_population_total)
Arguments
- y
Numeric vector of outcome values aligned with the sample.
- x
Numeric vector of auxiliary values aligned with y (used
in ratio estimation).
- weights
Numeric vector of design weights aligned with y.
- X_population_total
Known population total for the auxiliary
variable x (ratio estimator).
Value
A named list with elements ratio, total_estimate, se, ci_lower, ci_upper.
Examples
set.seed(1)
x <- runif(30, 1, 3); y <- 2 * x + rnorm(30, 0, 0.2)
str(morie_survey_ratio(y, x, rep(1, 30), X_population_total = 60),
max.level = 1)
#> List of 5
#> $ ratio : num 2.01
#> $ total_estimate: num 120
#> $ se : num 0.83
#> $ ci_lower : num 119
#> $ ci_upper : num 122