| Statistics Toolbox | Search  Help Desk |
| leverage | Examples See Also |
Leverage values for a regression.
Syntax
h = leverage(DATA)
h = leverage(DATA,'model')
Description
h = leverage(DATA) finds the leverage of each row (point) in the matrix, DATA for a linear additive regression model.
h = leverage(DATA,'model') finds the leverage on a regression, using a specified model type. 'model' can be one of these strings:
'interaction' - includes constant, linear, and cross product terms.
'quadratic' - interactions plus squared terms.
'purequadratic' - includes constant, linear and squared terms.
Example
One rule of thumb is to compare the leverage to 2p/n where n is the number of observations and p is the number of parameters in the model. For the Hald dataset this value is 0.7692.load hald
h = max(leverage(ingredients,'linear'))
h =
0.7004
Since 0.7004 < 0.7692, there are no high leverage points using this rule.
Algorithm
[Q,R] = qr(x2fx(DATA,'model'));
leverage = (sum(Q'.*Q'))'
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
regstats