R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("survrec-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('survrec') Loading required package: boot > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "Survr" > > ### * Survr > > flush(stderr()); flush(stdout()) > > ### Name: Survr > ### Title: Create a Survival recurrent object > ### Aliases: Survr is.Survr > ### Keywords: survival > > ### ** Examples > > data(MMC) > Survr(MMC$id,MMC$time,MMC$event) > > > > cleanEx(); ..nameEx <- "Survsearch" > > ### * Survsearch > > flush(stderr()); flush(stdout()) > > ### Name: surv.search > ### Title: Calculate the survival in selected times > ### Aliases: surv.search > ### Keywords: survival > > ### ** Examples > > # we have the times 4,7,9,15,21,67 > time<-c(4,7,9,15,21,67) > > # and its survival (note: in this example there may be more > # than one event in some times) > surv<-c(0.8,0.7,0.65,0.55,0.43,0.22) > > # We want to calculated the survival at times 1, 10, 32,64 > surv.search(c(1,10,32,74),time,surv) [1] 1.00 0.65 0.43 0.22 > > > > > cleanEx(); ..nameEx <- "mlefrailtyfit" > > ### * mlefrailtyfit > > flush(stderr()); flush(stdout()) > > ### Name: mlefrailty.fit > ### Title: Survival function estimator for correlated recurrence time data > ### under a Gamma Frailty Model > ### Aliases: mlefrailty.fit > ### Keywords: survival > > ### ** Examples > > > data(MMC) > fit<-mlefrailty.fit(Survr(MMC$id,MMC$time,MMC$event)) Needs to Determine a Seed Value for Alpha Seed Alpha: 20.02853 Alpha estimate= 10.17623 > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 80 108 6.7 100 1 9 4 > plot(fit) > > # compare with pena-straderman-hollander > > fit<-psh.fit(Survr(MMC$id,MMC$time,MMC$event)) > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 80 104 5.87 98 1 9 4 > lines(fit,lty=2) > > # and with wang-chang > > fit<-wc.fit(Survr(MMC$id,MMC$time,MMC$event)) > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 99 106 12.7 95 2 10 5 > lines(fit,lty=3) > > > > > cleanEx(); ..nameEx <- "printsurvfitr" > > ### * printsurvfitr > > flush(stderr()); flush(stdout()) > > ### Name: print.survfitr > ### Title: Print a Short Summary of a Survival Recurrent Curve > ### Aliases: print.survfitr > ### Keywords: survival > > ### ** Examples > > data(MMC) > fit<-survfitr(Survr(id,time,event)~group,data=MMC) Needs to Determine a Seed Value for Alpha Seed Alpha: 8.839677 Alpha estimate= 4.29503 Needs to Determine a Seed Value for Alpha Seed Alpha: 267 Alpha estimate= 1766.997 > print(fit) Survival for recurrent event data. Group= group n events mean se(mean) median recurrences: min max median Males 7 31 111 14.65 94 1 9 3 Females 12 49 110 7.69 106 2 6 4 > > > > cleanEx(); ..nameEx <- "pshfit" > > ### * pshfit > > flush(stderr()); flush(stdout()) > > ### Name: psh.fit > ### Title: Survival function estimator for recurrence time data using the > ### estimator developed by Peņa, Strawderman and Hollander > ### Aliases: psh.fit > ### Keywords: survival > > ### ** Examples > > > data(MMC) > fit<-psh.fit(Survr(MMC$id,MMC$time,MMC$event)) > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 80 104 5.87 98 1 9 4 > plot(fit,conf.int=FALSE) > > # compare with MLE Frailty > > fit<-mlefrailty.fit(Survr(MMC$id,MMC$time,MMC$event)) Needs to Determine a Seed Value for Alpha Seed Alpha: 20.02853 Alpha estimate= 10.17623 > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 80 108 6.7 100 1 9 4 > lines(fit,lty=2) > > # and with wang-chang > > fit<-wc.fit(Survr(MMC$id,MMC$time,MMC$event)) > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 99 106 12.7 95 2 10 5 > lines(fit,lty=3) > > > > > cleanEx(); ..nameEx <- "qsearch" > > ### * qsearch > > flush(stderr()); flush(stdout()) > > ### Name: q.search > ### Title: Calculate the survival time of a selected quantile > ### Aliases: q.search > ### Keywords: survival > > ### ** Examples > > > data(MMC) > fit<-survfitr(Survr(id,time,event)~1,data=MMC) Needs to Determine a Seed Value for Alpha Seed Alpha: 20.02853 Alpha estimate= 10.17623 > > # 75th percentile from the survival function > q.search(fit,q=0.75) [1] 63 > > > > > cleanEx(); ..nameEx <- "summarysurvfitr" > > ### * summarysurvfitr > > flush(stderr()); flush(stdout()) > > ### Name: summary.survfitr > ### Title: Summary of a Survival of Recurrences Curve > ### Aliases: summary.survfitr print.summary.survfitr > ### Keywords: survival > > ### ** Examples > > data(MMC) > summary(survfitr(Survr(id,time,event)~group,data=MMC)) Needs to Determine a Seed Value for Alpha Seed Alpha: 8.839677 Alpha estimate= 4.29503 Needs to Determine a Seed Value for Alpha Seed Alpha: 267 Alpha estimate= 1766.997 Group= Males time n.event n.risk surv 21 1 37 0.9771 33 1 34 0.9528 34 2 33 0.9047 38 1 31 0.8799 39 1 30 0.8550 43 1 29 0.8298 51 1 28 0.8045 52 1 27 0.7788 58 1 25 0.7514 59 1 24 0.7237 67 1 23 0.6967 68 1 22 0.6699 71 1 21 0.6433 75 2 20 0.5915 83 1 18 0.5641 84 1 17 0.5367 87 1 16 0.5095 94 1 14 0.4798 98 1 13 0.4503 112 1 11 0.4182 116 1 10 0.3845 124 1 9 0.3506 125 1 8 0.3150 142 1 6 0.2733 145 1 5 0.2272 147 1 4 0.1707 186 1 3 0.1192 206 1 2 0.0737 284 1 1 0.0313 Group= Females time n.event n.risk surv 25 1 57 0.9826 41 2 55 0.9475 47 3 52 0.8944 51 1 49 0.8764 55 1 48 0.8583 56 2 47 0.8225 57 1 45 0.8045 59 1 44 0.7864 63 2 43 0.7507 64 1 41 0.7326 66 1 40 0.7145 68 1 39 0.6964 69 1 38 0.6783 78 1 36 0.6597 86 1 33 0.6401 89 1 31 0.6197 90 1 30 0.5994 95 1 29 0.5791 98 1 28 0.5588 100 1 27 0.5385 103 1 26 0.5182 106 2 25 0.4783 107 1 23 0.4580 111 1 21 0.4367 112 1 20 0.4154 113 1 19 0.3941 120 2 18 0.3527 132 1 15 0.3299 134 1 14 0.3072 141 1 13 0.2845 144 1 12 0.2617 147 1 11 0.2390 154 1 10 0.2163 158 1 9 0.1935 161 1 8 0.1708 162 1 7 0.1481 165 1 6 0.1254 166 2 5 0.0840 168 1 3 0.0602 176 1 2 0.0365 267 1 1 0.0134 > > > > cleanEx(); ..nameEx <- "survdiffr" > > ### * survdiffr > > flush(stderr()); flush(stdout()) > > ### Name: survdiffr > ### Title: Test median survival differences (or other quantile) > ### Aliases: survdiffr > ### Keywords: survival > > ### ** Examples > > > data(colon) > > #We will compare the median survival time for three dukes stages > fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5) > boot.ci(fit$"1") Warning in boot.ci(fit$"1") : bootstrap variances needed for studentized intervals BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS Based on 500 bootstrap replicates CALL : boot.ci(boot.out = fit$"1") Intervals : Level Normal Basic 95% ( 570, 3664 ) (1297, 3473 ) Level Percentile BCa 95% ( -1, 2175 ) ( -1, 2175 ) Calculations and Intervals on Original Scale Some BCa intervals may be unstable > boot.ci(fit$"2") Warning in boot.ci(fit$"2") : bootstrap variances needed for studentized intervals BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS Based on 500 bootstrap replicates CALL : boot.ci(boot.out = fit$"2") Intervals : Level Normal Basic 95% ( 585, 1604 ) ( 731, 1584 ) Level Percentile BCa 95% ( 472, 1325 ) ( 411, 1325 ) Calculations and Intervals on Original Scale Some BCa intervals may be unstable > boot.ci(fit$"3") Warning in boot.ci(fit$"3") : bootstrap variances needed for studentized intervals BOOTSTRAP CONFIDENCE INTERVAL CALCULATIONS Based on 500 bootstrap replicates CALL : boot.ci(boot.out = fit$"3") Intervals : Level Normal Basic 95% (104.7, 271.5 ) ( 48.0, 240.0 ) Level Percentile BCa 95% (158.0, 350.0 ) (126.5, 247.0 ) Calculations and Intervals on Original Scale Some BCa intervals may be unstable > > # 75th quantile of survival function > fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.75) > # bootstrap percentile confidence interval > quantile(fit$"1"$t,c(0.025,0.975)) 2.5% 97.5% 248 594 > quantile(fit$"2"$t,c(0.025,0.975)) 2.5% 97.5% 104 264 > quantile(fit$"3"$t,c(0.025,0.975)) 2.5% 97.5% 45.00 110.15 > > # We can execute this if there is none Inf value > # boot.ci(fit$"1") > # boot.ci(fit$"2") > # boot.ci(fit$"3") > > #We can modify the bootstrap procedure modifiying boot.F parameter > fit<-survdiffr(Survr(hc,time,event)~as.factor(dukes),data=colon,q=0.5,boot.F="PSH") > # bootstrap percentile confidence interval > quantile(fit$"1"$t,c(0.025,0.975)) 2.5% 97.5% 713.800 1966.475 > quantile(fit$"2"$t,c(0.025,0.975)) 2.5% 97.5% 308.975 799.000 > quantile(fit$"3"$t,c(0.025,0.975)) 2.5% 97.5% 70.000 176.525 > > > > > cleanEx(); ..nameEx <- "survfitr" > > ### * survfitr > > flush(stderr()); flush(stdout()) > > ### Name: survfitr > ### Title: Compute a Survival Curve for Recurrent Event Data given a > ### covariate > ### Aliases: survfitr > ### Keywords: survival > > ### ** Examples > > data(colon) > # fit a pena-strawderman-hollander and plot it > fit<-survfitr(Survr(hc,time,event)~as.factor(dukes),data=colon,type="pena") > plot(fit,ylim=c(0,1),xlim=c(0,2000)) > # print the survival estimators > fit Survival for recurrent event data. Group= as.factor(dukes) n events mean se(mean) median recurrences: min max median 1 180 144 1190 58.5 1157 0 6 0 2 148 183 697 38.0 398 0 16 1 3 75 131 259 28.7 107 0 22 1 > summary(fit) Group= 1 time n.event n.risk surv std.error 2 1 299 0.997 0.00333 3 5 298 0.980 0.00805 4 3 293 0.970 0.00982 5 4 290 0.957 0.01171 6 2 285 0.950 0.01255 7 4 283 0.936 0.01403 9 1 279 0.933 0.01438 10 2 277 0.926 0.01504 11 1 275 0.923 0.01535 12 2 274 0.916 0.01596 14 1 272 0.913 0.01625 16 2 271 0.906 0.01681 17 1 269 0.903 0.01708 19 1 268 0.899 0.01734 20 2 267 0.893 0.01785 21 3 265 0.883 0.01857 24 1 262 0.879 0.01880 26 1 261 0.876 0.01902 27 1 260 0.872 0.01925 30 1 257 0.869 0.01947 35 1 256 0.866 0.01968 38 1 255 0.862 0.01990 43 2 253 0.855 0.02031 47 1 251 0.852 0.02051 48 1 250 0.849 0.02071 53 1 249 0.845 0.02090 54 1 248 0.842 0.02109 57 2 247 0.835 0.02146 67 1 244 0.832 0.02164 68 1 243 0.828 0.02182 73 1 242 0.825 0.02200 75 1 241 0.821 0.02217 77 1 240 0.818 0.02234 78 1 239 0.814 0.02251 83 1 238 0.811 0.02267 91 1 236 0.808 0.02283 94 1 235 0.804 0.02299 95 1 234 0.801 0.02315 111 1 233 0.797 0.02330 119 1 232 0.794 0.02345 124 1 230 0.790 0.02360 125 2 229 0.783 0.02389 126 1 227 0.780 0.02403 135 1 226 0.777 0.02417 146 1 224 0.773 0.02431 163 2 223 0.766 0.02457 181 1 220 0.763 0.02471 186 1 219 0.759 0.02484 198 1 218 0.756 0.02496 213 1 217 0.752 0.02509 216 2 216 0.745 0.02533 217 1 214 0.742 0.02545 228 1 213 0.738 0.02557 230 1 211 0.735 0.02568 236 1 210 0.731 0.02580 248 1 208 0.728 0.02591 260 1 207 0.724 0.02602 261 1 206 0.721 0.02613 264 1 205 0.717 0.02624 267 2 204 0.710 0.02644 271 1 202 0.707 0.02654 306 1 197 0.703 0.02665 313 1 196 0.700 0.02675 335 1 194 0.696 0.02685 338 1 192 0.692 0.02696 342 1 191 0.689 0.02706 343 1 190 0.685 0.02716 348 1 189 0.681 0.02725 350 1 188 0.678 0.02735 351 1 187 0.674 0.02744 381 1 185 0.671 0.02753 389 1 183 0.667 0.02762 415 2 179 0.659 0.02780 416 1 177 0.656 0.02789 420 1 176 0.652 0.02798 426 1 175 0.648 0.02807 434 1 174 0.645 0.02815 436 1 173 0.641 0.02823 439 1 172 0.637 0.02831 457 1 170 0.633 0.02839 461 1 169 0.630 0.02847 513 1 167 0.626 0.02854 521 1 165 0.622 0.02862 538 1 161 0.618 0.02870 563 1 158 0.614 0.02878 588 1 155 0.610 0.02887 592 1 154 0.606 0.02895 594 1 153 0.602 0.02903 597 1 152 0.598 0.02910 627 2 149 0.590 0.02925 646 1 147 0.586 0.02933 655 1 145 0.582 0.02940 656 1 144 0.578 0.02947 662 1 143 0.574 0.02954 665 1 142 0.570 0.02960 686 1 141 0.566 0.02967 710 1 138 0.562 0.02973 718 1 137 0.558 0.02980 731 1 136 0.554 0.02986 736 1 134 0.550 0.02992 748 1 133 0.546 0.02997 765 1 130 0.541 0.03003 819 1 124 0.537 0.03010 908 1 115 0.532 0.03020 970 1 109 0.527 0.03031 983 1 107 0.522 0.03042 1022 1 101 0.517 0.03055 1081 1 95 0.512 0.03071 1128 1 82 0.506 0.03095 1157 1 77 0.499 0.03123 1188 1 75 0.492 0.03151 1230 1 68 0.485 0.03185 1268 1 64 0.478 0.03223 1278 1 63 0.470 0.03258 1547 1 28 0.453 0.03534 1736 1 17 0.427 0.04167 2175 1 1 0.000 0.00000 Group= 2 time n.event n.risk surv std.error 1 5 302 0.983 0.00728 2 8 296 0.957 0.01157 3 7 288 0.934 0.01417 4 1 281 0.930 0.01451 5 2 280 0.924 0.01514 7 3 277 0.914 0.01603 8 1 274 0.910 0.01631 9 3 273 0.900 0.01711 12 3 268 0.890 0.01787 14 1 265 0.887 0.01812 15 1 264 0.884 0.01836 16 2 263 0.877 0.01882 18 1 261 0.873 0.01904 19 4 260 0.860 0.01988 22 1 256 0.857 0.02009 23 2 255 0.850 0.02048 24 1 253 0.847 0.02067 27 1 252 0.843 0.02086 28 1 251 0.840 0.02104 29 1 250 0.836 0.02122 32 2 249 0.830 0.02157 35 2 246 0.823 0.02192 38 1 244 0.820 0.02208 39 1 243 0.816 0.02225 40 3 242 0.806 0.02272 42 2 239 0.799 0.02302 43 1 236 0.796 0.02317 49 1 235 0.793 0.02331 51 1 234 0.789 0.02346 54 2 232 0.782 0.02374 56 1 230 0.779 0.02388 58 1 229 0.776 0.02401 60 1 228 0.772 0.02415 63 1 227 0.769 0.02428 64 1 226 0.765 0.02441 68 1 225 0.762 0.02453 76 2 223 0.755 0.02478 77 1 221 0.752 0.02490 78 1 220 0.748 0.02502 79 2 219 0.742 0.02525 80 2 217 0.735 0.02547 81 1 215 0.731 0.02558 83 1 214 0.728 0.02569 86 1 213 0.724 0.02579 93 1 212 0.721 0.02589 98 1 210 0.718 0.02600 99 1 209 0.714 0.02610 104 2 208 0.707 0.02629 105 1 206 0.704 0.02638 107 3 205 0.694 0.02665 108 1 202 0.690 0.02674 121 1 201 0.687 0.02682 122 1 200 0.683 0.02691 125 1 199 0.680 0.02699 127 1 198 0.676 0.02707 128 1 197 0.673 0.02715 130 1 196 0.670 0.02722 132 1 195 0.666 0.02730 135 1 194 0.663 0.02737 139 1 193 0.659 0.02744 147 1 191 0.656 0.02751 148 2 190 0.649 0.02765 150 1 188 0.645 0.02772 167 2 186 0.638 0.02784 184 1 183 0.635 0.02791 189 1 182 0.631 0.02797 190 1 181 0.628 0.02803 191 1 180 0.625 0.02809 199 1 179 0.621 0.02815 202 1 178 0.618 0.02821 206 1 177 0.614 0.02826 214 1 174 0.611 0.02832 215 1 173 0.607 0.02837 216 1 172 0.603 0.02842 226 1 168 0.600 0.02848 227 2 167 0.593 0.02858 230 1 163 0.589 0.02863 242 2 159 0.582 0.02874 245 1 157 0.578 0.02880 252 1 155 0.574 0.02885 264 1 154 0.570 0.02890 272 1 153 0.567 0.02895 276 1 152 0.563 0.02900 280 1 151 0.559 0.02904 285 1 150 0.556 0.02909 287 1 149 0.552 0.02913 293 1 148 0.548 0.02917 299 1 146 0.544 0.02921 320 1 145 0.541 0.02924 327 1 144 0.537 0.02928 335 1 142 0.533 0.02931 360 1 140 0.529 0.02935 364 2 139 0.522 0.02941 368 1 137 0.518 0.02944 369 1 136 0.514 0.02946 371 1 135 0.510 0.02949 388 1 134 0.506 0.02951 396 1 133 0.503 0.02953 398 1 132 0.499 0.02955 400 1 131 0.495 0.02957 436 1 129 0.491 0.02959 450 1 127 0.487 0.02960 453 1 126 0.483 0.02962 462 1 125 0.480 0.02963 489 1 122 0.476 0.02964 504 1 121 0.472 0.02966 510 1 120 0.468 0.02967 520 1 119 0.464 0.02967 570 1 114 0.460 0.02969 581 1 113 0.456 0.02970 587 1 111 0.452 0.02971 595 1 109 0.447 0.02973 654 1 108 0.443 0.02974 698 1 106 0.439 0.02974 733 1 103 0.435 0.02976 742 1 102 0.431 0.02977 758 1 101 0.426 0.02977 799 1 97 0.422 0.02978 808 1 96 0.418 0.02979 939 1 93 0.413 0.02981 953 1 92 0.409 0.02981 1028 1 88 0.404 0.02983 1057 1 84 0.399 0.02986 1068 1 83 0.394 0.02988 1073 1 82 0.389 0.02989 1104 1 77 0.384 0.02992 1116 1 75 0.379 0.02995 1134 1 73 0.374 0.02999 1171 1 68 0.369 0.03004 1236 1 64 0.363 0.03011 1276 1 56 0.356 0.03025 1288 1 52 0.350 0.03042 1291 1 51 0.343 0.03057 1325 1 46 0.335 0.03078 1427 1 35 0.326 0.03131 1449 1 33 0.316 0.03184 1483 1 28 0.304 0.03257 Group= 3 time n.event n.risk surv std.error 1 2 177 0.9887 0.0079 2 5 175 0.9605 0.0145 3 3 170 0.9435 0.0172 5 3 167 0.9266 0.0194 6 1 164 0.9209 0.0201 8 2 163 0.9096 0.0214 11 12 160 0.8414 0.0269 12 9 147 0.7899 0.0299 13 2 138 0.7784 0.0306 14 1 136 0.7727 0.0309 15 2 135 0.7613 0.0314 16 3 131 0.7438 0.0322 17 1 128 0.7380 0.0325 18 1 127 0.7322 0.0328 20 1 126 0.7264 0.0330 21 2 125 0.7148 0.0335 23 1 123 0.7090 0.0337 24 1 122 0.7031 0.0339 27 1 121 0.6973 0.0341 29 1 120 0.6915 0.0343 31 2 118 0.6798 0.0347 32 1 116 0.6739 0.0349 36 1 115 0.6681 0.0351 37 1 114 0.6622 0.0353 38 1 113 0.6564 0.0354 40 1 112 0.6505 0.0356 42 1 111 0.6446 0.0357 43 1 109 0.6387 0.0359 45 1 108 0.6328 0.0360 46 1 106 0.6268 0.0362 47 1 103 0.6208 0.0363 50 2 102 0.6086 0.0366 56 1 98 0.6024 0.0368 57 1 97 0.5962 0.0369 61 1 95 0.5899 0.0370 67 2 94 0.5773 0.0373 69 1 91 0.5710 0.0374 70 3 90 0.5520 0.0377 78 1 87 0.5456 0.0378 79 1 85 0.5392 0.0379 82 2 83 0.5262 0.0380 96 1 77 0.5194 0.0381 99 1 76 0.5125 0.0382 103 1 75 0.5057 0.0383 107 1 74 0.4989 0.0384 113 2 73 0.4852 0.0385 123 1 70 0.4783 0.0386 134 1 68 0.4712 0.0386 141 2 66 0.4570 0.0387 153 1 62 0.4496 0.0388 158 1 61 0.4422 0.0388 161 1 59 0.4347 0.0389 165 1 57 0.4271 0.0389 176 1 56 0.4195 0.0389 177 1 55 0.4118 0.0390 184 1 54 0.4042 0.0390 190 1 52 0.3964 0.0390 199 1 51 0.3887 0.0390 203 1 50 0.3809 0.0389 207 1 49 0.3731 0.0389 212 1 48 0.3653 0.0388 218 1 46 0.3574 0.0388 223 1 44 0.3493 0.0387 226 2 42 0.3326 0.0385 227 1 40 0.3243 0.0384 230 1 39 0.3160 0.0383 247 2 37 0.2989 0.0380 297 1 34 0.2901 0.0379 335 1 31 0.2808 0.0377 350 1 30 0.2714 0.0376 352 1 29 0.2621 0.0374 358 1 28 0.2527 0.0372 367 1 27 0.2433 0.0369 399 1 24 0.2332 0.0367 433 1 23 0.2231 0.0364 474 1 21 0.2124 0.0361 481 1 20 0.2018 0.0358 524 1 18 0.1906 0.0354 540 1 17 0.1794 0.0350 556 1 16 0.1682 0.0344 569 1 15 0.1570 0.0338 589 1 13 0.1449 0.0331 631 1 12 0.1328 0.0323 734 1 8 0.1162 0.0318 755 1 7 0.0996 0.0307 880 1 6 0.0830 0.0291 1088 1 2 0.0415 0.0253 > > # fit a MLE Frailty and plot it (in this case do not show s.e.) > fit<-survfitr(Survr(hc,time,event)~as.factor(dukes),data=colon,type="MLE") Needs to Determine a Seed Value for Alpha Seed Alpha: 18.18003 Alpha estimate= 1.113895 Needs to Determine a Seed Value for Alpha Seed Alpha: 12.55364 Alpha estimate= 1.456904 Needs to Determine a Seed Value for Alpha Seed Alpha: 9.342046 Alpha estimate= 2.195769 > plot(fit) > # print the survival estimators > fit Survival for recurrent event data. Group= as.factor(dukes) n events mean se(mean) median recurrences: min max median 1 180 144 1350 67.5 2175 0 6 0 2 148 183 841 46.9 1073 0 16 1 3 75 131 363 45.9 199 0 22 1 > summary(fit) Group= 1 time n.event n.risk surv 2 1 299 0.998 3 5 298 0.985 4 3 293 0.978 5 4 290 0.968 6 2 285 0.963 7 4 283 0.953 9 1 279 0.950 10 2 277 0.945 11 1 275 0.942 12 2 274 0.937 14 1 272 0.934 16 2 271 0.929 17 1 269 0.926 19 1 268 0.924 20 2 267 0.919 21 3 265 0.911 24 1 262 0.908 26 1 261 0.905 27 1 260 0.903 30 1 257 0.900 35 1 256 0.897 38 1 255 0.894 43 2 253 0.889 47 1 251 0.886 48 1 250 0.884 53 1 249 0.881 54 1 248 0.878 57 2 247 0.873 67 1 244 0.870 68 1 243 0.867 73 1 242 0.864 75 1 241 0.861 77 1 240 0.859 78 1 239 0.856 83 1 238 0.853 91 1 236 0.850 94 1 235 0.847 95 1 234 0.845 111 1 233 0.842 119 1 232 0.839 124 1 230 0.836 125 2 229 0.831 126 1 227 0.828 135 1 226 0.825 146 1 224 0.822 163 2 223 0.817 181 1 220 0.814 186 1 219 0.811 198 1 218 0.808 213 1 217 0.805 216 2 216 0.799 217 1 214 0.796 228 1 213 0.794 230 1 211 0.791 236 1 210 0.788 248 1 208 0.785 260 1 207 0.782 261 1 206 0.779 264 1 205 0.776 267 2 204 0.770 271 1 202 0.767 306 1 197 0.764 313 1 196 0.761 335 1 194 0.758 338 1 192 0.755 342 1 191 0.752 343 1 190 0.749 348 1 189 0.746 350 1 188 0.743 351 1 187 0.740 381 1 185 0.736 389 1 183 0.733 415 2 179 0.727 416 1 177 0.724 420 1 176 0.720 426 1 175 0.717 434 1 174 0.714 436 1 173 0.711 439 1 172 0.707 457 1 170 0.704 461 1 169 0.701 513 1 167 0.698 521 1 165 0.694 538 1 161 0.691 563 1 158 0.687 588 1 155 0.684 592 1 154 0.680 594 1 153 0.677 597 1 152 0.673 627 2 149 0.666 646 1 147 0.663 655 1 145 0.659 656 1 144 0.655 662 1 143 0.651 665 1 142 0.648 686 1 141 0.644 710 1 138 0.640 718 1 137 0.636 731 1 136 0.633 736 1 134 0.629 748 1 133 0.625 765 1 130 0.621 819 1 124 0.617 908 1 115 0.613 970 1 109 0.608 983 1 107 0.603 1022 1 101 0.598 1081 1 95 0.593 1128 1 82 0.587 1157 1 77 0.580 1188 1 75 0.574 1230 1 68 0.567 1268 1 64 0.559 1278 1 63 0.552 1547 1 28 0.533 1736 1 17 0.504 2175 1 1 0.247 Group= 2 time n.event n.risk surv 1 5 302 0.989 2 8 296 0.971 3 7 288 0.955 4 1 281 0.952 5 2 280 0.947 7 3 277 0.939 8 1 274 0.937 9 3 273 0.929 12 3 268 0.921 14 1 265 0.918 15 1 264 0.915 16 2 263 0.910 18 1 261 0.907 19 4 260 0.897 22 1 256 0.894 23 2 255 0.889 24 1 253 0.886 27 1 252 0.883 28 1 251 0.880 29 1 250 0.878 32 2 249 0.872 35 2 246 0.867 38 1 244 0.864 39 1 243 0.862 40 3 242 0.853 42 2 239 0.848 43 1 236 0.845 49 1 235 0.842 51 1 234 0.840 54 2 232 0.834 56 1 230 0.831 58 1 229 0.829 60 1 228 0.826 63 1 227 0.823 64 1 226 0.820 68 1 225 0.818 76 2 223 0.812 77 1 221 0.809 78 1 220 0.807 79 2 219 0.801 80 2 217 0.796 81 1 215 0.793 83 1 214 0.790 86 1 213 0.787 93 1 212 0.785 98 1 210 0.782 99 1 209 0.779 104 2 208 0.773 105 1 206 0.771 107 3 205 0.762 108 1 202 0.759 121 1 201 0.757 122 1 200 0.754 125 1 199 0.751 127 1 198 0.748 128 1 197 0.745 130 1 196 0.743 132 1 195 0.740 135 1 194 0.737 139 1 193 0.734 147 1 191 0.731 148 2 190 0.726 150 1 188 0.723 167 2 186 0.717 184 1 183 0.714 189 1 182 0.711 190 1 181 0.708 191 1 180 0.705 199 1 179 0.702 202 1 178 0.699 206 1 177 0.696 214 1 174 0.694 215 1 173 0.691 216 1 172 0.688 226 1 168 0.685 227 2 167 0.679 230 1 163 0.675 242 2 159 0.669 245 1 157 0.666 252 1 155 0.663 264 1 154 0.660 272 1 153 0.657 276 1 152 0.654 280 1 151 0.650 285 1 150 0.647 287 1 149 0.644 293 1 148 0.641 299 1 146 0.638 320 1 145 0.634 327 1 144 0.631 335 1 142 0.628 360 1 140 0.625 364 2 139 0.618 368 1 137 0.615 369 1 136 0.612 371 1 135 0.608 388 1 134 0.605 396 1 133 0.602 398 1 132 0.598 400 1 131 0.595 436 1 129 0.592 450 1 127 0.588 453 1 126 0.585 462 1 125 0.581 489 1 122 0.578 504 1 121 0.574 510 1 120 0.571 520 1 119 0.568 570 1 114 0.564 581 1 113 0.560 587 1 111 0.556 595 1 109 0.552 654 1 108 0.548 698 1 106 0.544 733 1 103 0.540 742 1 102 0.536 758 1 101 0.532 799 1 97 0.527 808 1 96 0.523 939 1 93 0.519 953 1 92 0.514 1028 1 88 0.510 1057 1 84 0.505 1068 1 83 0.500 1073 1 82 0.495 1104 1 77 0.490 1116 1 75 0.485 1134 1 73 0.479 1171 1 68 0.474 1236 1 64 0.468 1276 1 56 0.461 1288 1 52 0.454 1291 1 51 0.447 1325 1 46 0.439 1427 1 35 0.429 1449 1 33 0.418 1483 1 28 0.405 Group= 3 time n.event n.risk surv 1 2 177 0.992 2 5 175 0.974 3 3 170 0.963 5 3 167 0.951 6 1 164 0.947 8 2 163 0.940 11 12 160 0.895 12 9 147 0.857 13 2 138 0.847 14 1 136 0.842 15 2 135 0.832 16 3 131 0.817 17 1 128 0.812 18 1 127 0.807 20 1 126 0.801 21 2 125 0.791 23 1 123 0.786 24 1 122 0.781 27 1 121 0.776 29 1 120 0.770 31 2 118 0.760 32 1 116 0.755 36 1 115 0.749 37 1 114 0.744 38 1 113 0.739 40 1 112 0.734 42 1 111 0.728 43 1 109 0.723 45 1 108 0.718 46 1 106 0.713 47 1 103 0.707 50 2 102 0.697 56 1 98 0.691 57 1 97 0.686 61 1 95 0.680 67 2 94 0.669 69 1 91 0.663 70 3 90 0.646 78 1 87 0.640 79 1 85 0.634 82 2 83 0.622 96 1 77 0.615 99 1 76 0.609 103 1 75 0.603 107 1 74 0.596 113 2 73 0.584 123 1 70 0.577 134 1 68 0.571 141 2 66 0.558 153 1 62 0.551 158 1 61 0.544 161 1 59 0.537 165 1 57 0.530 176 1 56 0.523 177 1 55 0.516 184 1 54 0.509 190 1 52 0.501 199 1 51 0.494 203 1 50 0.487 207 1 49 0.480 212 1 48 0.472 218 1 46 0.465 223 1 44 0.457 226 2 42 0.441 227 1 40 0.433 230 1 39 0.425 247 2 37 0.407 297 1 34 0.398 335 1 31 0.388 350 1 30 0.378 352 1 29 0.368 358 1 28 0.358 367 1 27 0.348 399 1 24 0.337 433 1 23 0.326 474 1 21 0.315 481 1 20 0.304 524 1 18 0.293 540 1 17 0.281 556 1 16 0.269 569 1 15 0.257 589 1 13 0.243 631 1 12 0.229 734 1 8 0.209 755 1 7 0.189 880 1 6 0.167 1088 1 2 0.113 > > > > > cleanEx(); ..nameEx <- "wcfit" > > ### * wcfit > > flush(stderr()); flush(stdout()) > > ### Name: wc.fit > ### Title: Survival function estimator for recurrence time data using the > ### estimator developed by Wang and Chang. > ### Aliases: wc.fit > ### Keywords: survival > > ### ** Examples > > > data(MMC) > > fit<-wc.fit(Survr(MMC$id,MMC$time,MMC$event)) > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 99 106 12.7 95 2 10 5 > plot(fit,conf.int=FALSE) > > # compare with pena-straderman-hollander > > fit<-psh.fit(Survr(MMC$id,MMC$time,MMC$event)) > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 80 104 5.87 98 1 9 4 > lines(fit,lty=2) > > # and with MLE frailty > > fit<-mlefrailty.fit(Survr(MMC$id,MMC$time,MMC$event)) Needs to Determine a Seed Value for Alpha Seed Alpha: 20.02853 Alpha estimate= 10.17623 > fit Survival for recurrent event data n events mean se(mean) median recurrences: min max median 19 80 108 6.7 100 1 9 4 > lines(fit,lty=3) > > > > > ### *