Skip to main content

Forward and Backward Variable Selection

Project description

variable.method_select

forward(y,X)

back (y,X)

This package executes the forward and backward selection procedures to aid in selecting variables for inclusion in an OLS regression model.

The forward selection procedure starts with an equation containing no predictor varaibles, only a constant that must be added by the user. To identify the first variable to include in the equation, the independent variable with the highest simple correlation to the response variable is selected and included in an OLS regression. If An evaluation of the independent variable's p-value is completed, and if the variable proves significantly different from zero, it is retained in the equation and a review for a second variable is initiated. To identify a second variable, a correlation with the remaining variables is completed against the residuals from the previous OLS regression. The independent variable with the highest correlation to the residuals is selected as the second variable, which is included in a subsequent OLS regression. If the p-value of this second variable proves significant from zero, this second variable is retained and the search for a third variable is initiated. This process continues for all available variables.

The backward selection procedure starts with all variables including a constant that must be added by the user, and systematically removes the variable with the smallest t-value in each iteration.

To initiate the function, the user must specify the target variable (y) and the independent variable(s) (X).

The output of this package is a table showing the order in which the variables were evaluated, as well as validation factors used for evaluating variables for inclusion in a model. The user should review the table and make determinations based on their preferences.

This variable selection package was developed based on the procedure as described in Chatterjee, Samprit and Hadi, Ali S (2012). Regression Analysis by Example (5th ed.). Hoboken, New Jersey: John Wiley & Sons, Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

variable-0.0.4.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

variable-0.0.4-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file variable-0.0.4.tar.gz.

File metadata

  • Download URL: variable-0.0.4.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.4

File hashes

Hashes for variable-0.0.4.tar.gz
Algorithm Hash digest
SHA256 efd2e912b4de2c5b03a37818169b65647c8f5ad41ffa2cb51849dc2fedf41461
MD5 5c19a8bc284064bac9949d56c39f35ca
BLAKE2b-256 b8686678328a85de5c9b07ddffeef9991d5cf7fd0a1858e31a0fe0f841ffd481

See more details on using hashes here.

File details

Details for the file variable-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: variable-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.4

File hashes

Hashes for variable-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a5133a6cc55a75f3a9231046a3ec632f2b8945380fae74853d66d75440102704
MD5 0b64b95c2c94549981750c8bdf082828
BLAKE2b-256 14c9be43b15915411e32370218b8fdb2e523797016bf6d0e88b4e53044ee07da

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page