Comments (7)
- New functions added for determining and visualizing the optimal cutpoint of continuous variables for survival analyses:
surv_cutpoint()
: Determine the optimal cutpoint for each variable using 'maxstat'. Methods defined for surv_cutpoint object are summary(), print() and plot().surv_categorize()
: Divide each variable values based on the cutpoint returned bysurv_cutpoint()
- 0. Load some data
data(myeloma)
head(myeloma)
molecular_group chr1q21_status treatment event time CCND1 CRIM1 DEPDC1 IRF4 TP53 WHSC1 GSM50986 Cyclin D-1 3 copies TT2 0 69.24 9908.4 420.9 523.5 16156.5 10.0 261.9 GSM50988 Cyclin D-2 2 copies TT2 0 66.43 16698.8 52.0 21.1 16946.2 1056.9 363.8 GSM50989 MMSET 2 copies TT2 0 66.50 294.5 617.9 192.9 8903.9 1762.8 10042.9 GSM50990 MMSET 3 copies TT2 1 42.67 241.9 11.9 184.7 11894.7 946.8 4931.0 GSM50991 MAF TT2 0 65.00 472.6 38.8 212.0 7563.1 361.4 165.0 GSM50992 Hyperdiploid 2 copies TT2 0 65.20 664.1 16.9 341.6 16023.4 2096.3 569.2
- 1. Determine the optimal cutpoint of variables
# 1. Determine the optimal cutpoint of variables
res.cut <- surv_cutpoint(myeloma, time = "time", event = "event",
variables = c("DEPDC1", "WHSC1", "CRIM1"))
summary(res.cut)
cutpoint statistic DEPDC1 279.8 4.275452 WHSC1 3205.6 3.361330 CRIM1 82.3 1.968317
- 2. Plot cutpoint for DEPDC1
# 2. Plot cutpoint for DEPDC1
# palette = "npg" (nature publishing group), see ?ggpubr::ggpar
plot(res.cut, "DEPDC1", palette = "npg")
- 3. Categorize variables
# 3. Categorize variables
res.cat <- surv_categorize(res.cut)
head(res.cat)
time event DEPDC1 WHSC1 CRIM1 GSM50986 69.24 0 high low high GSM50988 66.43 0 low low low GSM50989 66.50 0 low high high GSM50990 42.67 1 low high low GSM50991 65.00 0 low low low GSM50992 65.20 0 high low low
- 4. Fit survival curves and visualize
# 3. Fit survival curves and visualize
library("survival")
fit <- survfit(Surv(time, event) ~DEPDC1, data = res.cat)
ggsurvplot(fit, risk.table = TRUE, conf.int = TRUE)
from survminer.
Well formated issue! I have to assume that during my cooperation with biotechnologist I have met the idea of examining expression of one gene in HIGH and LOW groups :) That's so true. I didn't know about maxstat method, so I always used median, as a natural
approach.
The plot of maxstat looks very simple, but is very useful. Maybe we could somehow extend ggsurvplot to provide cutoffs for user while he/she only specifies names of the dependent continuous variables?
PS. I remember about vignette I was about to post here :P but just got invited on Bioc2016 and I am planning my journey and VISa.
from survminer.
- This is extra idea to arm survminer with another tools!
from survminer.
no emrgency for the vignette:-)!
from survminer.
Wonderful and very helpful :)! good job
2016-10-22 20:20 GMT+02:00 Alboukadel KASSAMBARA [email protected]:
New functions added for determining and visualizing the optimal
cutpoint of continuous variables for survival analyses:
surv_cutpoint(): Determine the optimal cutpoint for each variable
using 'maxstat'. Methods defined for surv_cutpoint object are summary(),
print() and plot().
surv_categorize(): Divide each variable values based on the
cutpoint returned by surv_cutpoint()0. Load some data
data(myeloma)
head(myeloma)molecular_group chr1q21_status treatment event time CCND1 CRIM1 DEPDC1 IRF4 TP53 WHSC1
GSM50986 Cyclin D-1 3 copies TT2 0 69.24 9908.4 420.9 523.5 16156.5 10.0 261.9
GSM50988 Cyclin D-2 2 copies TT2 0 66.43 16698.8 52.0 21.1 16946.2 1056.9 363.8
GSM50989 MMSET 2 copies TT2 0 66.50 294.5 617.9 192.9 8903.9 1762.8 10042.9
GSM50990 MMSET 3 copies TT2 1 42.67 241.9 11.9 184.7 11894.7 946.8 4931.0
GSM50991 MAF TT2 0 65.00 472.6 38.8 212.0 7563.1 361.4 165.0
GSM50992 Hyperdiploid 2 copies TT2 0 65.20 664.1 16.9 341.6 16023.4 2096.3 569.2
- 1. Determine the optimal cutpoint of variables
1. Determine the optimal cutpoint of variablesres.cut <- surv_cutpoint(myeloma, time = "time", event = "event",
variables = c("DEPDC1", "WHSC1", "CRIM1"))
summary(res.cut)
cutpoint statistic
DEPDC1 279.8 4.275452
WHSC1 3205.6 3.361330
CRIM1 82.3 1.968317
- * 2. Plot cutpoint for DEPDC1*
2. Plot cutpoint for DEPDC1# palette = "npg" (nature publishing group), see ?ggpubr::ggpar
plot(res.cut, "DEPDC1", palette = "npg")
[image: rplot16]
https://cloud.githubusercontent.com/assets/3313355/19621578/f63b9938-9894-11e6-930c-1f0efca81919.png
- 3. Categorize variables
3. Categorize variablesres.cat <- surv_categorize(res.cut)
head(res.cat)
time event DEPDC1 WHSC1 CRIM1
GSM50986 69.24 0 high low high
GSM50988 66.43 0 low low low
GSM50989 66.50 0 low high high
GSM50990 42.67 1 low high low
GSM50991 65.00 0 low low low
GSM50992 65.20 0 high low low
- 4. Fit survival curves and visualize
3. Fit survival curves and visualize
library("survival")fit <- survfit(Surv(time, event) ~DEPDC1, data = res.cat)
ggsurvplot(fit, risk.table = TRUE, conf.int = TRUE)[image: rplot15]
https://cloud.githubusercontent.com/assets/3313355/19621540/59b447f4-9894-11e6-8b5b-6a5add1769a7.png—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#41 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGdazn6nuZkhLokYp7bBAdljp7BNr1Ewks5q2lP5gaJpZM4Ilmxn
.
from survminer.
Thanks:-)!
from survminer.
@kassambara Great work! Just wondering if this applies to the case when I try to find multiple cutpoints in one group, ie. 2 points to break into low/medium/high?
from survminer.
Related Issues (20)
- surv_cutpoint when NA survival outcomes exist
- how to retain the confidence interval in plot when try to transform it to plotly object
- `ggsurvplot_facet()` says it supports numeric/text input to `pval` argument, but it doesn't.
- Deprecated functions HOT 1
- ggsurvplot displaying error
- Log Likelihood Ratio P-value incorrectly named as log-rank?
- Number at risk and number censored in the same table using ggsurvplot_combine
- Changing size of "large dash". HOT 1
- surv.median.line triggers warnings in ggplot2 3.5.0 HOT 2
- `surv_fit` doesn't support `weights` parameter
- deprecated feature in survminer
- ggsurvplot gives error when drawing risk table. HOT 3
- pariwise_survdiff throws unusual error when a model with strata is used
- misalignment between the chart and the risk table in ggsurvplot HOT 6
- ggflexsurvplot risk table strata
- `select_()` was deprecated in dplyr 0.7.0. error HOT 2
- Default to mitre linejoin when plotting step functions
- ggforest fails if data is supplied as tibble.
- ggsurvplot does not plot every event
- `gather_()` was deprecated in tidyr 1.2.0. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from survminer.