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_('sample')
  else
    parboot <- qp$parbootstrap %>%
      group_by_(.dots = 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 Oct. 2, 2019, 5:03 p.m.