plot_single_asip: Plot Sample Size Against Termination Ratio

View source: R/rSSP.R

plot_single_asipR Documentation

Plot Sample Size Against Termination Ratio

Description

Calculates the minimum sample size for different termination ratios and plots the resulting sample size against the termination ratio.

Usage

plot_single_asip(p, a, b = 1, be = 0.25, c = 0, ylim = c(0, 50))

Arguments

p

User-defined probability of failure corresponding to each termination ratio.

a

Numeric vector of termination ratios.

b

Quality ratio. It may be a single value or a vector having the same length as a.

be

Producer's risk.

c

Acceptance number.

ylim

Numeric vector of length two specifying the limits of the y-axis. Default is c(0, 50).

Details

The user supplies the corresponding values of p calculated from their own lifetime distribution.

Value

A data frame containing a, b, p and the required sample size n.

Examples


# Example 1: User-defined failure probabilities
p <- c(0.05, 0.10, 0.15, 0.20)

plot_single_asip(
  p = p,
  a = c(0.5, 1, 1.5, 2),
  b = 1,
  be = 0.25,
  c = 0,
  ylim=c(0,50)
)

# Example 2: Failure probabilities obtained from
# a Burr Type X lifetime distribution

al <- 0.5
b <- 1
a <- c(0.4, 0.6, 0.8, 1, 1.5, 2, 2.5, 3)

h <- sqrt(
  -log(
    1 - (1/2)^(1/al)
  )
)

p <- (1 - exp(-(a * h / b)^2))^al

plot_single_asip(
  p = p,
  a = a,
  b = b,
  be = 0.25,
  c = 6,
  ylim = c(0, 50)
)


rSSP documentation built on Sept. 15, 2026, 1:09 a.m.

Related to plot_single_asip in rSSP...