MULTIPLE_LINEAR_REGRESSION
Name
MULTIPLE_LINEAR_REGRESSION
Purpose
This function will perform a full-order multiple linear regression
by constructing a full-order design matrix including all possible
combinations of the provided independent variables (for example, if
5 independent variables are provided and a constant/intercept term is
desired for a third-order model (order=3), then all 6-CHOOSE-3 three-
term variable combinations will be placed in the design matrix).
Category
Statistics.
Calling Sequence
Result = $
MULTIPLE_LINEAR_REGRESSION( independentData, $
dependentData, $
order, $
[NO_INTERCEPT=no_intercept], $
[DESIGN_MATRIX=design_matrix], $
[ANALYSIS=analysis], $
[SIGNIFICANCE_LEVEL=significance_level]
Inputs
independentData
A "number of independent variables" by "number of observations" array or
a "number of observations" vector of independent variable values.
dependentData
A "number of observations" vector of dependent variable points.
order
The order of the model to be constructed. If a constant/intercept
term is desired, the design matrix will be "number-of-variables"+1-
CHOOSE-order by "number of observations" in size.
Keyword Parameters
NO_INTERCEPT
This keyword will cause a no-intercept regression to be carried out.
DESIGN_MATRIX
This keyword will cause the named variable to contain the constructed
design matrix upon return.
ANALYSIS
This keyword will cause the named variable to contain a structure upon
return that contains the regression analysis terms including:
ANOVA
A structure containing the elements of a multiple regression
ANOVA table, including
SSREGRESSION
The regression sum of squared error.
SSRESIDUAL
The residual sum of squared error.
SSTOTAL
The total sum of squared error.
DOFREGRESSION
Regression degrees of freedom (p)
DOFRESIDUAL
Residual degrees of freedom (n-p)
DOFTOTAL
Total degrees of freedom (n-1)
MSREGRESSION
The regression mean squared error.
MSRESIDUAL
The residual mean squared error.
MSTOTAL
The total mean squared error.
F
The F-statistic used to determine the significance of
the regression (MSREGRESSION / MSRESIDUAL)
PVALUE
The probability of exceeding the F-statistic for this
regression (if the p-Value is less than the significance
level, then the null hypothesis that all coefficients are
0 can be rejected and the regression is considered
significant)
RSQUARED
The coefficient of determination.
STANDARDERRORS
A vector containing the standard error for each coefficient determined
for the regression for using in significance testing.
TVALUES
A vector containing the t-value for each coefficient determined
for the regression for using in significance testing.
PVALUES
A vector containing the p-value for each coefficient determined
for the regression for using in significance testing.
COEFFICIENTSSIGNIFICANT
A vector containing values of 1 for each coefficient that was
determined to be significant at a level of significance provided
by the calling routine, and 0 otherwise.
SIGNIFICANCE_LEVEL
The named variable/constant contains the two-tailed level of significance
at which the coefficients are evaluated (if not provided, a value of 0.05
is used by default).
Return Value
A "number of variables"+1-CHOOSE-order element vector containing the
multiple linear regression coefficients for the constructed design matrix.
Side Effects
None
Modification History
Written by: Carl Salvaggio
Philip Salvaggio
June, 2010 Original code
Disclaimer
This source code is provided "as is" and without warranties as to performance
or merchantability. The author and/or distributors of this source code may
have made statements about this source code. Any such statements do not
constitute warranties and shall not be relied on by the user in deciding
whether to use this source code.
This source code is provided without any express or implied warranties
whatsoever. Because of the diversity of conditions and hardware under which
this source code may be used, no warranty of fitness for a particular purpose
is offered. The user is advised to test the source code thoroughly before
relying on it. The user must assume the entire risk of using the source code.