Skip to main content

The olr function systematically evaluates multiple linear regression models by exhaustively considering all possible combinations of independent variables against the dependent variable. It then provides a statistical summary based on either the highest adjusted R-squared or R-squared value obtained from these models.

In the realm of model evaluation, both R-squared and adjusted R-squared serve as prominent metrics, each offering unique insights into the quality of the model fit. R-squared, while widely used, has a tendency to increase with the inclusion of any explanatory variable, regardless of its significance. This characteristic can potentially lead to the incorporation of unnecessary variables, contributing to overfitting issues.

To address this concern, adjusted R-squared penalizes the addition of superfluous variables, offering a more refined assessment of model fit. Within the olr function framework, the primary objective is to identify the model that best aligns with the underlying data, maximizing predictive accuracy without sacrificing model complexity. Thus, while adjusted R-squared provides valuable insights into model parsimony, the inclusion of R-squared alongside it ensures a comprehensive evaluation of model performance.

By considering both metrics, the olr function facilitates the identification of the most suitable model, striking a balance between explanatory power and complexity. This approach ensures that the selected model effectively captures the inherent relationships within the data while mitigating the risk of overfitting.

dataset = pd.read_csv('C:\Users\wfky1\OneDrive\Documents\PythonFolder\PythonOlr\olr_python_package\data\crudeoildata.csv')
responseName = dataset[['OilPrices']]
predictorNames = dataset[['SPX', 'RigCount', 'API', 'FieldProduction', 'RefinerNetInput', 'OperableCapacity', 'Imports', 'StocksExcludingSPR', 'NonCommercialLong', 'NonCommercialShort', 'CommercialLong', 'CommercialShort', 'TotalLong', 'TotalShort', 'NonReportablePositionsLong', 'NonReportablePositionsShort', 'OpenInterest']]

The TRUE or FALSE in the olr function, specifies either the adjusted R-squared or the R-squared regression summary, respectfully.

When responseName and predictorNames are None (NULL), then the first column in the dataset is set as the responseName and the remaining columns are the predictorNames.

Adjusted R-squared
olr(datasetname, resvarname = None, expvarnames = None, adjr2 = "True")

R-squared
olr(datasetname, resvarname = None, expvarnames = None, adjr2 = "False")

list of summaries
olrmodels(datasetname, resvarname = None, expvarnames = None)

list of formulas
olrformulas(datasetname, resvarname = None, expvarnames = None)

list of forumlas with the dependant variables in ascending order
olrformulasorder(datasetname, resvarname = None, expvarnames = None)

the list of adjusted R-squared terms
adjr2list(datasetname, resvarname = None, expvarnames = None)

the list of R-squared terms
r2list(datasetname, resvarname = None, expvarnames = None)

An R version of this package olr is available on CRAN.

Metadata

Release files for olr 1.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for olr 1.3.5
File Size Uploaded
olr-1.3.5.tar.gz 18.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for olr 1.3.5
File Interpreter ABI Platform
olr-1.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / olr-1.3.5.tar.gz

Download URL olr-1.3.5.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
61e013b8663e36512e84eef651e1f01fa52e7d1185ecae403a2d3e9f9327678e
BLAKE2b-256 checksum
How to use checksums
5e748d87e05e1cd21111d23f6f8494bef0baa1d86f37ed16237e0d48243defc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release files / olr-1.3.5-py3-none-any.whl

Download URL olr-1.3.5-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72922c20c50b4210654328f07140e85e2dd77bffd74d54cc742fd7e72341d7e3
BLAKE2b-256 checksum
How to use checksums
3c105e4848a045fd68e1cdaa6facdfbdc1e4c7570ffd30259a2aae0fe13ffca0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

1.3.6

2 release files

This release

1.3.5 This release

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.4

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

1 release file

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page