Click or drag to resize
StepwiseRegression Class
Builds multiple linear regression models using forward selection, backward selection, or stepwise selection.
Inheritance Hierarchy
SystemObject
  Imsl.StatStepwiseRegression

Namespace: Imsl.Stat
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class StepwiseRegression

The StepwiseRegression type exposes the following members.

Constructors
  NameDescription
Public methodStepwiseRegression(Double, Double)
Creates a new instance of StepwiseRegression.
Public methodStepwiseRegression(Double, Int32)
Creates a new instance of StepwiseRegression from a user-supplied variance-covariance matrix.
Public methodStepwiseRegression(Double, Double, Double)
Creates a new instance of weighted StepwiseRegression.
Public methodStepwiseRegression(Double, Double, Double, Double)
Creates a new instance of weighted StepwiseRegression using observation frequencies.
Top
Methods
  NameDescription
Public methodCompute
Builds the multiple linear regression models using forward selection, backward selection, or stepwise selection.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetMeans
Sets the means of the variables.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyANOVA
An analysis of variance table and related statistics.
Public propertyCoefficientTTests
The student-t test statistics for the regression coefficients.
Public propertyCoefficientVIF
The variance inflation factors for the final model in this invocation.
Public propertyCovariancesSwept
Results after cov has been swept for the columns corresponding to the variables in the model.
Public propertyForce
Forces independent variables into the model based on their level assigned from Levels.
Public propertyHistory
The stepwise regression history for the independent variables.
Public propertyIntercept
Returns the intercept.
Public propertyLevels
The levels of priority for variables entering and leaving the regression.
Public propertyMethod
Specifies the stepwise selection method, forward, backward, or stepwise Regression.
Public propertyPValueIn
Defines the largest p-value for variables entering the model.
Public propertyPValueOut
Defines the smallest p-value for removing variables.
Public propertySwept
An array containing information indicating whether or not a particular variable is in the model.
Public propertyTolerance
The tolerance used to detect linear dependence among the independent variables.
Top
Remarks

Class StepwiseRegression builds a multiple linear regression model using forward selection, backward selection, or forward stepwise (with a backward glance) selection.

Levels of priority can be assigned to the candidate independent variables using Levels. All variables with a priority level of 1 must enter the model before variables with a priority level of 2. Similarly, variables with a level of 2 must enter before variables with a level of 3, etc. Variables also can be forced into the model using Force. Note that specifying "force" without also specifying levels of priority will result in all variables being forced into the model.

Typically, the intercept is forced into all models and is not a candidate variable. In this case, a sum-of-squares and crossproducts matrix for the independent and dependent variables corrected for the mean is required. Other possibilities are as follows:

  1. The intercept is not in the model. A raw (uncorrected) sum-of-squares and crossproducts matrix for the independent and dependent variables is required as input in cov. Argument nObservations must be set to one greater than the number of observations.
  2. An intercept is a candidate variable. A raw (uncorrected) sum-of-squares and crossproducts matrix for the constant regressor (=1), independent and dependent variables are required for cov. In this case, cov contains one additional row and column corresponding to the constant regressor. This row/column contains the sum-of-squares and crossproducts of the constant regressor with the independent and dependent variables. The remaining elements in cov are the same as in the previous case. Argument nObservations must be set to one greater than the number of observations.

The stepwise regression algorithm is due to Efroymson (1960). StepwiseRegression uses sweeps of the covariance matrix (input in cov, if the covariance matrix is specified, or generated internally) to move variables in and out of the model (Hemmerle 1967, Chapter 3). The SWEEP operator discussed in Goodnight (1979) is used. A description of the stepwise algorithm is also given by Kennedy and Gentle (1980, pp. 335-340). The advantage of stepwise model building over all possible regression (SelectionRegression) is that it is less demanding computationally when the number of candidate independent variables is very large. However, there is no guarantee that the model selected will be the best model (highest R^2
            ) for any subset size of independent variables.

See Also

Reference

Other Resources