simulate_ic_data {iclogcondist}R Documentation

Simulate Interval-Censored Data

Description

This function generates interval-censored data, where the event times are generated from one of the following distributions: Weibull, log-normal and log-logistic. It supports both case 1 and case 2 interval censoring.

Usage

simulate_ic_data(
  n,
  dist,
  para1,
  para2,
  upper_bound = Inf,
  C1_upper = 1,
  case = 2,
  rounding = FALSE,
  round_digit = 4
)

Arguments

n

An integer specifying the number of observations to generate.

dist

A character string indicating the distribution to use for event times. Options are "lognormal", "weibull", or "loglogistic".

para1

A numeric value representing the first parameter of the distribution:

  • "lognormal": Mean of the log-normal distribution (meanlog).

  • "weibull" and "loglogistic": Shape parameter.

para2

A numeric value representing the second parameter of the distribution:

  • "lognormal": Standard deviation of the log-normal distribution (sdlog).

  • "weibull" and "loglogistic": Scale parameter.

upper_bound

A numeric value specifying the upper bound for event times, corresponding to a truncated distribution. Default is Inf.

C1_upper

A numeric value specifying the upper limit for the first censoring time C1. Default is 1.

case

An integer specifying the censoring case to simulate:

  • 1: Current status (case 1 interval censoring)

  • 2: Case 2 Interval censoring

rounding

A logical value. If TRUE, generated times are rounded to a specified number of decimal places. Default is FALSE.

round_digit

An integer specifying the number of digits for rounding when rounding = TRUE. Default is 4.

Details

Value

A matrix of interval-censored data where each row represents an interval (L, R] containing the unobserved event time.

Examples

# Simulate data with a truncated Weibull distribution and case II interval censoring
simulate_ic_data(n = 100, dist = "weibull", para1 = 2, para2 = 1, upper_bound = 5, case = 2)

[Package iclogcondist version 1.0.1 Index]