From bf4b8fffc8f2dbd6c4b568f836bf1260bcb9262e Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 25 Oct 2023 14:25:40 +0200 Subject: [PATCH] use better variable name --- R/binned_residuals.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/binned_residuals.R b/R/binned_residuals.R index d8444ee7d..8b5533bb0 100644 --- a/R/binned_residuals.R +++ b/R/binned_residuals.R @@ -133,7 +133,7 @@ binned_residuals <- function(model, n <- length(items) sdev <- stats::sd(y[items], na.rm = TRUE) - r <- switch(ci_type, + conf_int <- switch(ci_type, gaussian = stats::qnorm(c((1 - ci) / 2, (1 + ci) / 2), mean = ybar, sd = sdev / sqrt(n)), exact = { out <- stats::binom.test(sum(y0[items]), n)$conf.int @@ -143,7 +143,7 @@ binned_residuals <- function(model, }, boot = .boot_binned_ci(y[items], ci, iterations) ) - names(r) <- c("CI_low", "CI_high") + names(conf_int) <- c("CI_low", "CI_high") d0 <- data.frame( xbar = xbar, @@ -153,7 +153,7 @@ binned_residuals <- function(model, x.hi = model.range[2], se = stats::qnorm((1 + ci) / 2) * sdev / sqrt(n) ) - cbind(d0, rbind(r)) + cbind(d0, rbind(conf_int)) })) d <- do.call(rbind, d)