Description Usage Arguments Details Value References Examples
View source: R/finished_permutations.R
Computes the p-value of the multivariate permutation Gehan test described in Persson et al. (2019).
1 | perm_gehan(B = 999, z, delta.z, n1)
|
B |
An integer specifying the number of permutations to perform. The default is 999. It is recommended to use |
z |
A matrix containing the observed (possibly censored) survival times for the two groups. The observations for the first group should be one the first |
delta.z |
A matrix containing the censoring status of each observation in |
n1 |
An integer specifying the sample size of the first group. |
Multivariate version of the logrank and Gehan tests were described by Wei & Lachin (1984). Persson et al. (2019) described permutation versions of these tests, with improved performance.
A p-value.
persson19MultSurvTests
\insertRefwei84MultSurvTests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Diabetes data:
?diabetes
# Survival times for the two groups:
x <- as.matrix(subset(diabetes, LASER==1)[c(6,8)])
y <- as.matrix(subset(diabetes, LASER==2)[c(6,8)])
# Censoring status for the two groups:
delta.x <- as.matrix(subset(diabetes, LASER==1)[c(7,9)])
delta.y <- as.matrix(subset(diabetes, LASER==2)[c(7,9)])
# Create the input for the test:
z <- rbind(x, y)
delta.z <- rbind(delta.x, delta.y)
# Run the test with 50 permutations:
perm_gehan(B = 50, z, delta.z, n1 = nrow(x))
# In most cases, it is preferable to use more than 50
# permutations for computing p-values. choose_B() can
# be used to determine how many permutations are needed.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.