Statistics Toolbox | ![]() ![]() |
Regression diagnostics graphical user interface.
Syntax
regstats(responses,DATA) regstats(responses,DATA,'
model
'
)
Description
generates regression diagnostics for a linear additive model with a constant term. The dependent variable is the vector regstats(responses,
DATA)
responses
. Values of the independent variables are in the matrix DATA.
The function creates a figure with a group of check boxes that save diagnostic statistics to the base workspace using variable names you can specify.
regstats(responses,data,
controls the order of the regression model, where '
model
'
)
'
model
'
can be one of these strings:
'interaction'
- includes constant, linear, and cross product terms'quadratic'
- includes interactions and squared terms'purequadratic'
- includes constant, linear, and squared termsThe literature suggests many diagnostic statistics for evaluating multiple linear regression. regstats
provides these diagnostics:
For more detail press the Help button in the regstats
window. This provides formulae and interpretations for each of these regression diagnostics.
Algorithm
The usual regression model is y = X +
, where:
Let X
= Q*R
where Q
and R
come from a QR Decomposition of X
. Q
is orthogonal and R
is triangular. Both of these matrices are useful for calculating many regression diagnostics (Goodall 1993).
The standard textbook equation for the least squares estimator of is
However, this definition has poor numeric properties. Particularly dubious is the computation of , which is both expensive and imprecise.
Numerically stable MATLAB code for is
b = R\(Q'*y);
Reference
Goodall, C. R. (1993). Computation using the QR decomposition. Handbook in Statistics, Volume 9. Statistical Computing (C. R. Rao, ed.). Amsterdam, NL Elsevier/North-Holland.
See Also
leverage
, stepwise
, regress
![]() | regress | ridge | ![]() |