View source: R/cap07-regressao.R
| reg_ajustar | R Documentation |
Fits the simple linear regression of y on x by least squares
(Eqs. 7.9-7.10 of the course notes), and computes the residual
variance, the standard error of the intercept, and the t-statistic
used to test whether the line passes through the origin
(Eqs. 7.18-7.20) – the basis for deciding between the ratio and the
regression estimator (see reg_teste_origem()).
reg_ajustar(x, y, ...)
x |
Numeric vector with the auxiliary variable. |
y |
Numeric vector with the variable of interest. |
... |
Ignored (see package overview on tolerated extra arguments). |
A sampling_result object with the fitted coefficients,
residual variance, and the intercept's standard error and
t-statistic.
Cochran, W.G. (1977). Sampling Techniques, 3rd ed. Wiley, cap. 7.
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_ajustar(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.