rcensT1 {rcens}R Documentation

Generate Censoring Sample, Type I

Description

Generator of censored samples type I with right or left censoring, given a generator of samples of the distribution X (rdistrX) with parameters appended by the list param_X. In which, you can control the censorship time or the desired censorship percentage.

Usage

rcensT1(
  rdistrX,
  param_X,
  qdistrX = NULL,
  n = 10000,
  t_censored = -1,
  theta = 0.5,
  verbose = FALSE,
  right = TRUE
)

Arguments

rdistrX

sample generator of distribution X.
First argument number of samples, next arguments in param_X.

param_X

list with parameters of rdistrX function.

qdistrX

quantile function of X.

n

number of sample to create.

t_censored

time level censored.

theta

Desired censoring percentage.

verbose

if TRUE print a censoring percentage of new created database.

right

if TRUE create right-censored data, else create left-censored

Value

A list with sample data information:

sample_censored vector of censored sample
sample_uncensored vector of uncensored sample (original)
censored_indicator vector of 1 and 0 indicating whether the i-th sample is censored
1:= no censored, 0:= censored
censored_time vector of censorship time
n_censored number of censored samples

Author(s)

Daniel Saavedra Morales

See Also

rcensT2 for generate censorship sample type II.
rcensT3 for generate censorship sample type III
rcensI for generate interval censoring sample with random length interval
rcensIfix for generate interval censoring sample with fix length interval

Examples

## Example Exponential
## time censored

Data_T1 = rcensT1(rdistrX = rexp, param_X = list("rate" = 2),
                 n = 1e02, t_censored = 1)

## time censored estimate with desired censoring percentage.

Data_T1 = rcensT1(rdistrX = rexp, param_X = list("rate" = 2),
                 qdistrX = qexp, n = 1e02, theta = .8)

## Example with plot in examples_plot/Example_rcensT1_plot.R

[Package rcens version 0.1.1 Index]