Alternative to rsquared in robust regression using fitlm('RobustOpts','on')

조회 수: 3 (최근 30일)
Janine
Janine 2016년 10월 14일
답변: Brendan Hamm 2016년 10월 14일
Hi all,
I am using the fitlm('RobustOpts','on') function to estimate robust linear and non-linear (quadratic) models. I am interested in whether the linear relationship is significant and whether the quadratic model fits better than the linear one (i.e. the aim is to calculate a robust hierarchical regression).
I therefore need some measure for the modelfit. Although the fitlm function outputs R², I am concerned that this might be not the appropriate modelfit measure for robust regression analysis. Beneath things a read in other discussions, one of my linear analysis seems to confirm this concern: R² is significant, although the only regressor in this analysis is far from significant (the only significant term is the constant), when I calculate the "normal" OLS the regressor is significant.
Do you have an suggestions how I can solve this problem?
Many thanks in advance!
Janine

답변 (1개)

Brendan Hamm
Brendan Hamm 2016년 10월 14일
Robust regression is simply going to fit your regression model using OLS and then perform an additional weighted regression to provide your final model. The weighting by default uses the bi-squared weighting algorithm. This is essentially going to remove any observations with very large residuals from the initial OLS model, and bias those which are close to the original solution.
If you really want to simply compare a Quadratic and Linear model, I would suggest looking at the AIC and BIC models as they penalize the number of parameters in the fit. These are located in the ModelCriterion property of the LinearModel.
You could also use a stepwise regression to have MATLAB determine based on the AIC or BIC (Akaike and Bayesian Information Criterion respectively)of the model which is the more appropriate fit.
mdl = stepwiselm(...,'linear','Upper','quadratic','Criterion','bic') % ... for data: double or table
This will start at a linear model and include up to a quadratic model. It will then return to you the best model according to the BIC.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by