sim.survdata {CPsurv}R Documentation

Simulate Survival Data with Change Point

Description

Simulates Weibull distributed survival data from a given data set with change point above which hazard rate is constant.

Usage

sim.survdata(time, event, changeP, shape, scale, censoring, censpoint,
  times.int, parametric)

Arguments

time

Numeric vector with survival times.

event

Numeric vector indicating censoring status; 0 = alive (censored), 1 = dead (uncensored). If missing, all observations are assumed to be uncensored.

changeP

Change point.

shape

Shape parameter of Weibull distribution.

scale

Scale parameter of Weibull distribution.

censoring

Logical; if TRUE, censored data are generated.

censpoint

Censoring point for Type I censoring.

times.int

Logical; if TRUE, returned survival times are integers.

parametric

Logical; if TRUE, survival times are generated parametrically by inverse transform sampling; otherwise Kaplan-Meier is used for simulation.

Value

A dataset with survival times and corresponding censoring status ('event').


[Package CPsurv version 1.0.0 Index]