gen_data: Generate Data from the Proportional Hazards Regression Model

View source: R/gen_data.R

gen_dataR Documentation

Generate Data from the Proportional Hazards Regression Model

Description

Generates data set from the proportional hazards regression model without or with contamination.

Usage

gen_data(n, beta, cont = 0, p.censor = 0)

Arguments

n

number of observations.

beta

vector of regression coefficients.

cont

fraction of contaminated observations.

p.censor

probability of censoring.

Value

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).

Examples



if (interactive()) {
gen_data(50, c(2,-2), cont = 0.05)
}




coxrobust documentation built on April 6, 2022, 5:06 p.m.