Description Usage Arguments Value Author(s) Examples

Function for grouping survival curves, given a number k, based on the k-means or k-medians algorithm.

1 2 | ```
kgroups_surv(time, status, fac, k = K, kbin = 50, algorithm = "kmeans",
seed = NULL)
``` |

`time` |
Survival time. |

`status` |
Censoring indicator of the survival time of the process; 0 if the total time is censored and 1 otherwise. |

`fac` |
Categoriacl variable indicating the population to which the subject belongs |

`k` |
An integer specifying the number of groups of curves to be performed. |

`kbin` |
Size of the grid over which the survival functions are to be estimated. |

`algorithm` |
A character string specifying which clustering algorithm is used,
i.e., k-means( |

`seed` |
Seed to be used in the procedure. |

A list containing the following items:

`measure` |
A measure of... |

`levels` |
Original levels of the variable |

`cluster` |
A vector of integers (from 1:k) indicating the cluster to which each curve is allocated. |

`centers` |
An object of class |

`curves` |
An object of class |

Marta Sestelo, Nora M. Villanueva.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
library(clustcurv)
library(survival)
data(veteran)
# 2 groups k-means
cl2 <- kgroups_surv(time = veteran$time, status = veteran$status,
fac = veteran$celltype, k = 2, algorithm = "kmeans")
data.frame(level = cl2$level, cluster = cl2$cluster)
# 2 groups k-medians
cl2 <- kgroups_surv(time = veteran$time, status = veteran$status,
fac = veteran$celltype, k = 2, algorithm = "kmedians")
data.frame(level = cl2$level, cluster = cl2$cluster)
# 3 groups
cl3 <- kgroups_surv(time = veteran$time, status = veteran$status,
fac = veteran$celltype, k = 3, algorithm = "kmeans")
data.frame(level = $level, cluster = cl3$cluster)
``` |

sestelo/clustcurv documentation built on Oct. 20, 2017, 10:30 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.