File:KMcurve.png: Difference between revisions
Jump to navigation
Jump to search
(> library(survival) > plot(leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml[7:17,] ) , lty=2:3) > legend(100, .9, c("Maintenance", "No Maintenance"), lty = 2:3) > title("Kaplan-Meier Curves\nfor AML Maintenance Study")) |
No edit summary |
||
Line 1: | Line 1: | ||
> library(survival) | <pre> | ||
library(survival) | |||
plot(leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml[7:17,] ) , lty=2:3) | |||
# lty=2 is dashed, 3=dotted. | |||
legend(100, .9, c("Maintenance", "No Maintenance"), lty = 2:3) | |||
title("Kaplan-Meier Curves\nfor AML Maintenance Study") | |||
library(dplyr) | |||
leukemia.surv | |||
#Call: survfit(formula = Surv(time, status) ~ x, data = aml[7:17, ]) | |||
# | |||
# n events median 0.95LCL 0.95UCL | |||
#x=Maintained 5 3 48 34 NA | |||
#x=Nonmaintained 6 5 8 5 NA | |||
aml[7:17, ] %>% group_by(x) %>% summarise(median=median(time)) | |||
# A tibble: 2 x 2 | |||
x median | |||
<fct> <dbl> | |||
1 Maintained 45 | |||
2 Nonmaintained 8 | |||
</pre> |
Revision as of 15:23, 30 April 2020
library(survival) plot(leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml[7:17,] ) , lty=2:3) # lty=2 is dashed, 3=dotted. legend(100, .9, c("Maintenance", "No Maintenance"), lty = 2:3) title("Kaplan-Meier Curves\nfor AML Maintenance Study") library(dplyr) leukemia.surv #Call: survfit(formula = Surv(time, status) ~ x, data = aml[7:17, ]) # # n events median 0.95LCL 0.95UCL #x=Maintained 5 3 48 34 NA #x=Nonmaintained 6 5 8 5 NA aml[7:17, ] %>% group_by(x) %>% summarise(median=median(time)) # A tibble: 2 x 2 x median <fct> <dbl> 1 Maintained 45 2 Nonmaintained 8
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 15:41, 17 December 2014 | 672 × 671 (6 KB) | Brb (talk | contribs) | > library(survival) > plot(leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml[7:17,] ) , lty=2:3) > legend(100, .9, c("Maintenance", "No Maintenance"), lty = 2:3) > title("Kaplan-Meier Curves\nfor AML Maintenance Study") |
You cannot overwrite this file.
File usage
There are no pages that use this file.