Description Usage Arguments Value References Examples
This function simulates univariate survival data from a piecewise exponential model with a proportional hazards assumption given a covariate matrix, true beta vector, baseline hazard splits, baseline hazard heights and a right censoring time.
1 | SimUNIVPiecewise(x1, beta1, s1, lam1, cens)
|
x1 |
- Matrix of patient covariates for hazard 1 simulation |
beta1 |
- vector of size ncol(x1) that is the true regression coefficient vector for the baseline hazard function |
s1 |
- vector of size at least length 2, where the first entry is 0. This characterizes the split point locations of baseline hazard |
lam1 |
- vector of the same size as s1. This vector is the true baseline hazard heights and the last entry represents the height on the interval [max(s1),infinity) |
cens |
- This is the administrative right censoring time of the study. All patients who have survival outcomes after cens have survival times set to cens. |
Returns a list of size 4 containing the semi-competing risks simulated data. Entry 1 contains the non-terminal event times for the patients. Entry 2 contains the terminal event times for the patients. Entry 3 contains the patient indicators for whether or not a patient experienced a non-terminal event prior to death. Entry 4 contains the patient indicators for whether or not they experienced a terminal event.
Lee, K. H., Haneuse, S., Schrag, D. and Dominici, F. (2015), Bayesian semiparametric analysis of semicompeting risks data: investigating hospital readmission after a pancreatic cancer diagnosis. Journal of the Royal Statistical Society: Series C (Applied Statistics), 64: 253-273.
1 2 3 4 5 6 7 8 9 10 11 12 | ##Set number of patients and covariate matrices
n=100
x1=matrix(rnorm(n*10,0,1),nrow=n)
##Sets up true covariate vector
beta1=rnorm(10,0,1)
##Sets up true baseline hazard split locations
s1=c(0,7,30,100,1000)
##Sets up baseline hazard heights
lam1=c(.1,.1,.3,.1,.1)
##Runs Function and returns a list of simulated data
X=SimUNIVPiecewise(x1,beta1,s1,lam1,1000)
X
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.