BiIntCensd: Bivariate Interval-Censored Data Analysis

View source: R/BiIntCensd.R

BiIntCensdR Documentation

Bivariate Interval-Censored Data Analysis

Description

This package provide a tookit which estimates the joint distribution function (as well as marginal distributions of each outcome) for interval-censored data using a spline-based sieve nonparametric MLE

Usage

BiIntCensd(
  dat,
  l = 4,
  pred.times = NULL,
  int.k_1 = NULL,
  int.k_2 = NULL,
  t1_l = NULL,
  t1_h = NULL,
  t2_l = NULL,
  t2_h = NULL,
  Corr.Test = FALSE,
  nBootstrp = 100,
  seed = 12345,
  parallel = TRUE
)

Arguments

dat

Observed interval-censored data which can be either case 1 (current status data) or case 2 (interval censored data) for either outcome. See details.

l

Order of I-spline (degree + 1). The default is l=4

pred.times

Input times using format [T1, T2] to predict the probability of observing events marginally and jointly, i.e., [F1, F2, F12]. Multiple inputs of times are supported by providing a n x 2 matrix of times

int.k_1

User specified number of knots for outcome 1. If not specified, N^{1/3} knots will be chosen at quantiles

int.k_2

Similar to int.k_1, just for outcome 2

t1_l

(outcome 1) lower bound for nonparametric association test. Default is NULL which will automatically adopt τ_{1,l}. See details.

t1_h

(outcome 1) upper bound for nonparametric association test. Default is NULL which will automatically adopt τ_{1,h}

t2_l

(outcome 2) lower bound for nonparametric association test. Default is NULL which will automatically adopt τ_{2,l}

t2_h

(outcome 2) upper bound for nonparametric association test. Default is NULL which will automatically adopt τ_{2,h}

Corr.Test

Whether the test of correlation between two outcomes should be conducted. Default is FALSE. If TRUE, bootstrap will be adopted to calculate SE(ρ).

nBootstrp

Number of bootstrap samples

seed

Random seed for bootstrap

parallel

Parallel computing, default is TRUE. It is designed for speed up the correlation test. Does not have any effect when Corr.Test == FALSE

Details

dat should meet the following format:
A table of a n x 4 matrix where each column corresponds to (tu_1, tv_1, tu_2, tv_2). tu_ stands for the left boundaries of the observation interval, while tv_ stands for right boundaries.

Notice: Censoring types are embedded in dat with the following the rule:

If T1==0 -> "Left" censored
If is.infinite(T2) -> "Right" censored
Else -> "Interval" censored

The nonparametric association test is written as

ρ(\hat{\boldsymbolθ}_n) = \int_{t_{1,l}}^{t_{1,h}}\int_{t_{2,l}}^{t_{2,h}}≤ft\{\hat F_{n,0}(t_1, t_2) - \hat F_{n,1}(t_1)\hat F_{n,2}(t_2)\right\}dt_2dt_1

where event times (t_1, t_2) \in [τ_{1,l},τ_{1,h}]\times[τ_{2,l},τ_{2,h}]. By specifying t1_l, t1_h, t2_l, and t2_h, user could test independence of event times at any region.

Value

A list object including:

rho.hat

The estimated ρ, implies the correlation between two outcomes. See reference papers for more details

MC.rho

If Corr.Test = TRUE, it yields a vector of all estimated ρ from bootstraps

seive.M_ij, seive.w_i, seive.p_j

Estimated I-spline coefficients. See reference papers for more details

F1.hat, F2.hat, F12.hat

Estimated marginal and joint CDFs. They mainly used for making the plot of the CDFs

Pred.Probs

If pred.times is given, it contains the estimated [F1(T1), F2(T2), F12(T1,T2)] at given time points

Author(s)

Junyi Zhou, Yuan Wu, and Ying Zhang.

References

Wu, Y., & Zhang, Y. (2012). Partially monotone tensor spline estimation of the joint distribution function with bivariate current status data. The Annals of Statistics, 40(3), 1609-1636.

Wu Y., Zhang, Y., & Zhou, J. Statistica Sinica Preprint No: SS-2019-0296.

Examples

res = BiIntCensd(SampleDat_case1,
                 Corr.Test = FALSE,
                 pred.times = rbind(c(1,2), c(2,2.5))
                 )

# making 3d plot of joint distribution
# require(rgl)
rgl::persp3d(res$F1.hat$T1, res$F2.hat$T2, res$F12.hat,
xlab = 'T1', ylab = 'T2', zlab = 'F(T1, T2)',
main='Joint CDF', col = "lightblue")

# add points
if (!is.null(res$Pred.Probs)) {
    rgl::points3d(res$Pred.Probs$T1, res$Pred.Probs$T2,
    res$Pred.Probs$Est.F12, col = "red", add = TRUE)
}

## If we want to conduct test for the correlation between two outcomes:
## Not run: 
if (Sys.info()["sysname"] == "Windows" ){
  require(doParallel)
  registerDoParallel(5)
} else {
  require(doMC)
  registerDoMC(5)
}

res = BiIntCensd(SampleDat_case2,
                 Corr.Test = TRUE)

## End(Not run)

junyzhou10/BivarIntCensored documentation built on July 14, 2022, 8:14 a.m.