From 020f96b3af82127bc22b1ba6fc516e884bd010e5 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Wed, 30 Aug 2023 13:33:31 -0500 Subject: [PATCH] Add ci=0 or ci=FALSE --- R/confint.R | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/R/confint.R b/R/confint.R index 567375de2..9fb7ee507 100644 --- a/R/confint.R +++ b/R/confint.R @@ -47,13 +47,19 @@ confint.rxSolve <- function(object, parm = NULL, level = 0.95, ...) { by = .by ) class(.lst) <- "rxHidden" - if (!any(names(.stk) == "sim.id")) { - .ntot <- object$env$.args$nSub - if (.ntot == 1L && object$env$.args$nStud > 1L) { - .ntot <- object$env$.args$nStud + if (.ci ==0 || !any(names(.stk) == "sim.id")) { + if (any(names(.stk) == "sim.id")) { + .stk$id <- factor(paste(.stk$sim.id, .stk$id)) + .ntot <- length(levels(.stk$id)) + .stk$id <- as.integer(.stk$id) + } else { + .ntot <- object$env$.args$nSub + if (.ntot == 1L && object$env$.args$nStud > 1L) { + .ntot <- object$env$.args$nStud + } } if (.ci == 0 || .ntot < 2500) { - if (.ci == 0.0) { + if (.ci != 0.0) { .mwarn("in order to put confidence bands around the intervals, you need at least 2500 simulations") message("summarizing data...", appendLF = FALSE) }