R/asymptotic.r

Defines functions check_asymptotic asymptotic

Documented in asymptotic

#' @examples
#' #----------------------------------------------------------------------------
#' # asymptotic() examples
#' #----------------------------------------------------------------------------
#' library(depower)
#'
#' set.seed(1234)
#' data <- sim_nb(
#'   n1 = 60,
#'   n2 = 40,
#'   mean1 = 10,
#'   ratio = 1.5,
#'   dispersion1 = 2,
#'   dispersion2 = 8
#' )
#'
#' data |>
#'   wald_test_nb(distribution = asymptotic())
#'
#' @name distribution
NULL

#' @export
#' @rdname distribution
asymptotic <- function() {
  list(
    distribution = "asymptotic",
    method = "asymptotic"
  )
}

check_asymptotic <- function(x) {
  if (!identical(x, asymptotic())) {
    stop(
      "Check argument 'distribution'. You must use 'distribution = depower::asymptotic()'."
    )
  }

  invisible(x)
}

Try the depower package in your browser

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

depower documentation built on Nov. 5, 2025, 5:21 p.m.