2
$\begingroup$

I want to fit a robust linear model to my data using the rlm function in R. Is there any function that provides forward model selection in combination with robust methods (I only know the function stepAIC for lm)? I want to use the BIC as selection criterion.

$\endgroup$
1
  • $\begingroup$ Are you commited to using stepwise regression? Maybe you could use the dredge function from package MuMIn instead? It calculates BIC of all possible models and can rank them accordingly. Of course that only works with a limited number of regressors. $\endgroup$
    – Roland
    Nov 5 '15 at 13:11
3
$\begingroup$

I would not use stepwise regression. If the number of regressors is limited, I'd calculate the BIC of all possible models:

library(MASS)
fit <- rlm(Sepal.Length ~ ., data = iris)

library(MuMIn)
dredge(fit, rank = "BIC")
#Fixed term is "(Intercept)"
#Global model call: rlm(formula = Sepal.Length ~ ., data = iris)
#---
#Model selection table 
#   (Int) Ptl.Lng  Ptl.Wdt Spl.Wdt Spc df   logLik   BIC  delta weight
#8  1.878  0.7231 -0.59190  0.6401      5  -37.388  99.8   0.00  0.372
#14 2.383  0.7924           0.4249   +  6  -34.919  99.9   0.07  0.359
#16 2.200  0.8499 -0.32960  0.4777   +  7  -32.703 100.5   0.65  0.269
#<...>
#Models ranked by BIC(x) 

It also handles interactions well:

fit1 <- rlm(Sepal.Length ~ .*., data = iris)
dredge(fit1, rank = "BIC")[1:3]
#Global model call: rlm(formula = Sepal.Length ~ . * ., data = iris)
#---
#Model selection table 
#   (Int) Ptl.Lng Ptl.Wdt Spl.Wdt Spc Ptl.Lng:Spl.Wdt df  logLik   BIC delta weight
#8  1.878  0.7231 -0.5919  0.6401                      5 -37.388  99.8  0.00  0.366
#14 2.383  0.7924          0.4249   +                  6 -34.919  99.9  0.07  0.353
#46 1.504  1.0540          0.6890   +        -0.08096  7 -32.638 100.4  0.52  0.282
#Models ranked by BIC(x) 

Of course, I would be wary of combining this kind of model selection with robust regression. I prefer using robust regression if I have some confidence in the underlying model.

$\endgroup$
4
  • $\begingroup$ So you would do model selection for the linear model and then fit the robust version? $\endgroup$
    – R_FF92
    Nov 5 '15 at 14:32
  • $\begingroup$ No, I would avoid automated model selection if at all possible; in particular, if you are concerned about influential values, which I assume is your reason for wanting to use robust regression. $\endgroup$
    – Roland
    Nov 5 '15 at 14:39
  • $\begingroup$ Indeed, that is the reason why I use the robust regression. Which method for variable selection and size of the model you prefer? $\endgroup$
    – R_FF92
    Nov 5 '15 at 14:43
  • 1
    $\begingroup$ As I said, I would want to rely on expert knowledge to decide for an appropriate model, which can then be fit by a robust method. $\endgroup$
    – Roland
    Nov 5 '15 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.