View source: R/iclogcondist_simulation.R
simulate_ic_data | R Documentation |
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.
simulate_ic_data(
n,
dist,
para1,
para2,
upper_bound = Inf,
C1_upper = 1,
case = 2,
rounding = FALSE,
round_digit = 4
)
n |
An integer specifying the number of observations to generate. |
dist |
A character string indicating the distribution to use for event times.
Options are |
para1 |
A numeric value representing the first parameter of the distribution:
|
para2 |
A numeric value representing the second parameter of the distribution:
|
upper_bound |
A numeric value specifying the upper bound for event times,
corresponding to a truncated distribution. Default is |
C1_upper |
A numeric value specifying the upper limit for the first censoring time |
case |
An integer specifying the censoring case to simulate:
|
rounding |
A logical value. If |
round_digit |
An integer specifying the number of digits for rounding when |
**Censoring Times**:
In case = 1
(current status), one censoring time is generated, where it follows U(0, C1_upper)
.
In case = 2
(case 2 interval censoring), two censoring times are generated:
C1
: sampled from U(0, C1_upper)
.
C2
: sampled from U(C1, min(upper_bound, 20))
.
**Distributions**:
**Weibull**: Parameterized by shape (para1
) and scale (para2
).
**Log-logistic**: Parameterized by shape (para1
) and scale (para2
).
**Log-normal**: Parameterized by mean (para1
) and standard deviation (para2
).
A matrix of interval-censored data where each row represents an interval (L, R] containing the unobserved event time.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.