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

Step AIC both direction method AIC value rounded to 3 decimal points #40

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 AIC value used to add/remove predictors in ols_stepaic_both() is rounded to 3 decimal points and may lead to incorrect addition/removal of predictors to the model.

> mtcars$cyl <- as.factor(mtcars$cyl)
> model <- lm(mpg ~ disp + hp + log(wt) + cyl, data = mtcars)
> k <- olsrr::ols_stepaic_both(model)
No more variables to be added or removed.
> k$aic
[1] 157.588 148.131

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.