rsquaredacademy / olsrr

Tools for developing OLS regression models
https://olsrr.rsquaredacademy.com/
Other
102 stars 22 forks source link

All possible regression - mismatch in column names #211

Closed aravindhebbali closed 1 month ago

aravindhebbali commented 4 months ago

There is a mismatch in the column names in all possible regression. The metric displayed under the column Mallow's Cp is Predicted R-square.

library(olsrr)
#> 
#> Attaching package: 'olsrr'
#> The following object is masked from 'package:datasets':
#> 
#>     rivers
model <- lm(mpg ~ disp + hp, data = mtcars)
k <- ols_step_all_possible(model)
k
#>   Index N Predictors  R-Square Adj. R-Square Mallow's Cp
#> 1     1 1       disp 0.7183433     0.7089548   0.6751205
#> 2     2 1         hp 0.6024373     0.5891853   0.5096958
#> 3     3 2    disp hp 0.7482402     0.7308774   0.6945438
k$result
#>   mindex n predictors   rsquare      adjr     rmse   predrsq        cp      aic
#> 1      1 1       disp 0.7183433 0.7089548 3.148207 0.6751205  4.443792 170.2094
#> 2      2 1         hp 0.6024373 0.5891853 3.740297 0.5096958 17.794906 181.2386
#> 3      3 2    disp hp 0.7482402 0.7308774 2.976436 0.6945438  3.000000 168.6186
#>       sbic      sbc     msep      fpe       apc       hsp
#> 1 79.34223 174.6066 338.3482 11.23270 0.3192109 0.3645502
#> 2 89.04015 185.6358 477.5836 15.85513 0.4505710 0.5145682
#> 3 78.40578 174.4815 313.2349 10.69210 0.3038481 0.3491298

Created on 2024-04-15 with reprex v2.0.2