Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 5, 2023
2 parents 8bfbeb7 + 2fd9810 commit 034bd8e
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions R/1_model_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,10 @@ model_parameters.default <- function(model,
vcov = NULL,
vcov_args = NULL,
...) {
# sanity check for inputs
# validation check for inputs
.is_model_valid(model)

# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
# unsupported arguments will be removed from the argument list.
dots <- .check_dots(
dots = list(...),
Expand Down
2 changes: 1 addition & 1 deletion R/ci_generic.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
# for polr, we need to fix parameter names
params$Parameter <- gsub("Intercept: ", "", params$Parameter, fixed = TRUE)

# sanity check...
# validation check...
if (is.null(method)) {
method <- "wald"
}
Expand Down
4 changes: 2 additions & 2 deletions R/cluster_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ cluster_analysis <- function(x,
x <- as.data.frame(x)
}

# sanity check - needs data frame
# validation check - needs data frame
if (!is.data.frame(x)) {
insight::format_error("`x` needs to be a data frame.")
}

# sanity check - need at least two columns
# validation check - need at least two columns
if (ncol(x) < 2) {
insight::format_error("At least two variables required to compute a cluster analysis.")
}
Expand Down
2 changes: 1 addition & 1 deletion R/cluster_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ cluster_meta <- function(list_of_clusters, rownames = NULL, ...) {
x[[name]] <- solution
}

# Sanity check
# validation check
if (length(unique(lengths(x))) != 1) {
insight::format_error("The clustering solutions are not of equal lengths.")
}
Expand Down
2 changes: 1 addition & 1 deletion R/equivalence_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ equivalence_test.ggeffects <- function(x,

x <- .get_ggeffects_model(x)

# sanity check rope range
# validation check rope range
rule <- match.arg(tolower(rule), choices = c("bayes", "classic", "cet"))
range <- .check_rope_range(x, range, verbose)

Expand Down
2 changes: 1 addition & 1 deletion R/format_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ format_parameters.parameters_model <- function(model, ...) {
model <- .get_object(params)
}

# sanity check
# validation check
if (!is.null(model) && insight::is_regression_model(model) && !is.data.frame(model)) {
# get data, but exclude response - we have no need for that label
mf <- insight::get_data(model, source = "mf", verbose = FALSE)
Expand Down
2 changes: 1 addition & 1 deletion R/methods_BayesFactor.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ model_parameters.BFBayesFactor <- function(model,

out <- datawizard::remove_empty(out)

# sanity check: make sure BF column still exists,
# validation check: make sure BF column still exists,
# see https://github.com/easystats/correlation/issues/269
if (is.null(out$BF)) {
out$BF <- NA
Expand Down
8 changes: 4 additions & 4 deletions R/methods_betareg.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ model_parameters.betareg <- function(model,
drop = NULL,
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down Expand Up @@ -62,7 +62,7 @@ ci.betareg <- function(x,
component = "all",
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand All @@ -81,7 +81,7 @@ standard_error.betareg <- function(model,
component = "all",
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down Expand Up @@ -116,7 +116,7 @@ p_value.betareg <- function(model,
component = c("all", "conditional", "precision"),
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down
8 changes: 4 additions & 4 deletions R/methods_brglm2.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ model_parameters.bracl <- function(model,
drop = NULL,
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down Expand Up @@ -70,7 +70,7 @@ model_parameters.bracl <- function(model,

#' @export
ci.bracl <- function(x, ci = 0.95, method = NULL, verbose = TRUE, ...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand All @@ -90,7 +90,7 @@ ci.bracl <- function(x, ci = 0.95, method = NULL, verbose = TRUE, ...) {

#' @export
standard_error.bracl <- function(model, verbose = TRUE, ...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand All @@ -115,7 +115,7 @@ standard_error.bracl <- function(model, verbose = TRUE, ...) {

#' @export
p_value.bracl <- function(model, verbose = TRUE, ...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down
2 changes: 1 addition & 1 deletion R/methods_cgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ model_parameters.cgam <- function(model,
drop = NULL,
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args", "component"),
Expand Down
4 changes: 2 additions & 2 deletions R/methods_glmmTMB.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ model_parameters.glmmTMB <- function(model,
...) {
insight::check_if_installed("glmmTMB")

# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down Expand Up @@ -268,7 +268,7 @@ ci.glmmTMB <- function(x,
return(NULL)
}

# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down
2 changes: 1 addition & 1 deletion R/methods_hglm.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ standard_error.hglm <- function(model,
return(NULL)
}

# sanity check, make sure we have a dispersion component
# validation check, make sure we have a dispersion component
if (component == "all" && is.null(f$dispersion)) {
compomnent <- "conditional"
}
Expand Down
2 changes: 1 addition & 1 deletion R/methods_mice.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ model_parameters.mipo <- function(model,
drop = NULL,
verbose = TRUE,
...) {
# sanity check, warn if unsupported argument is used.
# validation check, warn if unsupported argument is used.
dot_args <- .check_dots(
dots = list(...),
not_allowed = c("vcov", "vcov_args"),
Expand Down
2 changes: 1 addition & 1 deletion R/pool_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pool_parameters <- function(x,
df_column <- grep("(\\bdf\\b|\\bdf_error\\b)", colnames(i), value = TRUE)[1]
if (length(df_column)) {
pooled_df <- .barnad_rubin(m = nrow(i), b = stats::var(i$Coefficient), t = tmp, dfcom = unique(i[[df_column]]))
# sanity check length
# validation check length
if (length(pooled_df) > 1 && length(pooled_se) == 1) {
pooled_df <- round(mean(pooled_df, na.rm = TRUE))
}
Expand Down
4 changes: 2 additions & 2 deletions R/standardize_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ standardize_info.default <- function(model,
data <- insight::get_data(model, source = "mf", verbose = FALSE)
wgts <- insight::get_weights(model, na_rm = TRUE)

# Sanity Check for ZI
# validation check for ZI
if (mi$is_zero_inflated && verbose) {
insight::format_alert(
"Non-refit parameter standardization is ignoring the zero-inflation component."
)
# would need to also get the binomial model matrix...
}

# Sanity Check for glmmTMB with dispersion
# validation check for glmmTMB with dispersion
if (length(params) != nrow(types)) {
types <- types[types$Parameter %in% params, ]
}
Expand Down
2 changes: 1 addition & 1 deletion R/standardize_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ print_html.parameters_standardized <- function(x, digits = 2, ...) {
exponentiate,
include_response,
verbose) {
# Sanity Check for "pseudo"
# validation check for "pseudo"
method <- .should_pseudo(method, model, mi)

method <- .cant_smart_or_posthoc(method, model, mi, pars$Parameter)
Expand Down
2 changes: 1 addition & 1 deletion R/standardize_posteriors.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ standardise_posteriors <- standardize_posteriors

#' @keywords internal
.standardize_posteriors_posthoc <- function(pars, method, model, mi, robust, two_sd, include_response, verbose) {
# Sanity Check for "pseudo"
# validation check for "pseudo"
method <- .should_pseudo(method, model)

method <- .cant_smart_or_posthoc(method, model, mi, pars$Parameter)
Expand Down
4 changes: 2 additions & 2 deletions R/utils_format.R
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@
i
})

# sanity check - check if all parameter names in the
# validation check - check if all parameter names in the
# group list are spelled correctly
misspelled <- vapply(group_rows, anyNA, TRUE)

Expand Down Expand Up @@ -926,7 +926,7 @@
# make sure we have correct sorting here...
tables <- split(x, f = split_by)

# sanity check - only preserve tables with any data in data frames
# validation check - only preserve tables with any data in data frames
tables <- tables[vapply(tables, nrow, numeric(1)) > 0]


Expand Down
2 changes: 1 addition & 1 deletion WIP/extract_random_variances.R
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@
# anything missing? (i.e. correlated slope-intercept slopes)
missig_rnd_slope <- setdiff(names(out), names(rndslopes))
if (length(missig_rnd_slope)) {
# sanity check
# validation check
to_remove <- c()
for (j in seq_along(out)) {
# identical random slopes might have different names, so
Expand Down

0 comments on commit 034bd8e

Please sign in to comment.