Description Usage Arguments Details Value See Also Examples
Random survival times generation for the weibull or log-logistic distributions with parameters 'scale' and 'shape'.
1 2 3 4 5 6 7 8 9 10 11 |
n |
integer; sample size |
beta |
vector of regression coefficients |
event_scale, censor_scale |
event and censoring scale parameters |
features |
matrix of features (columns) |
shape |
event and censoring distribution shape |
model |
either "ph" (default) or "aft" for weibull and "po" or "aft" for log-logistic distribution |
dist |
"weibull" or "llogis" |
censor |
logical; if 'TRUE', censoring is required, that is mean(status) > 0 |
sim_surv returns weibull (log-logistic) randomly generated survival times. According to Collett (2003), the accelerated failure time model encompasses a wide variety of parametric models, including weibull and log-logistic models.
data.frame of 'ncol(x) +2' columns in which the survival times are the response variable denoted by 'y', 'status' indicates failure (0 = failure) and the features are appended to the next columns.
1 2 3 4 5 6 7 8 9 10 11 | rows <- 200
categorical <- rbinom(rows, size = 3, prob = .5)
x <- data.frame(numerical = rnorm(rows),
cat0 = as.numeric(categorical == 0),
cat1 = as.numeric(categorical == 1),
cat2 = as.numeric(categorical == 2),
cat3 = as.numeric(categorical == 3))
newdata <- itsamp(n = rows, beta = c(1, -2, .5, .1, 1),
features = x, model = 'ph', dist = 'weibull')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.