reg_teste_origem: Decide between the ratio and regression estimators

View source: R/cap07-regressao.R

reg_teste_origemR Documentation

Decide between the ratio and regression estimators

Description

Tests whether the regression line of y on x passes through the origin (H0: a0 = 0), using both the t-statistic (Eq. 7.20) and the confidence interval for a0 (Eq. 7.21), and recommends the ratio estimator if the line passes through the origin (fails to reject H0) or the regression estimator otherwise – following the logic of Examples 7.1-7.2 of the course notes.

Usage

reg_teste_origem(x, y, conf = 0.95, ...)

Arguments

x

Numeric vector with the auxiliary variable.

y

Numeric vector with the variable of interest.

conf

Confidence level, default 0.95.

...

Ignored (see package overview on tolerated extra arguments).

Value

A sampling_result object stating the recommended estimator, the test statistic, the confidence interval for a0, and both estimators computed side by side for comparison.

Examples

x <- c(1, 30, 44, 20, 0, 10, 15, 5, 2, 50, 35, 25)
y <- c(2, 35, 50, 27, 1, 15, 17, 7, 0, 53, 35, 30)
reg_teste_origem(x, y)

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