Skip to contents

\(\bar y + b(\bar X - \bar x)\). Unlike the ratio estimator it fits an INTERCEPT rather than forcing the line through the origin, and its variance is \((1 - \rho^2)\) times the simple-mean variance, so the gain is exactly the squared correlation. Mirrors morie.fn.regest.

Usage

morie_regression_estimator(y, x, weights = NULL, X_mean = NULL)

Arguments

y, x

study and auxiliary variables.

weights

design weights.

X_mean

known population mean of x; required.

Value

list: mean, slope, intercept, correlation, variance_ratio_to_simple_mean, passes_through_origin, n, method.

Examples

set.seed(1)
x <- runif(60, 5, 15)
morie_regression_estimator(100 + 2 * x + rnorm(60), x, X_mean = 10)$slope
#> [1] 1.989036