R/thresholdsbootstrap.R

Defines functions thresholdsbootstrap

Documented in thresholdsbootstrap

#' Calculates bootstrap thresholds
#' \code{thresholdsbootstrap} calculates bootstrap thresholds
#' @keywords internal
#' @export
thresholdsbootstrap <- function(qp, prob = NULL, log = F) {
  if (is.null(prob)) stop('You need to specify the value of prob', call. = F)

  if (length(qp$groups) == 0)
    parboot <- qp$parbootstrap %>% group_by(pick(all_of("sample")))
  else
    parboot <- qp$parbootstrap %>%
      group_by(pick(all_of(c(qp$groups, "sample"))))

  allgroups <- as.character(groups(qp$curvesbootstrap))

  parboot %>% do(one_threshold(., prob, log, allgroups,
                    qp$funname, qp$guess, qp$lapses, qp$curvesbootstrap))
}

Try the quickpsy package in your browser

Any scripts or data that you put into this service are public.

quickpsy documentation built on March 11, 2026, 5:06 p.m.