Skip to content

Commit

Permalink
center CI
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 24, 2023
1 parent 038dcdd commit aaa8eb6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/binned_residuals.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ binned_residuals <- function(model,

r <- switch(ci_type,
gaussian = stats::qnorm(c((1 - ci) / 2, (1 + ci) / 2), mean = ybar, sd = sdev / sqrt(n)),
exact = stats:::binom.test(sum(y0[items]), n)$conf.int,
exact = {
out <- stats:::binom.test(sum(y0[items]), n)$conf.int
out <- out - (min(out) - ybar) - (diff(out) / 2)
out
},
boot = .boot_binned_ci(y[items], ci, iterations)
)
names(r) <- c("CI_low", "CI_high")
Expand Down

0 comments on commit aaa8eb6

Please sign in to comment.