This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(ggplot2) | |
require(dplyR) | |
# Convert Survfit object to tidy data frame. survival = TRUE means at x = 0 y = 1 (descending upon event) | |
# and FALSE means x = 0 y = 0 (ascending) | |
tidy_km = function( survfit, strata_names = NULL, survival = FALSE) { | |
# | |
tidy_single_strata = function ( strata ) { | |
print(strata$surv) | |
data_frame( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entrants tickets expected_winners prob | |
1 1981 1981 64.98780 0.03280555 | |
2 890 1780 57.54135 0.06465320 | |
3 390 1560 48.80195 0.12513321 | |
4 189 1512 44.29210 0.23434974 | |
5 79 1264 32.71075 0.41406013 | |
6 33 1056 21.66605 0.65654697 | |
sums 3562 9153 270.00000 1.52754879 |