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.

Release files for olr 1.3.6

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.6
File Size Uploaded
olr-1.3.6.tar.gz 21.0 kB Details

Built distribution (wheel)

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

Total release size: 41.2 kB

Release files / olr-1.3.6.tar.gz

Download URL olr-1.3.6.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
06ab3b2eb8c7199943f9be48be960ac7e3d12970a5a0ce63776b76185a309bed
BLAKE2b-256 checksum
How to use checksums
c62bc11e765e83fe07687bd55d30cd2b155a882625ead61ea1bf2b13896852d3
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.6-py3-none-any.whl

Download URL olr-1.3.6-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe54e195f6694325aea1595ed29f50e9aa65060263aa378617de39c846514493
BLAKE2b-256 checksum
How to use checksums
c4115c02819543525b115b301bede80d42d7c8eb0a6c5cd78da403b2d46c1756
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

This release

1.3.6 This release

2 release files

1.3.5

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