Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output from reg_compute rounded up to 3 decimal points #24

Closed
aravindhebbali opened this issue Aug 16, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@aravindhebbali
Copy link
Member

commented Aug 16, 2017

The output from reg_compute() is rounded to 3 decimal points which leads to errors in the variable selection procedures.

> mtcars$cyl <- as.factor(mtcars$cyl)
> mtcars$gear <- as.factor(mtcars$gear)
> olsrr:::reg_comp(formula = mpg ~ disp + hp + log(wt) + cyl + gear * disp,  data = mtcars)
$r
[1] 0.95

$rsq
[1] 0.903

$adjr
[1] 0.864

$sigma
[1] 2.224

$cv
[1] 11.071

$mse
[1] 4.947

$mae
[1] 1.589

$aic
[1] 151.984

$sbc
[1] 168.107

$sbic
[1] 75.125

$prsq
[1] 0.802

$error_df
[1] 22

$model_df
[1] 9

$total_df
[1] 31

$ess
[1] 108.838

$rss
[1] 1017.209

$tss
[1] 1126.047

$rms
[1] 113.023

$ems
[1] 4.947

$f
[1] 22.847

$p
[1] 0

$n
[1] 7

$betas
(Intercept)        disp          hp     log(wt)        cyl6        cyl8       gear4 
     32.122       0.002      -0.030      -8.068      -0.595      -0.669       9.206 
      gear5  disp:gear4  disp:gear5 
      3.899      -0.054      -0.007 

$sbetas
      disp         hp    log(wt)       cyl6       cyl8      gear4      gear5 
     0.046     -0.344     -0.425     -0.041     -0.056      0.751      0.239 
disp:gear4 disp:gear5 
    -0.580     -0.093 

$std_errors
(Intercept)        disp          hp     log(wt)        cyl6        cyl8       gear4 
      3.312       0.011       0.017       3.578       1.554       2.793       4.035 
      gear5  disp:gear4  disp:gear5 
      3.417       0.027       0.013 

$tvalues
(Intercept)        disp          hp     log(wt)        cyl6        cyl8       gear4 
      9.698       0.200      -1.763      -2.255      -0.383      -0.239       2.282 
      gear5  disp:gear4  disp:gear5 
      1.141      -2.028      -0.505 

$pvalues
(Intercept)        disp          hp     log(wt)        cyl6        cyl8       gear4 
      0.000       0.844       0.092       0.034       0.706       0.813       0.033 
      gear5  disp:gear4  disp:gear5 
      0.266       0.055       0.618 

$df
[1] 1 1 1 1 1 1 1

$conf_lm
              2.5 % 97.5 %
(Intercept)  25.253 38.991
disp         -0.021  0.025
hp           -0.066  0.005
log(wt)     -15.488 -0.648
cyl6         -3.818  2.628
cyl8         -6.461  5.124
gear4         0.839 17.574
gear5        -3.187 10.985
disp:gear4   -0.109  0.001
disp:gear5   -0.034  0.020

$title
[1] "model"

$dependent
[1] "mpg"

$predictors
[1] "disp"    "hp"      "log(wt)" "cyl"     "gear"   

$mvars
 [1] "(Intercept)" "disp"        "hp"          "log(wt)"     "cyl6"       
 [6] "cyl8"        "gear4"       "gear5"       "disp:gear4"  "disp:gear5" 

$model

Call:
lm(formula = formula, data = data)

Coefficients:
(Intercept)         disp           hp      log(wt)         cyl6         cyl8  
  32.121919     0.002218    -0.030235    -8.067866    -0.594533    -0.668551  
      gear4        gear5   disp:gear4   disp:gear5  
   9.206104     3.899057    -0.053942    -0.006594  

Session Info

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.11     tidyr_0.6.3      dplyr_0.7.1      assertthat_0.2.0
 [5] plyr_1.8.4       grid_3.4.1       R6_2.2.2         gtable_0.2.0    
 [9] magrittr_1.5     scales_0.4.1     ggplot2_2.2.1    rlang_0.1.1     
[13] lazyeval_0.2.0   bindrcpp_0.2     goftest_1.0-3    olsrr_0.2.0     
[17] nortest_1.0-4    tools_3.4.1      glue_1.1.1       purrr_0.2.2.2   
[21] munsell_0.4.3    compiler_3.4.1   colorspace_1.2-7 pkgconfig_2.0.1 
[25] bindr_0.1        gridExtra_2.2.1  tibble_1.3.3 

@aravindhebbali aravindhebbali added the bug label Aug 16, 2017

@aravindhebbali aravindhebbali added this to the v0.3.0 milestone Aug 16, 2017

@aravindhebbali aravindhebbali self-assigned this Aug 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.