R/PPER.R

Defines functions PPER

Documented in PPER

#' Proportion of Practically Equivalent Residuals
#'
#' @inheritParams basic_arguments
#' @param sigma Numeric
#' @param df Degrees of freedom. Used for t-distribution. Default is \code{Inf}
#'    which gives normal distribution by default
#'
#' @return Numeric
#' @export
#'
#' @examples
#' PPER(0.5, -1, 1)
PPER <- function(sigma, SESOI_lower = 0, SESOI_upper = 0, df = Inf) {
  higher <- 1 - stats::pt((SESOI_upper) / sigma, df = df)
  lower <- stats::pt((SESOI_lower) / sigma, df = df)
  PPER <- 1 - (higher + lower)

  return(PPER)
}
mladenjovanovic/bmbstats documentation built on Aug. 5, 2020, 4:20 p.m.