-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
99 lines (66 loc) · 3.63 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
output:
md_document:
variant: markdown_github
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# kaps
$K$-adaptive partitioning for survival data
[![Build Status](https://travis-ci.org/sooheang/kaps.svg?branch=master)](https://travis-ci.org/sooheang/kaps)
[![Build status](https://ci.appveyor.com/api/projects/status/x7frit6xwy688d5e/branch/master?svg=true)](https://ci.appveyor.com/project/sooheang/kaps/branch/master)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/kaps)](http://cran.r-project.org/package=kaps)
[![Coverage Status](https://img.shields.io/codecov/c/github/sooheang/kaps/master.svg)](https://codecov.io/github/sooheang/kaps?branch=master)
[![CRAN_Downloads](https://cranlogs.r-pkg.org/badges/grand-total/kaps)](http://cran.rstudio.com/web/packages/kaps/index.html)
kaps is a multi-way partitioning algorithm, which divides the data into $K$ heterogeneous subgroups based on the information from a prognostic factor.
Such a multi-way partition is found by maximizing the minimum of the subgroup pairwise test statistics.
An optimal number of subgroups is determined by a permutation test.
You can install:
* the latest released version with
```R
if (packageVersion("devtools") < 1.6) {
install.packages("devtools")
}
devtools::install_github("sooheang/kaps", ref = 'v1.1.5')
```
* the latest development version from github with
```R
if (packageVersion("devtools") < 1.6) {
install.packages("devtools")
}
devtools::install_github("sooheang/kaps")
```
If you encounter a clear bug, please file a minimal reproducible example on [github](https://github.com/sooheang/kaps/issues).
## NOTICE
Since 2015, we ONLY use the github repositoty in order to maintain `kaps`.
## Tutorial
To illustrate the function kaps() with various options, we use an artificial data, toy, which consists of 150 artificial observations of the survival time (time), its censoring status (status) and 6 covariates: the patient's race (Race), age at the initial time (Age), pathological grade (Grade), early onset depression (EOD), the number of metastasis LNs (meta) and the number of examined LNs (exam).
The data can be called up from the package `kaps`:
```{r}
library(kaps)
data('toy', package = 'kaps')
head(toy)
```
Here we utilize just 3 variables: meta, status, and time. The number of metastasis LNs, meta, is used as an ordered prognostic factor for finding heterogeneous subgroups.
```{r}
toy <- toy[, c("meta", "status", "time")]
```
### Selecting a set of cut-off points for given $K$
Suppose we specify the number of subgroups in advance. For instance, $K=3$. To select an optimal set of two cut-off points when $K=3$, the function kaps is called via the following statements
```{r}
fit1 <- kaps(survival::Surv(time, status) ~ meta, data = toy, K = 3)
fit1
```
## References
* Kang, H. J.^+^, Eo, S-H^+^, Kim, S. C., Park, K. M., Lee, Y. J., Lee, S. K., Yu, E., Cho, H., and Hong, S-M (2014). Increased Number of Metastatic Lymph Nodes in Adenocarcinoma of the Ampulla of Vater as a Prognostic Factor: A Proposal of New Nodal Classification, _Surgery_, **155**(1), 74-84. (+:co-first author) [Link](http://dx.doi.org/10.1016/j.surg.2013.08.004)
* Eo, S-H, Kang, H. J., Hong, S-M, and Cho, H. (2014). K-Adaptive Partitioning for Survival Data, with an Application to Cancer Staging, _arXiv_, **1306.4615**. [Link](https://arxiv.org/abs/1306.4615)
# ChangeLog
* v1.1.4: Solve the issue No.5
* v1.1.3: Update survival function
* v1.1.0: Intitial release on GitHub