plot_compare_mds_ssp: Plot MDS and SSP Sample Size Comparison

View source: R/rMDSPTT.R

plot_compare_mds_sspR Documentation

Plot MDS and SSP Sample Size Comparison

Description

Produces a base R plot comparing MDS and SSP sample sizes against the termination ratio.

Usage

plot_compare_mds_ssp(x, ...)

Arguments

x

Output from 'compare_mds_ssp()'.

...

Additional graphical arguments passed to 'plot()'.

Details

Since ASN equals sample size for both plans, the same plot also represents the ASN comparison.

Value

Invisibly returns the supplied data frame.

Examples


# ----------------------------------------------------------
# Example 1: User-defined failure probabilities
# ----------------------------------------------------------

p <- c(0.05, 0.10, 0.15, 0.20)
a <- c(0.5, 1, 1.5, 2)

result <- compare_mds_ssp(
  p = p,
  a = a,
  b = 1,
  i = 3,
  beta = 0.25,
  c1 = 0,
  c2 = 1
)

plot_compare_mds_ssp(result)

# ----------------------------------------------------------
# Example 2: Generalized Exponential distribution
# ----------------------------------------------------------

alpha <- 2
b <- 1
a <- c(0.5, 0.75, 1, 1.25, 1.5, 1.75, 2)
p <- (1- exp(-a / b))^alpha
result <- compare_mds_ssp(
 p = p,
 a = a,
 b = 1,
 i = 3,
 beta = 0.25,
 c1 = 0,
 c2 = 1
)
plot_compare_mds_ssp(result)

rMDSPTT documentation built on Oct. 2, 2026, 5:09 p.m.