Skip to content

Commit

Permalink
use better variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 25, 2023
1 parent 9aa5922 commit bf4b8ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/binned_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit bf4b8ff

Please sign in to comment.