GenData | R Documentation |
Generates data from survival distributions as parameterized in this package, with optional non-informative random right censoring.
GenData(n, dist = "exp", theta = NULL, p = 0)
n |
Integer sample size. |
dist |
String, distribution name selected from among: "exp","gamma","gen-gamma","log-normal","weibull". |
theta |
Numeric parameter vector. Elements will vary according to the distribution. |
p |
Expected censoring proportion. |
The parameter vector theta should contain the following elements, in order, depending on the distribution:
Rate \lambda
.
Shape \alpha
, rate \lambda
.
Shape 1 \alpha
, shape 2 \beta
, rate \lambda
.
Locaion \mu
, scale \sigma
.
Shape \alpha
, rate \lambda
.
Data.frame including the observation times and status.
# Gamma event times with shape 2 and rate 2.
# Expected censoring proportion of 20%.
data <- GenData(n = 1e3, dist = "gamma", theta = c(2, 2), p = 0.20)
# Generalized gamma event times with shapes (2,3) and rate 1.
# Expected censoring proportion of 15%.
data <- GenData(n = 1e3, dist = "gen-gamma", theta = c(2, 3, 1), p = 0.15)
# Log-normal event times with location 0 and rate 1.
# Expected censoring proportion of 10%.
data <- GenData(n = 1e3, dist = "log-normal", theta = c(0, 1), p = 0.10)
# Weibull event times with shape 2 and rate 2.
# Expected censoring proportion of 5%.
data <- GenData(n = 1e3, dist = "weibull", theta = c(2, 2), p = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.