Robust

  • This page used to contain a companion code in R for sofware for a robust coefficient of determination (or R^2) from:

    Renaud, O. and Victoria-Feser, M.-P. (2010), A robust coefficient of determination for regression , Journal of Statistical Planning and Inference 140, 1852--1862. DOI: 10.1016/j.jspi.2010.01.008

    However this code is now included (and improved) in the function lmrob and its summary (from the "robustbase" package). It is the implementation we highly recommand. See an example of use below:

> ## If not present, install the package 
> install.packages("robustbase")
[...]
>
> ## active it
> library(robustbase)
>
> ## data to be used:
> data(coleman)
>
> ## run the robust linear regression
> col2lmrob = lmrob(Y ~salaryP+motherLev, data=coleman, setting = "KS2014")
>
>
> ## get the output, including the 2 proposed robust R2 under "Multiple R-squared" and "Adjusted R-squared"
> summary(col2lmrob)

Call:
lmrob(formula = Y ~ salaryP + motherLev, data = coleman, setting = "KS2014")
 \--> method = "SMDM"
Residuals:
    Min      1Q  Median      3Q     Max
-8.5458 -1.9686  0.0873  2.4699  6.4041

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  -5.2269    10.6118  -0.493 0.628629    
salaryP       0.5099     2.2364   0.228 0.822370    
motherLev     6.2439     1.5613   3.999 0.000929 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Robust residual standard error: 4.266
Multiple R-squared:  0.509,    Adjusted R-squared:  0.4512
Convergence in 11 IRWLS iterations
[...]