Removes, one at a time, the regressor with the smallest F = (RSS(p - 1) -
RSS(p)) / (RSS(p) / (n - (p + 1))) while it is below f_out (Hedderich, Sachs
& Reynarowych 2023, eq 8.39; drop1(fit, test = "F")). The intercept stays.
Usage
bkelim(X, y, names = NULL, f_out = 4)
Arguments
- X
n x p matrix of regressors.
- y
Response.
- names
Regressor names, default colnames(X) or x1..xp.
- f_out
Threshold.
Value
Named list: selected, removed (data frame of name and F),
coefficients, rss, last_f.
References
Draper, N. R. & Smith, H. (1998). Applied Regression Analysis,
sec. 15.2.
Examples
i <- 1:30
X <- cbind(x1 = sin(i), x2 = cos(2 * i), x3 = log(i))
bkelim(X, 1 + 2 * X[, 1] - X[, 3] + 0.3 * cos(5 * i))$selected
#> [1] "x1" "x3"