Provides goodness-of-fit tests for lifetime data collected under
complete sampling, progressive Type-II censoring, and Type-I/Type-II
hybrid censoring schemes. Users supply the observed (censored) data and
the assumed probability density/mass function, cumulative distribution
function, or survival function of the target model, and the package
returns the corresponding test statistic together with an asymptotic or
Monte Carlo p-value. Implements the spacings-based exponentiality test of
Balakrishnan, Ng and Kannan (2002, in "Goodness-of-Fit Tests and Model
Validity", Birkhauser, pp. 89-111) and its location-scale generalization
Balakrishnan, Ng and Kannan (2004)
The gofPHCS package provides goodness-of-fit testing procedures for lifetime data under various censoring schemes, including complete sampling, progressive Type-II censoring, and Type-I / Type-II hybrid censoring schemes.
# Install from source:
install.packages("gofPHCS_0.1.0.tar.gz", repos = NULL, type = "source")
library(gofPHCS)
# Create progressive Type-II censored data
x_obs <- c(0.19, 0.78, 0.96, 1.31, 1.73, 2.85, 3.01, 3.80)
R_plan <- c(0, 0, 3, 0, 3, 0, 0, 5)
cdata <- cens_data(x = x_obs, scheme = "progtypeII", R = R_plan)
# Define null distribution (exponential with rate 0.5)
dist <- make_distribution(cdf = function(x, rate) pexp(x, rate), params = c(rate = 0.5))
# Perform goodness-of-fit test
res <- gof_test(cdata, distribution = dist, statistic = "T", p.method = "asymptotic")
print(res)
Balakrishnan, N., Cramer, E., & Kundu, D. (2023). Hybrid Censoring Know-How: Designs and Implementations. Academic Press.