olr: Optimal Linear Regression

The olr function systematically evaluates multiple linear regression models by exhaustively fitting all possible combinations of independent variables against the specified dependent variable. It selects the model that yields the highest adjusted R-squared (by default) or R-squared, depending on user preference. In model evaluation, both R-squared and adjusted R-squared are key metrics: R-squared measures the proportion of variance explained but tends to increase with the addition of predictors—regardless of relevance—potentially leading to overfitting. Adjusted R-squared compensates for this by penalizing model complexity, providing a more balanced view of fit quality. The goal of olr is to identify the most suitable model that captures the underlying structure of the data while avoiding unnecessary complexity. By comparing both metrics, it offers a robust evaluation framework that balances predictive power with model parsimony. Example Analogy: Imagine a gardener trying to understand what influences plant growth (the dependent variable). They might consider variables like sunlight, watering frequency, soil type, and nutrients (independent variables). Instead of manually guessing which combination works best, the olr function automatically tests every possible combination of predictors and identifies the most effective model—based on either the highest R-squared or adjusted R-squared value. This saves the user from trial-and-error modeling and highlights only the most meaningful variables for explaining the outcome. A Python version is also available at <https://pypi.org/project/olr>.

Version: 1.2
Depends: R (≥ 2.10)
Imports: plyr, utils, stats, readxl, htmltools
Suggests: knitr, rmarkdown, ggplot2
Published: 2025-05-20
Author: Mathew Fok [aut, cre]
Maintainer: Mathew Fok <quiksilver67213 at yahoo.com>
BugReports: https://github.com/MatHatter/olr_r/issues
License: GPL-3
URL: https://github.com/MatHatter/olr_r, https://pypi.org/project/olr/
NeedsCompilation: no
CRAN checks: olr results

Documentation:

Reference manual: olr.pdf
Vignettes: Getting Started with olr: Optimal Linear Regression (source, R code)

Downloads:

Package source: olr_1.2.tar.gz
Windows binaries: r-devel: olr_1.1.zip, r-release: olr_1.1.zip, r-oldrel: olr_1.1.zip
macOS binaries: r-release (arm64): olr_1.1.tgz, r-oldrel (arm64): olr_1.1.tgz, r-release (x86_64): olr_1.2.tgz, r-oldrel (x86_64): olr_1.2.tgz
Old sources: olr archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=olr to link to this page.