Description Usage Arguments Value See Also Examples
View source: R/fitAndTestSurvival.R
Fits survival curves for each risk and group, treating other types of events as censoring.
1 2 | fitSurvival(time, risk, group, cens = NULL, type = "kaplan-meier",
conf.int = 0.95, conf.type = "log")
|
time |
vector with times of the first event or follow-up, must be numeric. |
risk |
vector with type of event, can be numeric or factor/character. |
group |
vector with group variable, can be numeric or factor/character. |
cens |
value of 'risk' indicating censored observation (if NULL, the first value of 'risk' vector will be taken). |
type |
type of survival curve to be fitted. Possible values are "kaplan-meier" (default), "fleming-harrington" or "fh2". |
conf.int |
level of two-sided confidence interval (default = 0.95). |
conf.type |
type of confidence interval. Possible values: "none", "plain", "log" (default), "log-log". |
List, which elements are survfit.summary objects from the package Survival for each risk separately.
1 2 |
Loading required package: ggplot2
Loading required package: survival
Loading required package: cmprsk
Loading required package: gridExtra
$death
Call: survfit(formula = Surv(time, localStatus) ~ group, type = type,
conf.int = conf.int, conf.type = conf.type)
19 observations deleted due to missingness
female
time n.risk n.event survival std.err lower 95% CI upper 95% CI
4 252 1 0.996 0.00396 0.9883 1.000
18 236 1 0.992 0.00577 0.9806 1.000
22 230 1 0.987 0.00718 0.9735 1.000
119 184 1 0.982 0.00892 0.9648 1.000
121 183 1 0.977 0.01036 0.9567 0.997
139 176 1 0.971 0.01170 0.9486 0.994
157 166 1 0.965 0.01301 0.9402 0.991
167 162 1 0.959 0.01423 0.9319 0.988
173 159 1 0.953 0.01536 0.9237 0.984
179 157 1 0.947 0.01642 0.9157 0.980
189 153 1 0.941 0.01744 0.9075 0.976
237 134 1 0.934 0.01867 0.8982 0.971
244 132 1 0.927 0.01983 0.8890 0.967
267 125 1 0.920 0.02101 0.8793 0.962
268 124 1 0.912 0.02211 0.8699 0.957
336 116 1 0.904 0.02328 0.8598 0.951
339 115 1 0.896 0.02437 0.8499 0.945
354 113 1 0.889 0.02541 0.8401 0.940
370 111 1 0.881 0.02641 0.8302 0.934
385 108 1 0.872 0.02740 0.8203 0.928
428 95 1 0.863 0.02860 0.8089 0.921
457 92 1 0.854 0.02979 0.7974 0.914
464 90 1 0.844 0.03094 0.7858 0.907
500 87 1 0.835 0.03207 0.7741 0.900
586 78 1 0.824 0.03339 0.7610 0.892
624 72 1 0.812 0.03483 0.7470 0.884
628 71 1 0.801 0.03617 0.7332 0.875
653 70 1 0.790 0.03742 0.7195 0.866
760 66 1 0.778 0.03872 0.7053 0.857
777 62 1 0.765 0.04008 0.6904 0.848
800 59 1 0.752 0.04144 0.6751 0.838
807 58 1 0.739 0.04271 0.6600 0.828
826 57 1 0.726 0.04388 0.6451 0.817
855 55 1 0.713 0.04503 0.6300 0.807
869 54 1 0.700 0.04609 0.6150 0.796
896 50 1 0.686 0.04724 0.5991 0.785
929 47 1 0.671 0.04844 0.5826 0.773
987 43 1 0.656 0.04976 0.5649 0.761
995 42 1 0.640 0.05097 0.5475 0.748
999 41 1 0.624 0.05206 0.5302 0.735
1043 39 1 0.608 0.05313 0.5126 0.722
1073 38 1 0.592 0.05409 0.4953 0.708
1135 36 1 0.576 0.05503 0.4775 0.695
1147 34 1 0.559 0.05596 0.4593 0.680
1167 33 1 0.542 0.05677 0.4414 0.666
1288 28 1 0.523 0.05795 0.4206 0.650
1379 25 1 0.502 0.05928 0.3980 0.632
1421 24 1 0.481 0.06039 0.3759 0.615
1492 19 1 0.456 0.06229 0.3484 0.596
1499 18 1 0.430 0.06376 0.3218 0.575
1600 17 1 0.405 0.06484 0.2958 0.554
1725 12 1 0.371 0.06765 0.2597 0.531
1790 11 1 0.337 0.06940 0.2255 0.505
2174 8 1 0.295 0.07242 0.1826 0.477
2617 5 1 0.236 0.07840 0.1232 0.453
4961 2 1 0.118 0.09225 0.0255 0.546
male
time n.risk n.event survival std.err lower 95% CI upper 95% CI
0 233 1 0.996 0.00428 0.9873 1.000
33 190 1 0.990 0.00674 0.9773 1.000
38 185 1 0.985 0.00857 0.9685 1.000
62 165 1 0.979 0.01039 0.9590 1.000
74 159 1 0.973 0.01201 0.9497 0.997
87 154 1 0.967 0.01350 0.9406 0.993
91 151 1 0.960 0.01485 0.9316 0.990
97 149 1 0.954 0.01609 0.9228 0.986
118 138 1 0.947 0.01739 0.9134 0.982
161 127 1 0.939 0.01878 0.9033 0.977
164 123 1 0.932 0.02012 0.8932 0.972
176 120 1 0.924 0.02140 0.8830 0.967
244 107 1 0.915 0.02288 0.8717 0.961
257 102 1 0.906 0.02435 0.8599 0.955
258 101 1 0.897 0.02571 0.8485 0.949
260 100 1 0.888 0.02697 0.8372 0.943
274 93 1 0.879 0.02833 0.8251 0.936
282 91 1 0.869 0.02962 0.8131 0.929
303 84 1 0.859 0.03102 0.8002 0.922
321 82 1 0.848 0.03236 0.7873 0.914
444 75 1 0.837 0.03385 0.7734 0.906
460 73 1 0.826 0.03527 0.7594 0.898
574 66 1 0.813 0.03689 0.7440 0.889
593 62 1 0.800 0.03856 0.7279 0.879
626 58 1 0.786 0.04028 0.7111 0.869
666 57 1 0.772 0.04187 0.6946 0.859
701 54 1 0.758 0.04347 0.6776 0.848
711 53 1 0.744 0.04494 0.6608 0.837
731 51 1 0.729 0.04637 0.6438 0.826
864 48 1 0.714 0.04783 0.6262 0.814
879 47 1 0.699 0.04916 0.6089 0.802
949 42 1 0.682 0.05073 0.5897 0.789
976 41 1 0.666 0.05215 0.5708 0.776
1081 38 1 0.648 0.05364 0.5510 0.762
1091 37 1 0.631 0.05498 0.5315 0.748
1171 30 1 0.610 0.05702 0.5074 0.732
1258 26 1 0.586 0.05945 0.4804 0.715
1293 25 1 0.563 0.06152 0.4541 0.697
1357 24 1 0.539 0.06327 0.4284 0.679
1622 18 1 0.509 0.06647 0.3943 0.658
1778 14 1 0.473 0.07098 0.3524 0.635
2318 9 1 0.420 0.08022 0.2892 0.611
2370 8 1 0.368 0.08569 0.2330 0.581
2620 6 1 0.306 0.09072 0.1716 0.547
2681 5 1 0.245 0.09096 0.1185 0.507
3169 4 1 0.184 0.08644 0.0732 0.462
$new_tumor
Call: survfit(formula = Surv(time, localStatus) ~ group, type = type,
conf.int = conf.int, conf.type = conf.type)
19 observations deleted due to missingness
female
time n.risk n.event survival std.err lower 95% CI upper 95% CI
49 204 1 0.995 0.00489 0.986 1.000
54 202 1 0.990 0.00692 0.977 1.000
195 150 1 0.984 0.00951 0.965 1.000
251 131 1 0.976 0.01204 0.953 1.000
314 118 1 0.968 0.01451 0.940 0.997
341 114 1 0.959 0.01668 0.927 0.993
388 106 1 0.950 0.01882 0.914 0.988
397 104 1 0.941 0.02074 0.901 0.983
500 87 1 0.930 0.02315 0.886 0.977
509 85 1 0.919 0.02533 0.871 0.970
720 68 1 0.906 0.02834 0.852 0.963
725 67 1 0.892 0.03097 0.834 0.955
772 63 1 0.878 0.03356 0.815 0.946
898 49 1 0.860 0.03736 0.790 0.937
943 45 1 0.841 0.04113 0.764 0.926
1144 35 1 0.817 0.04645 0.731 0.913
3044 3 1 0.545 0.22453 0.243 1.000
male
time n.risk n.event survival std.err lower 95% CI upper 95% CI
39 183 1 0.995 0.00545 0.984 1.000
84 156 1 0.988 0.00835 0.972 1.000
107 142 1 0.981 0.01081 0.960 1.000
226 111 2 0.964 0.01631 0.932 0.996
242 108 1 0.955 0.01844 0.919 0.991
267 97 1 0.945 0.02071 0.905 0.986
290 89 1 0.934 0.02304 0.890 0.980
489 71 1 0.921 0.02620 0.871 0.974
527 69 1 0.908 0.02902 0.852 0.966
539 67 1 0.894 0.03159 0.834 0.958
575 65 1 0.880 0.03397 0.816 0.950
1099 35 1 0.855 0.04127 0.778 0.940
1893 12 1 0.784 0.07802 0.645 0.953
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.