diff --git a/R/check_distribution.R b/R/check_distribution.R index 77cc19db6..fed30eb1f 100644 --- a/R/check_distribution.R +++ b/R/check_distribution.R @@ -192,23 +192,23 @@ check_distribution.numeric <- function(model) { x <- x[!is.na(x)] data.frame( - "SD" = stats::sd(x), - "MAD" = stats::mad(x, constant = 1), - "Mean_Median_Distance" = mean(x) - stats::median(x), - "Mean_Mode_Distance" = mean(x) - as.numeric(bayestestR::map_estimate(x, bw = "nrd0")), - "SD_MAD_Distance" = stats::sd(x) - stats::mad(x, constant = 1), - "Var_Mean_Distance" = stats::var(x) - mean(x), - "Range_SD" = diff(range(x)) / stats::sd(x), - "Range" = diff(range(x)), - "IQR" = stats::IQR(x), - "Skewness" = .skewness(x), - "Kurtosis" = .kurtosis(x), - "Uniques" = length(unique(x)) / length(x), - "N_Uniques" = length(unique(x)), - "Min" = min(x), - "Max" = max(x), - "Proportion_Positive" = sum(x >= 0) / length(x), - "Integer" = all(.is_integer(x)) + SD = stats::sd(x), + MAD = stats::mad(x, constant = 1), + Mean_Median_Distance = mean(x) - stats::median(x), + Mean_Mode_Distance = mean(x) - as.numeric(bayestestR::map_estimate(x, bw = "nrd0")), + SD_MAD_Distance = stats::sd(x) - stats::mad(x, constant = 1), + Var_Mean_Distance = stats::var(x) - mean(x), + Range_SD = diff(range(x)) / stats::sd(x), + Range = diff(range(x)), + IQR = stats::IQR(x), + Skewness = .skewness(x), + Kurtosis = .kurtosis(x), + Uniques = length(unique(x)) / length(x), + N_Uniques = length(unique(x)), + Min = min(x), + Max = max(x), + Proportion_Positive = sum(x >= 0) / length(x), + Integer = all(.is_integer(x)) ) } diff --git a/R/icc.R b/R/icc.R index 9155a7f40..16821e85f 100644 --- a/R/icc.R +++ b/R/icc.R @@ -353,8 +353,8 @@ variance_decomposition <- function(model, result <- structure( class = "icc_decomposed", list( - "ICC_decomposed" = 1 - fun(var_icc), - "ICC_CI" = ci_icc + ICC_decomposed = 1 - fun(var_icc), + ICC_CI = ci_icc ) ) diff --git a/R/model_performance.bayesian.R b/R/model_performance.bayesian.R index 64b227011..576c8abcd 100644 --- a/R/model_performance.bayesian.R +++ b/R/model_performance.bayesian.R @@ -253,7 +253,7 @@ model_performance.BFBayesFactor <- function(model, out <- list() attri <- list() - if ("R2" %in% c(metrics)) { + if ("R2" %in% metrics) { r2 <- r2_bayes(model, average = average, prior_odds = prior_odds, verbose = verbose) attri$r2_bayes <- attributes(r2) # save attributes