rcurefT3 {rcens}R Documentation

Title Generate Sample with Cure Fraction and Random Censoring

Description

Generator Sample with Cure Fraction, Random 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.
Note: cure fraction (p) must be less than desired censorship percentage.

Usage

rcurefT3(
  rdistrX,
  pdistrC,
  rdistrC,
  param_X,
  param_C,
  p = 0.1,
  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.

p

cure fraction

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.
cure_list vector of 1 and 0 indicating whether the i-th sample is cured.
1:= cure , 0:= no cure
cure_fraction cure fraction used to create de sample.

Author(s)

Daniel Saavedra Morales

See Also

rcuref Generate Sample with Cure Fraction.

Examples


#Example Exponential - Uniform


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




## Example with plot in examples_plot/Example_rcurefT3_plot.R

[Package rcens version 0.1.1 Index]