rcensT3 {rcens}R Documentation

Generate Censoring Sample,Type III (Random)

Description

Generator of censored samples type III with right or left censoring, given a generator of samples of the distribution X (rdistrX) with parameters appended by the list param_X. Also accumulate function of distribution and generator sample of distribution C (censoring) with parameters appended by the list param_C In which, you can control the desired censorship percentage.

Usage

rcensT3(
  rdistrX,
  pdistrC,
  rdistrC,
  param_X,
  param_C,
  n = 10000,
  theta = 0.5,
  n_mc = 10000,
  lambda_tol = c(1e-06, 10000),
  verbose = FALSE,
  right = TRUE
)

Arguments

rdistrX

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

pdistrC

function distribution of C. First argument probabilities, next arguments in param_C.

rdistrC

sample generator of distribution C.
First argument number of samples, next arguments in param_C.

param_X

list with parameters of rdistrX function.

param_C

list with parameters of rdistrC function, one of these parameters
should be "lambda", this wil be the searched parameter.

n

number of sample to create.

theta

Desired censoring percentage

n_mc

number of sample use in Monte Carlo integration, greater n_mc more accuracy.

lambda_tol

lowest and uppest value where live the search parameter lambda.

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:

lambda searched censoring distribution parameter.
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

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

Examples


#Example Exponential - Uniform


Data_T3 = rcensT3(rdistrX = rexp, pdistrC = punif, rdistrC = runif,
              param_X = list("rate" = 2),
             param_C = list("min" = 0, "max" = "lambda"),
            n = 1e02, theta = .9, right = TRUE)


Data_T3 = rcensT3(rdistrX = rexp, pdistrC = punif, rdistrC = runif,
                 param_X = list("rate" = 2),
                 param_C = list("min" = 0, "max" = "lambda"),
                 n = 1e02, theta = .1, right = FALSE)


## Example with plot in examples_plot/Example_rcensT3_plot.R


[Package rcens version 0.1.1 Index]