inter_frailty: Fits cure rate frailty model for interval censored data

Description Usage Arguments Value Examples

View source: R/inter_frailty.R

Description

inter_frailty provides a fit using the frailty model for interval censored data with a cure fraction. Returns a list with the estimated parameters par and their asymptotic covariance matrix mcov.

Usage

1
2
3
4
inter_frailty(dataset, left, right, delta, cov_theta, cov_beta, M, b = 0.001,
  tol = 0.001, max_n = 100, par_cl = NULL, burn_in = 30,
  output_files = FALSE, input_alpha = NULL, input_sigma_alpha = NULL,
  input_cumrisk = NULL)

Arguments

dataset

Dataset used to fit the model.

left

Vector containing the last check times before event.

right

Vector containing the first check times after event.

delta

Flag vector indicating failure inside interval.

cov_theta

String vector containing the column names to be used on the cure rate predictor.

cov_beta

String vector containing the column names to be used on the predictor associated with the hazard function.

M

Number of replicates generated by each iteration on the ANDA (Asymptotic Normal Data Augmentation) algorithm.

b

Parameter for initial theta and beta variances.

tol

Numeric for tolerance of convergence.

max_n

Maximum number of algorithm's iterations without the burn in.

par_cl

Registered SOCK cluster for parallel process. If NULL (default) the program loops are executed sequentially.

burn_in

Number of burn in iterations.

output_files

Boolean indicating if text outputs for the estimates and variances should be generated.

input_alpha

Initial parameter vector. Default adopts 0 for each effect. Can be used to increase M for a same fit.

input_sigma_alpha

Initial Initial covariance matrix for alpha. Default is an identity matrix multiplied by b. Can be used to increase M for a same fit.

input_cumrisk

Initial baseline cumulative risk function. Can be used to increase M for a same fit.

Value

The inter_frailty function returns an list containing the following outputs:

n_its

number of iterations used on the process.

par

estimates of theta and beta parameters.

mcov

estimates for the covariance matrix of theta and beta parameters.

theta_max_dif

maximum of absolute difference between the effects of the last and the previous iterations.

stop_c

stop criteria indicator assuming 1 when process is stopped for a non-convergence criteria. Assumes 0 when convergence is reached.

last_naalen

estimated baseline cumulative risk function of the last iteration. Should be stored for fits variating M.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## few iterations just to check how to use the function
set.seed(3)
sample_set <- sim_frailty(80)

inter_frailty(sample_set, sample_set$L, sample_set$R, sample_set$delta,
c("xi1","xi2"), c("xi1","xi2"), M = 10, max_n = 3, burn_in = 0)

## precise estimate (computationally intensive)
## Not run: 

inter_frailty(sample_set, sample_set$L, sample_set$R, sample_set$delta,
c("xi1"), c("xi2"), M = 50, max_n = 100, burn_in = 10)

## End(Not run)

JBrettas/intercure documentation built on May 7, 2019, 7:39 a.m.