Description Usage Arguments Value References Examples
Perform permutation test based on conditional or unconditional approach.
1 2 3 4 |
trun |
is the left truncation time. |
obs |
is the observed failure time. |
permSize |
is the number of permutations. |
cens |
is the status indicator; 0 = censored, 1 = event. |
sampling |
a character string specifying the sampling method used in permutation. The following are permitted:
|
kendallOnly, minp1Only, minp2Only |
optional values indicating which test statistics to be used.
If all leave as |
nc |
is the number of cores used in permutation.
When |
seed |
an optional vector containing random seeds to be used to generate permutation samples. Random seeds will be used when left unspecified. |
A list containing output with the following components:
the observed p-value using Kendall's tau test statistic.
the observed p-value using minp1 test statistic.
the observed p-value using minp2 test statistic.
the observed minp1 test statistic.
the observed minp2 test statistic.
Kendall's tau test statistics from permutation samples.
minp1 test statistics from permutation samples.
minp2 test statistics from permutation samples.
Chiou, S.H., Qian, J., and Betensky, R.A. (2017). Permutation Test for General Dependent Truncation. Tech-report
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | simDat <- function(n) {
k <- s <- 1
tt <- xx <- yy <- cc <- delta <- rep(-1, n)
while(k <= n){
tt[k] <- runif(1, 0, 3.5)
xx[k] <- 1.95 + 0.65 * (tt[k] - 1.25)^2 + rnorm(1, sd = 0.1)
cc[k] <- runif(1, 0, 10)
delta[k] <- (xx[k] <= cc[k])
yy[k] <- pmin(xx[k], cc[k])
s <- s + 1
if(tt[k] <= yy[k]) k = k+1
}
data.frame(list(trun = tt, obs = yy, delta = delta))
}
set.seed(123)
dat <- simDat(50)
B <- 20
## Perform conditional permutation with Kendall's tau, minp1 and minp2
set.seed(123)
system.time(fit <- with(dat, permDep(trun, obs, B, delta, nc = 1)))
fit
|
user system elapsed
2.728 0.021 2.803
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.