Description Usage Arguments Details See Also Examples
Function kmgraph
is able to generate Kaplan Meier curves based on censored data.
1 | kmgraph(object, nodecode = 0)
|
object |
a 'stree' S3 object, i.e. the result returned by stree function. |
nodecode |
default value 0 will return all the Kaplan-Meier curves of leaf nodes in the same graph. Users can also choose to display certain curve of a node by changing the value to other positive interger. Specifically, the leaf nodes are ordered from up to bottom, from left to right. Nodecode equals to k will return the k-th leaf node's Kaplan Meier curve. |
This function is a visualization method for class "stree". Given a stree
object, kmgraph
will use the data by which the model is generated, together with the fitted model to draw Kaplan-Meier curves of all or single node in one plot.
1 2 3 4 5 6 7 8 9 10 11 | test <- data.frame(runif(1000, 1, 10), rbinom(1000, 1, 0.5),
sample(1:4, 1000, replace = TRUE, prob = c(0.1, 0.3, 0.2, 0.4)),
sample(1:50, 1000, replace = TRUE),
sample(1:30, 1000, replace = TRUE),
sample(1:10, 1000, replace = TRUE),
sample(1:60, 1000, replace = TRUE),
sample(1:20, 1000, replace = TRUE),
sample(1:40, 1000, replace = TRUE))
test[,3] <- as.factor(test[,3])
object <- stree(test,"likelihood")
kmgraph(object)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.