powered by
Generates data set from the proportional hazards regression model without or with contamination.
gen_data(n, beta, cont = 0, p.censor = 0)
number of observations.
vector of regression coefficients.
fraction of contaminated observations.
probability of censoring.
Data frame containing the following variables:
timevector of survival times.
statusvector of censoring status.
X1, X2, ...explanatory variables (their number is determined by the dimension of vector of regression coefficients).
# NOT RUN { if (interactive()) { gen_data(50, c(2,-2), cont = 0.05) } # } # NOT RUN { # }
Run the code above in your browser using DataLab