Skip to contents

\(\hat T_{GREG} = \hat T_{HT} + (T_x - \hat T_x)'B\). GREG is where design-based and model-based thinking meet: the coefficient B comes from a working model, but the estimator stays design-consistent whether or not that model is right. A wrong model costs EFFICIENCY, never validity, which is why GREG is the standard production estimator in national statistics. Mirrors morie.fn.genrgr.

Usage

morie_greg(y, x, weights, totals)

Arguments

y

study variable.

x

matrix of auxiliaries.

weights

design weights.

totals

known population totals of the auxiliaries.

Value

list: total, ht_total, correction, B, residual_totals, design_consistent_regardless_of_model, n, p, method.

Examples

set.seed(1)
x <- cbind(1, runif(40, 0, 10))
morie_greg(rnorm(40), x, rep(20, 40),
           c(800, 4000))$design_consistent_regardless_of_model
#> [1] TRUE