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

plot() with ols_step_both_aic() doesn't show anything when AIC values are negative. #212

Open
williamlai2 opened this issue May 21, 2024 · 0 comments
Assignees
Labels

Comments

@williamlai2
Copy link

williamlai2 commented May 21, 2024

I provide a reprex for this as the object doesn't seem to be able to be written out properly, but when the AIC values are negative, then plot() doesn't work properly. The limits need to be manually reversed.

                                           Stepwise Summary                                           
----------------------------------------------------------------------------------------------------
Step    Variable                      AIC             SBC             SBIC          R2       Adj. R2 
----------------------------------------------------------------------------------------------------
 0      Base Model                 -985484.600     -985461.939    -2733547.341    0.00000    0.00000 
 1      VEGETATION (+)            -1304585.845    -1304472.535    -3052661.699    0.40433    0.40432 
 2      watertableslice (+)       -1376953.606    -1376828.965    -3125029.022    0.47036    0.47035 
 3      LANDFORM (+)              -1381566.411    -1381373.784    -3129651.797    0.47432    0.47431 
 4      MrVBF_class (+)           -1384577.316    -1384339.365    -3132668.669    0.47689    0.47688 
 5      dist_to_perm_water (+)    -1386032.813    -1385783.532    -3134124.143    0.47813    0.47811 
 6      depth_to_gw (+)           -1386277.748    -1386017.136    -3134369.074    0.47834    0.47832 
----------------------------------------------------------------------------------------------------
plot(mod1)

image

plot(mod1) +
  # because it is negative
  scale_y_continuous(limits = c(min(mod1$metrics$aic), max(mod1$metrics$aic)))

image

@aravindhebbali aravindhebbali self-assigned this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants