From f841500b88e7e0a1470755f951b5dc1d74c3fb77 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 28 Feb 2022 22:21:34 +0100 Subject: [PATCH] #376 --- R/binned_residuals.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/binned_residuals.R b/R/binned_residuals.R index c33f1b6df..edd189384 100644 --- a/R/binned_residuals.R +++ b/R/binned_residuals.R @@ -94,6 +94,10 @@ binned_residuals <- function(model, term = NULL, n_bins = NULL, ...) { d <- do.call(rbind, d) d <- d[stats::complete.cases(d), ] + # CIs + d$CI_low <- d$ybar - stats::qnorm(.975) * d$se + d$CI_high <- d$ybar + stats::qnorm(.975) * d$se + gr <- abs(d$ybar) > abs(d$se) d$group <- "yes" d$group[gr] <- "no"