Title: Simulate and Analyze Interval- and Mixed-Censored Survival Data
Version: 0.1.0
Description: Provides tools to simulate and analyze survival data with interval-, left-, right-, and uncensored observations under common parametric distributions, including "Weibull", "Exponential", "Log-Normal", "Log-Logistic", "Gamma", "Gompertz", "Normal", "Logistic", and "EMV". The package supports both direct maximum likelihood estimation and imputation-based methods, making it suitable for methodological research, simulation benchmarking, and teaching. A web-based companion app is also available for demonstration purposes.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.2
URL: https://github.com/jayarasan/simIC
BugReports: https://github.com/jayarasan/simIC/issues
NeedsCompilation: no
Packaged: 2025-07-29 04:30:24 UTC; user
Author: Jayanthi Arasan [aut, cre]
Maintainer: Jayanthi Arasan <jayanthi@upm.edu.my>
Repository: CRAN
Date/Publication: 2025-07-31 10:00:02 UTC

Imputation-Based MLE for Censored Data

Description

Estimates distribution parameters using imputed event times.

Usage

mle_imp(
  left,
  right,
  dist = "weibull",
  impute = c("midpoint", "random", "median", "harmonic_median", "geometric_median",
    "random_survival")
)

Arguments

left

Left bounds of censoring intervals

right

Right bounds of censoring intervals

dist

Distribution name (e.g. "weibull", "loglogistic", "EMV")

impute

Imputation method: "midpoint", "random", "median", "harmonic_median", "geometric_median", "random_survival"

Value

A list containing estimates, standard errors, and log-likelihood

Examples

# Simulate interval-censored data from a Weibull distribution
set.seed(123)
dat <- simIC(n = 100, dist = "weibull", shape = 1.5, scale = 5, width = 2,
             study_start = 1, study_end = 8, uncensored_tol = 0.1)

# Fit model using harmonic median imputation
fit <- mle_imp(left = dat$left, right = dat$right, dist = "weibull", impute = "harmonic_median")

# Inspect results
print(fit$estimates)
print(fit$logLik)
print(fit$converged)

Interval-Censored Maximum Likelihood Estimation

Description

Estimates distribution parameters by maximizing the interval-censored likelihood.

Usage

mle_int(left, right, dist)

Arguments

left

Left bounds of censoring intervals

right

Right bounds of censoring intervals

dist

Distribution name (e.g. "weibull", "loglogistic", "EMV")

Value

A list containing estimates, standard errors, log-likelihood, and convergence status

Examples

# Simulate data from a log-logistic distribution
set.seed(123)
data <- simIC(n = 100, dist = "loglogistic", shape = 1.5, scale = 5, width = 2,
              study_start = 1, study_end = 8, uncensored_tol = 0.1)
# Fit the model
fit <- mle_int(left = data$left, right = data$right, dist = "loglogistic")
print(fit$estimates)
print(fit$logLik)
print(fit$converged)

Simulate Interval-, Left-, Right-, and Uncensored Survival Data

Description

Simulates survival data with optional left-censoring, right-censoring, and uncensoring thresholds.

Usage

simIC(
  n = 100,
  dist = "weibull",
  shape = 2,
  scale = 1,
  meanlog = 0,
  sdlog = 1,
  location = 0,
  width = 1,
  visit_start = 0,
  study_start = NULL,
  study_end = NULL,
  uncensored_tol = 0.1
)

Arguments

n

Number of samples.

dist

Distribution name ("weibull", "exp", "lognormal", "loglogistic", "normal", "logistic", "EMV", "gamma", "gompertz").

shape, scale

Distribution parameters for applicable distributions.

meanlog, sdlog

For lognormal.

location

For normal, logistic, and EMV.

width

Visit interval width.

visit_start

First visit time.

study_start

Optional: left-censoring cutoff.

study_end

Optional: right-censoring cutoff.

uncensored_tol

Tolerance to treat (left, right) as exact event.

Value

A data frame with columns: id, left, right, true_time, censoring

Examples

# Simulate 100 survival times from a log-normal distribution
set.seed(123)
data <- simIC(n = 100, dist = "lognormal", meanlog = 1.5, sdlog = 0.5, width = 2,
              study_start = 1, study_end = 8, uncensored_tol = 0.1)
head(data)