diff --git a/.Rbuildignore b/.Rbuildignore index 02c5e12..423541f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -17,3 +17,4 @@ ^\.github$ ^CODE_OF_CONDUCT\.md$ ^revdep$ +TODO.md diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 0000000..74ec7b0 --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,95 @@ +# R-hub's generic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub +run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + name: + description: 'Run name. You can leave this empty now.' + type: string + id: + description: 'Unique ID. You can leave this empty now.' + type: string + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/actions/setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/run-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: r-hub/actions/checkout@v1 + - uses: r-hub/actions/setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/platform-info@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + - uses: r-hub/actions/setup-deps@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/actions/run-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} diff --git a/DESCRIPTION b/DESCRIPTION index 9f10ff6..8e28496 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: olsrr Type: Package Title: Tools for Building OLS Regression Models -Version: 0.6.0.9000 +Version: 0.6.1 Authors@R: person("Aravind", "Hebbali", email = "hebbali.aravind@gmail.com", role = c("aut", "cre")) Description: Tools designed to make it easier for users, particularly beginner/intermediate R users to build ordinary least squares regression models. Includes comprehensive regression output, @@ -33,5 +33,5 @@ Encoding: UTF-8 LazyData: true VignetteBuilder: knitr Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index 58b8da1..0c8d078 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -213,6 +213,7 @@ importFrom(stats,complete.cases) importFrom(stats,confint.lm) importFrom(stats,cooks.distance) importFrom(stats,cor) +importFrom(stats,deviance) importFrom(stats,df.residual) importFrom(stats,dfbetas) importFrom(stats,dffits) @@ -245,7 +246,4 @@ importFrom(stats,sd) importFrom(stats,shapiro.test) importFrom(stats,var) importFrom(utils,combn) -importFrom(utils,install.packages) -importFrom(utils,menu) -importFrom(utils,packageVersion) importFrom(utils,tail) diff --git a/NEWS.md b/NEWS.md index 77f5960..de9324f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,15 @@ -# olsrr 0.6.0.9000 +# olsrr 0.6.1 + +This is a patch release for urgent bug fixes. + +## Bug Fixes + +- Limit maximum subset order in `ols_step_all_possible()` ([#202](https://github.com/rsquaredacademy/olsrr/issues/202)) +- Check model type ([#204](https://github.com/rsquaredacademy/olsrr/issues/204)) +- Mismatch in column names in `ols_step_all_possible()` ([#211](https://github.com/rsquaredacademy/olsrr/issues/211)) +- RMSE is not square root of MSE in `ols_regress()` ([#213](https://github.com/rsquaredacademy/olsrr/issues/213)) +- `geom_segment()` warning in `ols_plot_obs_fit()` ([#217](https://github.com/rsquaredacademy/olsrr/issues/217)) +- New snapshot added every time tests are run ([#218](https://github.com/rsquaredacademy/olsrr/issues/218)) # olsrr 0.6.0 diff --git a/R/ols-all-possible-regression.R b/R/ols-all-possible-regression.R index 5f48b2d..cfc6175 100644 --- a/R/ols-all-possible-regression.R +++ b/R/ols-all-possible-regression.R @@ -102,7 +102,7 @@ ols_step_all_possible.default <- function(model, max_order = NULL, ...) { print.ols_step_all_possible <- function(x, ...) { n <- max(x$result$mindex) - k <- data.frame(x$result)[, c(1:5, 7)] + k <- data.frame(x$result)[, c(1:5, 8)] names(k) <- c("Index", "N", "Predictors", "R-Square", "Adj. R-Square", "Mallow's Cp") print(k) @@ -377,4 +377,4 @@ allpos_helper <- function(model, max_order = NULL) { ) return(result) -} \ No newline at end of file +} diff --git a/R/ols-best-subsets-regression.R b/R/ols-best-subsets-regression.R index b6e0933..8c91207 100644 --- a/R/ols-best-subsets-regression.R +++ b/R/ols-best-subsets-regression.R @@ -32,7 +32,7 @@ #' # maximum subset #' model <- lm(mpg ~ disp + hp + drat + wt + qsec, data = mtcars) #' ols_step_best_subset(model, max_order = 3) -#' +#' #' # plot #' model <- lm(mpg ~ disp + hp + wt + qsec, data = mtcars) #' k <- ols_step_best_subset(model) @@ -50,8 +50,8 @@ ols_step_best_subset <- function(model, ...) UseMethod("ols_step_best_subset") #' @export #' @rdname ols_step_best_subset -#' -ols_step_best_subset.default <- function(model, max_order = NULL, +#' +ols_step_best_subset.default <- function(model, max_order = NULL, include = NULL, exclude = NULL, metric = c("rsquare", "adjr", "predrsq", "cp", "aic", "sbic", "sbc", @@ -77,7 +77,7 @@ ols_step_best_subset.default <- function(model, max_order = NULL, stop(paste(paste(exclude[!npm], collapse = ", "), "not part of the model and hence cannot be forcibly excluded. Please verify the variable names."), call. = FALSE) } } - + if (is.numeric(include)) { if (any(include > lenterms)) { stop(paste0("Index of variable to be included should be between 1 and ", lenterms, "."), call. = FALSE) @@ -88,7 +88,7 @@ ols_step_best_subset.default <- function(model, max_order = NULL, if (is.numeric(exclude)) { if (any(exclude > lenterms)) { - stop(paste0("Index of variable to be excluded should be between 1 and ", lenterms, "."), call. = FALSE) + stop(paste0("Index of variable to be excluded should be between 1 and ", lenterms, "."), call. = FALSE) } else { exclude <- indterms[exclude] } @@ -152,23 +152,23 @@ ols_step_best_subset.default <- function(model, max_order = NULL, lpreds <- c() for (i in seq_len(len_elig)) { - predictors <- predicts[[i]] - lp <- length(predictors) - out <- ols_regress(paste(response, "~", paste(predictors, collapse = " + ")), data = data) - mcount <- mcount + 1 - lpreds[mcount] <- lp - rsq[[mcount]] <- out$rsq - adjr[[mcount]] <- out$adjr - cp[[mcount]] <- ols_mallows_cp(out$model, model) - aic[[mcount]] <- ols_aic(out$model) - sbic[[mcount]] <- ols_sbic(out$model, model) - sbc[[mcount]] <- ols_sbc(out$model) - gmsep[[mcount]] <- ols_msep(out$model) - jp[[mcount]] <- ols_fpe(out$model) - pc[[mcount]] <- ols_apc(out$model) - sp[[mcount]] <- ols_hsp(out$model) - predrsq[[mcount]] <- ols_pred_rsq(out$model) - preds[[mcount]] <- paste(predictors, collapse = " ") + predictors <- predicts[[i]] + lp <- length(predictors) + out <- ols_regress(paste(response, "~", paste(predictors, collapse = " + ")), data = data) + mcount <- mcount + 1 + lpreds[mcount] <- lp + rsq[[mcount]] <- out$rsq + adjr[[mcount]] <- out$adjr + cp[[mcount]] <- ols_mallows_cp(out$model, model) + aic[[mcount]] <- ols_aic(out$model) + sbic[[mcount]] <- ols_sbic(out$model, model) + sbc[[mcount]] <- ols_sbc(out$model) + gmsep[[mcount]] <- ols_msep(out$model) + jp[[mcount]] <- ols_fpe(out$model) + pc[[mcount]] <- ols_apc(out$model) + sp[[mcount]] <- ols_hsp(out$model) + predrsq[[mcount]] <- ols_pred_rsq(out$model) + preds[[mcount]] <- paste(predictors, collapse = " ") } ui <- data.frame( @@ -197,13 +197,13 @@ ols_step_best_subset.default <- function(model, max_order = NULL, } else { temp <- lapply(l, function(x) x[order(x[[metrics]]), ][1, ]) } - + sorted <- do.call(rbind, temp) mindex <- seq_len(nrow(sorted)) sorted <- cbind(mindex, sorted) result <- list(metrics = sorted) class(result) <- c("ols_step_best_subset") - + return(result) } @@ -261,8 +261,8 @@ best_subset_plot <- function(d, var, title = "R-Square") { ggplot(d1, aes(x = a, y = b)) + geom_line(color = "blue") + geom_point(color = "blue", shape = 1, size = 2) + - xlab("") + - ylab("") + + xlab("") + + ylab("") + ggtitle(title) + theme(axis.ticks = element_blank()) diff --git a/R/ols-observed-vs-predicted-plot.R b/R/ols-observed-vs-predicted-plot.R index 7a5824f..aa99879 100644 --- a/R/ols-observed-vs-predicted-plot.R +++ b/R/ols-observed-vs-predicted-plot.R @@ -27,19 +27,20 @@ ols_plot_obs_fit <- function(model, print_plot = TRUE) { oname <- names(model.frame(model))[1] d <- obspred(model) + df <- data.frame(x1 = min(d$x), x2 = max(d$x), y1 = min(d$y), y2 = max(d$y)) p <- ggplot(d, aes(x = x, y = y)) + geom_point(color = "blue", shape = 1) + - geom_segment(data = d, aes(x = min(x), y = min(y), xend = max(x), - yend = max(y)), colour = "red") + + geom_segment(data = df, aes(x = x1, y = y1, xend = x2, + yend = y2), colour = "red") + geom_abline(intercept = 0, slope = 1, color = "blue") p <- p + ylab("Fitted Value") + xlab(paste(oname)) + - ggtitle(paste("Actual vs Fitted for", oname)) + ggtitle(paste("Actual vs Fitted for", oname)) if (print_plot) { print(p) diff --git a/R/ols-regress_compute.R b/R/ols-regress_compute.R index b182705..7bb88fc 100644 --- a/R/ols-regress_compute.R +++ b/R/ols-regress_compute.R @@ -1,5 +1,5 @@ #' @importFrom stats model.matrix confint.lm -#' @importFrom stats as.formula +#' @importFrom stats as.formula deviance reg_comp <- function(formula, data, conf.level = 0.95, iterm, title = "model") { model <- lm(formula = formula, data = data) @@ -20,7 +20,7 @@ reg_comp <- function(formula, data, conf.level = 0.95, iterm, title = "model") { sbic <- ols_sbic(model, model) prsq <- ols_pred_rsq(model) n <- length(anovam$Df) - mse <- anovam$`Mean Sq`[n] + mse <- mean(model$residuals ^ 2) error_df <- anovam$Df[n] model_df <- sum(anovam$Df) - error_df total_df <- sum(anovam$Df) diff --git a/R/olsrr.R b/R/olsrr.R index 27284cf..27ae4ee 100644 --- a/R/olsrr.R +++ b/R/olsrr.R @@ -20,5 +20,5 @@ if (getRversion() >= "2.15.1") { "txt", "cd", "fct_color", "ckd", "dbetas", "color", "pred", "ds", "dsr", "fstatistic", "hadi", "Df", "res", "pot", "lfit", "rerror", "ybar", "yhat", "predicted", "resid", "lev_thrsh", "leverage", "levrstud", - "sdres")) + "sdres", "x1", "x2", "y1", "y2")) } diff --git a/README.md b/README.md index 6f8cce1..6c3c633 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ ols_regress(model) #> Model Summary #> --------------------------------------------------------------- #> R 0.914 RMSE 2.409 -#> R-Squared 0.835 MSE 6.875 +#> R-Squared 0.835 MSE 5.801 #> Adj. R-Squared 0.811 Coef. Var 13.051 #> Pred R-Squared 0.771 AIC 159.070 #> MAE 1.858 SBC 167.864 diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..5d1c623 --- /dev/null +++ b/TODO.md @@ -0,0 +1,58 @@ +## New Features + +### Below functions are inspired from the insight package: + +- ols_get_formula(model) +- ols_get_interaction_terms(model) +- ols_get_terms(model) +- ols_get_data(model) +- ols_get_intercept(model) +- ols_get_matrix(model) +- ols_get_predicted(model) +- ols_get_residuals(model) +- ols_get_deviance(model) +- ols_get_parameters(model) +- ols_get_predictors(model) +- ols_get_response(model) +- ols_get_call(model) +- ols_get_obs(model) +- ols_has_intercept(model) + +### Below functions are inspired from the parameter package: + +- ols_get_pvalues(model) +- ols_get_se(model) +- ols_get_ci(model) + +### Below functions are inspired from the performance package: + +- ols_model_performance(model) +- ols_test_autocorrelation(model) +- ols_test_collinearity(model) +- ols_test_heteroskedasticity(model) +- ols_test_homogeneity(model) +- ols_test_model(model) +- ols_test_normality(model) +- ols_test_outliers(model) +- R2 functions + +### Compare models + +- compare multiple model + +### blorr + +- ols_model_fit_stats +- ols_test_lr +- ols_rsq_mcfadden +- ols_rsq_mcfadden_adj +- ols_rsq_cox_snell +- ols_rsq_nagelkerke +- ols_rsq_mckelvey_zavoina +- ols_rsq_effron +- ols_rsq_count +- ols_rsq_count_adj + +### Shiny + +- make shiny app similar to `shinyrfm` diff --git a/man/olsrr.Rd b/man/olsrr.Rd index 98e7e81..21b7921 100644 --- a/man/olsrr.Rd +++ b/man/olsrr.Rd @@ -3,7 +3,6 @@ \docType{package} \name{olsrr} \alias{olsrr} -\alias{_PACKAGE} \alias{olsrr-package} \title{\code{olsrr} package} \description{ diff --git a/revdep/README.md b/revdep/README.md index c0c7e87..2098b93 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,112 +1,102 @@ # Platform -|field |value | -|:--------|:-----------------------------------| -|version |R version 4.3.2 (2023-10-31 ucrt) | -|os |Windows 10 x64 (build 19045) | -|system |x86_64, mingw32 | -|ui |RStudio | -|language |(EN) | -|collate |English_India.utf8 | -|ctype |en_US.UTF-8 | -|tz |Asia/Calcutta | -|date |2024-02-12 | -|rstudio |2023.12.1+402 Ocean Storm (desktop) | -|pandoc |NA | +|field |value | +|:--------|:------------------------------------------| +|version |R version 4.4.1 (2024-06-14 ucrt) | +|os |Windows 10 x64 (build 19045) | +|system |x86_64, mingw32 | +|ui |RStudio | +|language |(EN) | +|collate |English_India.utf8 | +|ctype |en_US.UTF-8 | +|tz |Asia/Calcutta | +|date |2024-11-06 | +|rstudio |2024.09.0+375 Cranberry Hibiscus (desktop) | +|pandoc |NA | # Dependencies -|package |old |new |Δ | -|:------------|:----------|:----------|:--| -|olsrr |0.5.3 |0.6.0 |* | -|abind |1.4-5 |1.4-5 | | -|backports |1.4.1 |1.4.1 | | -|base64enc |NA |0.1-3 |* | -|brio |1.1.4 |1.1.4 | | -|broom |1.0.5 |1.0.5 | | -|bslib |NA |0.6.1 |* | -|cachem |NA |1.0.8 |* | -|callr |3.7.3 |3.7.3 | | -|car |3.1-2 |3.1-2 | | -|carData |3.0-5 |3.0-5 | | -|cli |3.6.2 |3.6.2 | | -|colorspace |2.1-0 |2.1-0 | | -|commonmark |NA |1.9.1 |* | -|cpp11 |0.4.7 |0.4.7 | | -|crayon |1.5.2 |1.5.2 | | -|data.table |1.15.0 |NA |* | -|desc |1.4.3 |1.4.3 | | -|diffobj |0.3.5 |0.3.5 | | -|digest |0.6.34 |0.6.34 | | -|dplyr |1.1.4 |1.1.4 | | -|ellipsis |0.3.2 |0.3.2 | | -|evaluate |0.23 |0.23 | | -|fansi |1.0.6 |1.0.6 | | -|farver |2.1.1 |2.1.1 | | -|fastmap |NA |1.1.1 |* | -|fontawesome |NA |0.5.2 |* | -|fs |1.6.3 |1.6.3 | | -|generics |0.1.3 |0.1.3 | | -|ggplot2 |3.4.4 |3.4.4 | | -|glue |1.7.0 |1.7.0 | | -|goftest |1.2-3 |1.2-3 | | -|gridExtra |2.3 |2.3 | | -|gtable |0.3.4 |0.3.4 | | -|htmltools |NA |0.5.7 |* | -|httpuv |NA |1.6.14 |* | -|isoband |0.2.7 |0.2.7 | | -|jquerylib |NA |0.1.4 |* | -|jsonlite |1.8.8 |1.8.8 | | -|labeling |0.4.3 |0.4.3 | | -|later |NA |1.3.2 |* | -|lifecycle |1.0.4 |1.0.4 | | -|lme4 |1.1-35.1 |1.1-35.1 | | -|magrittr |2.0.3 |2.0.3 | | -|MatrixModels |0.5-3 |0.5-3 | | -|memoise |NA |2.0.1 |* | -|mime |NA |0.12 |* | -|minqa |1.2.6 |1.2.6 | | -|munsell |0.5.0 |0.5.0 | | -|nloptr |2.0.3 |2.0.3 | | -|nortest |1.0-4 |1.0-4 | | -|numDeriv |2016.8-1.1 |2016.8-1.1 | | -|pbkrtest |0.5.2 |0.5.2 | | -|pillar |1.9.0 |1.9.0 | | -|pkgbuild |1.4.3 |1.4.3 | | -|pkgconfig |2.0.3 |2.0.3 | | -|pkgload |1.3.4 |1.3.4 | | -|praise |1.0.0 |1.0.0 | | -|processx |3.8.3 |3.8.3 | | -|promises |NA |1.2.1 |* | -|ps |1.7.6 |1.7.6 | | -|purrr |1.0.2 |1.0.2 | | -|quantreg |5.97 |5.97 | | -|R6 |2.5.1 |2.5.1 | | -|rappdirs |NA |0.3.3 |* | -|RColorBrewer |1.1-3 |1.1-3 | | -|Rcpp |1.0.12 |1.0.12 | | -|RcppEigen |0.3.3.9.4 |0.3.3.9.4 | | -|rematch2 |2.1.2 |2.1.2 | | -|rlang |1.1.3 |1.1.3 | | -|rprojroot |2.0.4 |2.0.4 | | -|sass |NA |0.4.8 |* | -|scales |1.3.0 |1.3.0 | | -|shiny |NA |1.8.0 |* | -|sourcetools |NA |0.1.7-1 |* | -|SparseM |1.81 |1.81 | | -|stringi |1.8.3 |1.8.3 | | -|stringr |1.5.1 |1.5.1 | | -|testthat |3.2.1 |3.2.1 | | -|tibble |3.2.1 |3.2.1 | | -|tidyr |1.3.1 |1.3.1 | | -|tidyselect |1.2.0 |1.2.0 | | -|utf8 |1.2.4 |1.2.4 | | -|vctrs |0.6.5 |0.6.5 | | -|viridisLite |0.4.2 |0.4.2 | | -|waldo |0.5.2 |0.5.2 | | -|withr |3.0.0 |3.0.0 | | -|xplorerr |NA |0.1.2 |* | -|xtable |NA |1.8-4 |* | +|package |old |new |Δ | +|:--------------|:----------|:----------|:--| +|olsrr |0.6.0 |0.6.1 |* | +|abind |1.4-8 |1.4-8 | | +|backports |1.5.0 |1.5.0 | | +|base64enc |0.1-3 |0.1-3 | | +|broom |1.0.7 |1.0.7 | | +|bslib |0.8.0 |0.8.0 | | +|cachem |1.1.0 |1.1.0 | | +|car |3.1-3 |3.1-3 | | +|carData |3.0-5 |3.0-5 | | +|cli |3.6.3 |3.6.3 | | +|colorspace |2.1-1 |2.1-1 | | +|commonmark |1.9.2 |1.9.2 | | +|cowplot |1.1.3 |1.1.3 | | +|cpp11 |0.5.0 |0.5.0 | | +|crayon |1.5.3 |1.5.3 | | +|Deriv |4.1.6 |4.1.6 | | +|digest |0.6.37 |0.6.37 | | +|doBy |4.6.24 |4.6.24 | | +|dplyr |1.1.4 |1.1.4 | | +|fansi |1.0.6 |1.0.6 | | +|farver |2.1.2 |2.1.2 | | +|fastmap |1.2.0 |1.2.0 | | +|fontawesome |0.5.2 |0.5.2 | | +|Formula |1.2-5 |1.2-5 | | +|fs |1.6.5 |1.6.5 | | +|generics |0.1.3 |0.1.3 | | +|ggplot2 |3.5.1 |3.5.1 | | +|glue |1.8.0 |1.8.0 | | +|goftest |1.2-3 |1.2-3 | | +|gridExtra |2.3 |2.3 | | +|gtable |0.3.6 |0.3.6 | | +|htmltools |0.5.8.1 |0.5.8.1 | | +|httpuv |1.6.15 |1.6.15 | | +|isoband |0.2.7 |0.2.7 | | +|jquerylib |0.1.4 |0.1.4 | | +|jsonlite |1.8.9 |1.8.9 | | +|labeling |0.4.3 |0.4.3 | | +|later |1.3.2 |1.3.2 | | +|lifecycle |1.0.4 |1.0.4 | | +|lme4 |1.1-35.5 |1.1-35.5 | | +|magrittr |2.0.3 |2.0.3 | | +|MatrixModels |0.5-3 |0.5-3 | | +|memoise |2.0.1 |2.0.1 | | +|microbenchmark |1.5.0 |1.5.0 | | +|mime |0.12 |0.12 | | +|minqa |1.2.8 |1.2.8 | | +|modelr |0.1.11 |0.1.11 | | +|munsell |0.5.1 |0.5.1 | | +|nloptr |2.1.1 |2.1.1 | | +|nortest |1.0-4 |1.0-4 | | +|numDeriv |2016.8-1.1 |2016.8-1.1 | | +|pbkrtest |0.5.3 |0.5.3 | | +|pillar |1.9.0 |1.9.0 | | +|pkgconfig |2.0.3 |2.0.3 | | +|promises |1.3.0 |1.3.0 | | +|purrr |1.0.2 |1.0.2 | | +|quantreg |5.99 |5.99 | | +|R6 |2.5.1 |2.5.1 | | +|rappdirs |0.3.3 |0.3.3 | | +|RColorBrewer |1.1-3 |1.1-3 | | +|Rcpp |1.0.13-1 |1.0.13-1 | | +|RcppEigen |0.3.4.0.2 |0.3.4.0.2 | | +|rlang |1.1.4 |1.1.4 | | +|sass |0.4.9 |0.4.9 | | +|scales |1.3.0 |1.3.0 | | +|shiny |1.9.1 |1.9.1 | | +|sourcetools |0.1.7-1 |0.1.7-1 | | +|SparseM |1.84-2 |1.84-2 | | +|stringi |1.8.4 |1.8.4 | | +|stringr |1.5.1 |1.5.1 | | +|tibble |3.2.1 |3.2.1 | | +|tidyr |1.3.1 |1.3.1 | | +|tidyselect |1.2.1 |1.2.1 | | +|utf8 |1.2.4 |1.2.4 | | +|vctrs |0.6.5 |0.6.5 | | +|viridisLite |0.4.2 |0.4.2 | | +|withr |3.0.2 |3.0.2 | | +|xplorerr |0.2.0 |0.2.0 | | +|xtable |1.8-4 |1.8-4 | | # Revdeps diff --git a/tests/testthat/_snaps/all-possible.md b/tests/testthat/_snaps/all-possible.md index 4f0c890..580ced7 100644 --- a/tests/testthat/_snaps/all-possible.md +++ b/tests/testthat/_snaps/all-possible.md @@ -4,7 +4,7 @@ ols_step_all_possible(model) Output 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 + 1 1 1 disp 0.7183433 0.7089548 4.443792 + 2 2 1 hp 0.6024373 0.5891853 17.794906 + 3 3 2 disp hp 0.7482402 0.7308774 3.000000 diff --git a/tests/testthat/_snaps/bp-output.md b/tests/testthat/_snaps/bp-output.md index 3ae4924..ebf5708 100644 --- a/tests/testthat/_snaps/bp-output.md +++ b/tests/testthat/_snaps/bp-output.md @@ -1,5 +1,4 @@ -# when fitted.values == TRUE, fitted values from the regression - are used for the test +# when fitted.values == TRUE, fitted vals from reg are used Code ols_test_breusch_pagan(model) diff --git a/tests/testthat/_snaps/regress-output.md b/tests/testthat/_snaps/regress-output.md index 5e1dadc..629729e 100644 --- a/tests/testthat/_snaps/regress-output.md +++ b/tests/testthat/_snaps/regress-output.md @@ -6,7 +6,7 @@ Model Summary --------------------------------------------------------------- R 0.909 RMSE 2.468 - R-Squared 0.827 MSE 6.964 + R-Squared 0.827 MSE 6.093 Adj. R-Squared 0.808 Coef. Var 13.135 Pred R-Squared 0.768 AIC 158.643 MAE 1.907 SBC 165.972 @@ -45,7 +45,7 @@ Model Summary --------------------------------------------------------------- R 0.909 RMSE 2.468 - R-Squared 0.827 MSE 6.964 + R-Squared 0.827 MSE 6.093 Adj. R-Squared 0.808 Coef. Var 13.135 Pred R-Squared 0.768 AIC 158.643 MAE 1.907 SBC 165.972 diff --git a/tests/testthat/_snaps/score-output.md b/tests/testthat/_snaps/score-output.md index 9299d6b..847471d 100644 --- a/tests/testthat/_snaps/score-output.md +++ b/tests/testthat/_snaps/score-output.md @@ -1,5 +1,4 @@ -# when fitted.values == TRUE, fitted values from the regression - are used for the test +# when fitted.values == TRUE, fitted vals from the reg are used Code ols_test_score(model) diff --git a/tests/testthat/_snaps/step-backward-output.md b/tests/testthat/_snaps/step-backward-output.md index e591565..0bfee0a 100644 --- a/tests/testthat/_snaps/step-backward-output.md +++ b/tests/testthat/_snaps/step-backward-output.md @@ -21,7 +21,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -100,7 +100,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -201,7 +201,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -258,7 +258,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -337,7 +337,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -488,7 +488,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 diff --git a/tests/testthat/_snaps/step-forward-output.md b/tests/testthat/_snaps/step-forward-output.md index 09966fd..8d8bc85 100644 --- a/tests/testthat/_snaps/step-forward-output.md +++ b/tests/testthat/_snaps/step-forward-output.md @@ -23,7 +23,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -106,7 +106,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -290,7 +290,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -348,7 +348,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -428,7 +428,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -578,7 +578,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 diff --git a/tests/testthat/_snaps/stepaic-b-output.md b/tests/testthat/_snaps/stepaic-b-output.md index 9efcc10..22eaa18 100644 --- a/tests/testthat/_snaps/stepaic-b-output.md +++ b/tests/testthat/_snaps/stepaic-b-output.md @@ -21,7 +21,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -100,7 +100,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -251,7 +251,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -309,7 +309,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -389,7 +389,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -556,7 +556,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -613,7 +613,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -693,7 +693,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -860,7 +860,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 diff --git a/tests/testthat/_snaps/stepaic-f-output.md b/tests/testthat/_snaps/stepaic-f-output.md index c417332..dc01451 100644 --- a/tests/testthat/_snaps/stepaic-f-output.md +++ b/tests/testthat/_snaps/stepaic-f-output.md @@ -23,7 +23,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -106,7 +106,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -290,7 +290,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -453,7 +453,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -512,7 +512,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -595,7 +595,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -779,7 +779,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -926,7 +926,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 @@ -984,7 +984,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -1067,7 +1067,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -1251,7 +1251,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -1398,7 +1398,7 @@ Model Summary ------------------------------------------------------------------- R 0.878 RMSE 188.249 - R-Squared 0.771 MSE 39053.801 + R-Squared 0.771 MSE 35437.709 Adj. R-Squared 0.753 Coef. Var 28.147 Pred R-Squared 0.695 AIC 730.924 MAE 140.619 SBC 742.858 diff --git a/tests/testthat/_snaps/stepwise-output.md b/tests/testthat/_snaps/stepwise-output.md index 2723cd4..e133e0d 100644 --- a/tests/testthat/_snaps/stepwise-output.md +++ b/tests/testthat/_snaps/stepwise-output.md @@ -23,7 +23,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -106,7 +106,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 @@ -213,7 +213,7 @@ Model Summary ------------------------------------------------------------------- R 0.884 RMSE 184.276 - R-Squared 0.781 MSE 38202.426 + R-Squared 0.781 MSE 33957.712 Adj. R-Squared 0.758 Coef. Var 27.839 Pred R-Squared 0.700 AIC 730.620 MAE 137.656 SBC 744.543 diff --git a/tests/testthat/_snaps/visual/diag-5.svg b/tests/testthat/_snaps/visual/diag-5.svg index d0d0098..9602e8c 100644 --- a/tests/testthat/_snaps/visual/diag-5.svg +++ b/tests/testthat/_snaps/visual/diag-5.svg @@ -60,37 +60,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/testthat/_snaps/visual/rpcplot-1.svg b/tests/testthat/_snaps/visual/rpcplot-1.svg index 9b643b4..9780455 100644 --- a/tests/testthat/_snaps/visual/rpcplot-1.svg +++ b/tests/testthat/_snaps/visual/rpcplot-1.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/visual/rpcplot-2.svg b/tests/testthat/_snaps/visual/rpcplot-2.svg index 45a04da..adc99d4 100644 --- a/tests/testthat/_snaps/visual/rpcplot-2.svg +++ b/tests/testthat/_snaps/visual/rpcplot-2.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/test-bp-output.R b/tests/testthat/test-bp-output.R index 5cc508b..6b09f56 100644 --- a/tests/testthat/test-bp-output.R +++ b/tests/testthat/test-bp-output.R @@ -1,4 +1,4 @@ -test_that("when fitted.values == TRUE, fitted values from the regression\n\tare used for the test", { +test_that("when fitted.values == TRUE, fitted vals from reg are used", { model <- lm(mpg ~ disp + hp + wt + drat + qsec, data = mtcars) expect_snapshot(ols_test_breusch_pagan(model)) expect_snapshot(ols_test_breusch_pagan(model, rhs = TRUE)) diff --git a/tests/testthat/test-score-output.R b/tests/testthat/test-score-output.R index 162f006..4e7e358 100644 --- a/tests/testthat/test-score-output.R +++ b/tests/testthat/test-score-output.R @@ -1,4 +1,4 @@ -test_that("when fitted.values == TRUE, fitted values from the regression\n\tare used for the test", { +test_that("when fitted.values == TRUE, fitted vals from the reg are used", { model <- lm(mpg ~ disp + hp + wt + drat + qsec, data = mtcars) expect_snapshot(ols_test_score(model)) expect_snapshot(ols_test_score(model, rhs = TRUE))