diff --git a/R/check_distribution.R b/R/check_distribution.R index e43b28036..9aa1b244a 100644 --- a/R/check_distribution.R +++ b/R/check_distribution.R @@ -191,7 +191,7 @@ check_distribution.numeric <- function(model) { # utilities ----------------------------- .extract_features <- function(x) { - # sanity check, remove missings + # validation check, remove missings x <- x[!is.na(x)] data.frame( diff --git a/R/check_factorstructure.R b/R/check_factorstructure.R index 911fca434..691bce154 100644 --- a/R/check_factorstructure.R +++ b/R/check_factorstructure.R @@ -120,7 +120,7 @@ check_factorstructure <- function(x, n = NULL, ...) { #' @rdname check_factorstructure #' @export check_kmo <- function(x, n = NULL, ...) { - out <- .check_factor_structure_sanity(x, n, ...) + out <- .validate_factor_structure(x, n, ...) Q <- solve(out$r) @@ -177,7 +177,7 @@ check_kmo <- function(x, n = NULL, ...) { #' @rdname check_factorstructure #' @export check_sphericity_bartlett <- function(x, n = NULL, ...) { - out <- .check_factor_structure_sanity(x, n, ...) + out <- .validate_factor_structure(x, n, ...) p <- dim(out$r)[2] @@ -221,7 +221,7 @@ check_sphericity_bartlett <- function(x, n = NULL, ...) { # Helpers ----------------------------------------------------------------- #' @keywords internal -.check_factor_structure_sanity <- function(x, n = NULL, ...) { +.validate_factor_structure <- function(x, n = NULL, ...) { if (is.null(n)) { r <- stats::cor(x, use = "pairwise.complete.obs", ...) n <- nrow(x) @@ -229,7 +229,6 @@ check_sphericity_bartlett <- function(x, n = NULL, ...) { r <- x } - # Sanity check if (nrow(r) != ncol(r)) { insight::format_error("The correlation matrix is not square.") } diff --git a/R/check_model_diagnostics.R b/R/check_model_diagnostics.R index 46a64f9c2..c6f91a655 100644 --- a/R/check_model_diagnostics.R +++ b/R/check_model_diagnostics.R @@ -67,7 +67,7 @@ fitted_ <- stats::fitted(model) } - # sanity check, sometimes either residuals or fitted can contain NA, see #488 + # validation check, sometimes either residuals or fitted can contain NA, see #488 if (anyNA(res_) || anyNA(fitted_)) { # drop NA and make sure both fitted and residuals match non_na <- !is.na(fitted_) & !is.na(res_) diff --git a/R/check_outliers.R b/R/check_outliers.R index e98e037c0..9f147cb83 100644 --- a/R/check_outliers.R +++ b/R/check_outliers.R @@ -1808,7 +1808,7 @@ check_outliers.metabin <- check_outliers.metagen # Get results cutoff <- .safe(outliers@ics.dist.cutoff) - # sanity check + # validation check if (is.null(cutoff)) { insight::print_color("Could not detect cut-off for outliers.\n", "red") return(NULL) diff --git a/R/check_predictions.R b/R/check_predictions.R index d52b8378a..832f9cc87 100644 --- a/R/check_predictions.R +++ b/R/check_predictions.R @@ -193,7 +193,7 @@ pp_check.lm <- function(object, # else, proceed as usual out <- .safe(stats::simulate(object, nsim = iterations, re.form = re_formula, ...)) - # sanity check, for mixed models, where re.form = NULL (default) might fail + # validation check, for mixed models, where re.form = NULL (default) might fail out <- .check_re_formula(out, object, iterations, re_formula, verbose, ...) # save information about model @@ -270,7 +270,7 @@ pp_check.glm <- function(object, } ) - # sanity check, for mixed models, where re.form = NULL (default) might fail + # validation check, for mixed models, where re.form = NULL (default) might fail out <- .check_re_formula(out, object, iterations, re_formula, verbose, ...) if (is.null(out)) { @@ -444,7 +444,7 @@ plot.performance_pp_check <- function(x, ...) { .check_re_formula <- function(out, object, iterations, re_formula, verbose, ...) { - # sanity check, for mixed models, where re.form = NULL (default) might fail + # validation check, for mixed models, where re.form = NULL (default) might fail if (is.null(out) && insight::is_mixed_model(object) && !isTRUE(is.na(re_formula))) { if (verbose) { insight::format_warning( diff --git a/R/check_sphericity.R b/R/check_sphericity.R index a087a1a5f..6df73d032 100644 --- a/R/check_sphericity.R +++ b/R/check_sphericity.R @@ -67,7 +67,7 @@ check_sphericity.Anova.mlm <- function(x, ...) { p.val <- test[, 2] - # sanity check + # validation check if (is.null(p.val)) { p.val <- 1 } diff --git a/R/icc.R b/R/icc.R index 16821e85f..46c1a331a 100644 --- a/R/icc.R +++ b/R/icc.R @@ -267,7 +267,7 @@ icc <- function(model, # CI for adjusted ICC icc_ci_adjusted <- as.vector(result$t[, 1]) icc_ci_adjusted <- icc_ci_adjusted[!is.na(icc_ci_adjusted)] - # sanity check + # validation check if (length(icc_ci_adjusted) > 0) { icc_ci_adjusted <- bayestestR::eti(icc_ci_adjusted, ci = ci) } else { @@ -276,7 +276,7 @@ icc <- function(model, # CI for unadjusted ICC icc_ci_unadjusted <- as.vector(result$t[, 2]) icc_ci_unadjusted <- icc_ci_unadjusted[!is.na(icc_ci_unadjusted)] - # sanity check + # validation check if (length(icc_ci_unadjusted) > 0) { icc_ci_unadjusted <- bayestestR::eti(icc_ci_unadjusted, ci = ci) } else { diff --git a/R/r2_nakagawa.R b/R/r2_nakagawa.R index 9b751c843..3e72a9457 100644 --- a/R/r2_nakagawa.R +++ b/R/r2_nakagawa.R @@ -136,7 +136,7 @@ r2_nakagawa <- function(model, # CI for marginal R2 r2_ci_marginal <- as.vector(result$t[, 1]) r2_ci_marginal <- r2_ci_marginal[!is.na(r2_ci_marginal)] - # sanity check + # validation check if (length(r2_ci_marginal) > 0) { r2_ci_marginal <- bayestestR::eti(r2_ci_marginal, ci = ci) } else { @@ -146,7 +146,7 @@ r2_nakagawa <- function(model, # CI for unadjusted R2 r2_ci_conditional <- as.vector(result$t[, 2]) r2_ci_conditional <- r2_ci_conditional[!is.na(r2_ci_conditional)] - # sanity check + # validation check if (length(r2_ci_conditional) > 0) { r2_ci_conditional <- bayestestR::eti(r2_ci_conditional, ci = ci) } else { diff --git a/R/test_bf.R b/R/test_bf.R index b50f0f652..60cb3a129 100644 --- a/R/test_bf.R +++ b/R/test_bf.R @@ -12,7 +12,7 @@ test_bf.default <- function(..., reference = 1, text_length = NULL) { objects <- insight::ellipsis_info(..., only_models = TRUE) names(objects) <- match.call(expand.dots = FALSE)$`...` - # Sanity checks (will throw error if non-valid objects) + # validation checks (will throw error if non-valid objects) .test_performance_checks(objects, multiple = FALSE) if (length(objects) == 1 && isTRUE(insight::is_model(objects))) { diff --git a/R/test_likelihoodratio.R b/R/test_likelihoodratio.R index 5b0a532eb..9784b13a9 100644 --- a/R/test_likelihoodratio.R +++ b/R/test_likelihoodratio.R @@ -24,7 +24,7 @@ test_likelihoodratio.default <- function(..., estimator = "OLS", verbose = TRUE) # Attribute class to list objects <- insight::ellipsis_info(..., only_models = TRUE) - # Sanity checks (will throw error if non-valid objects) + # validation checks (will throw error if non-valid objects) objects <- .test_performance_checks(objects, verbose = verbose) # different default when mixed model or glm is included diff --git a/R/test_performance.R b/R/test_performance.R index 4ad0c18f2..b643143f7 100644 --- a/R/test_performance.R +++ b/R/test_performance.R @@ -238,7 +238,7 @@ test_performance.default <- function(..., reference = 1, include_formula = FALSE # Attribute class to list and get names from the global environment objects <- insight::ellipsis_info(..., only_models = TRUE) - # Sanity checks (will throw error if non-valid objects) + # validation checks (will throw error if non-valid objects) objects <- .test_performance_checks(objects, verbose = verbose) # ensure proper object names diff --git a/R/test_vuong.R b/R/test_vuong.R index 949fceab7..449f55ddb 100644 --- a/R/test_vuong.R +++ b/R/test_vuong.R @@ -10,7 +10,7 @@ test_vuong.default <- function(..., reference = 1, verbose = TRUE) { # Attribute class to list and get names from the global environment objects <- insight::ellipsis_info(..., only_models = TRUE) - # Sanity checks (will throw error if non-valid objects) + # validation checks (will throw error if non-valid objects) objects <- .test_performance_checks(objects, verbose = verbose) # ensure proper object names diff --git a/R/test_wald.R b/R/test_wald.R index 8a5efd99c..0e043502a 100644 --- a/R/test_wald.R +++ b/R/test_wald.R @@ -10,7 +10,7 @@ test_wald.default <- function(..., verbose = TRUE) { # Attribute class to list and get names from the global environment objects <- insight::ellipsis_info(..., only_models = TRUE) - # Sanity checks (will throw error if non-valid objects) + # validation checks (will throw error if non-valid objects) objects <- .test_performance_checks(objects, verbose = verbose) # ensure proper object names