| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
h = leverage(data)
h = leverage(data,model)
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, where model can be one of these strings:
'linear' - includes constant and linear terms
'interaction' - includes constant, linear, and cross product terms
'quadratic' - includes interactions and squared terms
'purequadratic' - includes constant, linear, and squared terms
Leverage is a measure of the influence of a given observation on a regression due to its location in the space of the inputs.
[Q,R] = qr(x2fx(data,'model'));
leverage = (sum(Q'.*Q'))'
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 data set 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.
[1] Goodall, C. R. "Computation Using the QR Decomposition." Handbook in Statistics. Vol. 9, Amsterdam: Elsevier/North-Holland, 1993.
![]() | levelcounts (categorical) | lhsdesign | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |