View source: R/cap07-regressao.R
| reg_estima_media | R Documentation |
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.
reg_estima_media(x, y, X_barra, N = NULL, conf = 0.95, ...)
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 |
conf |
Confidence level, default |
... |
Ignored (see package overview on tolerated extra arguments). |
A sampling_result object with the regression-estimated mean,
its variance, and confidence interval.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.