reg_ajustar: Fit a simple linear regression (ratio/regression estimator...

View source: R/cap07-regressao.R

reg_ajustarR Documentation

Fit a simple linear regression (ratio/regression estimator groundwork)

Description

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()).

Usage

reg_ajustar(x, y, ...)

Arguments

x

Numeric vector with the auxiliary variable.

y

Numeric vector with the variable of interest.

...

Ignored (see package overview on tolerated extra arguments).

Value

A sampling_result object with the fitted coefficients, residual variance, and the intercept's standard error and t-statistic.

References

Cochran, W.G. (1977). Sampling Techniques, 3rd ed. Wiley, cap. 7.

Examples

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)

sampleone documentation built on Oct. 13, 2026, 5:07 p.m.