Survival analysis in health economic evaluation Contains a suite of functions to systematise the workflow involving survival analysis in health economic evaluation. survHE can fit a large range of survival models using both a frequentist approach (by calling the R package flexsurv) and a Bayesian perspective.
'Error in if (n.censor[i] <= 0) { : missing value where TRUE/FALSE needed'
when using digitise().
I have checked that in the survival data (taken from a plot using Web Plot Digitizer) my time values are monotonically increasing and my survival probabilities monotonically decreasing, and I believe the survival data file and the 'at risk' file are in the correct format.
Fortunately, the data has only 61 points, so it might be easiest for me to copy them out below:
I've solved this issue myself. Seems I was making a statistical error by continuing the points at zero until end of follow-up, which no doubt contradicted something in the algorithm.
I get the error:
'Error in if (n.censor[i] <= 0) { : missing value where TRUE/FALSE needed'
when using digitise().
I have checked that in the survival data (taken from a plot using Web Plot Digitizer) my time values are monotonically increasing and my survival probabilities monotonically decreasing, and I believe the survival data file and the 'at risk' file are in the correct format.
Fortunately, the data has only 61 points, so it might be easiest for me to copy them out below:
surv_input:
"ID" "time" "survival" 1 0 1 2 0.616635073877181 0.99596758926205 3 0.917800251302009 0.975700551767342 4 1.34326203540272 0.970271225373266 5 1.50045808873425 0.928583208175045 6 1.92215687048514 0.898886827458256 7 2.24419870186262 0.877948582030215 8 2.69881972131212 0.87291280148423 9 2.97528093146231 0.846635871417212 10 3.21546110569124 0.823379568277527 11 3.76241613358418 0.803961344777671 12 4.22012887045848 0.780052044430523 13 4.52037331318269 0.760005300821627 14 4.64609733049656 0.732895384498883 15 4.8230046635952 0.711025708984893 16 4.94877972347112 0.682916209155276 17 5.2485600374441 0.654783991518685 18 5.74471114147313 0.629453636742266 19 6.12606481664232 0.61317254174397 20 6.34753539990188 0.579247283328916 21 6.79095837727188 0.57193214948317 22 6.89241374729868 0.544281493261085 23 6.96237012785614 0.50374843815077 24 7.29532230687246 0.490723562152133 25 7.33882964625475 0.455031363194628 26 7.8476980233677 0.448875984868564 27 8.39798015114006 0.448027853408187 28 8.54932322246892 0.423001550088749 29 8.80068948275635 0.398371469800041 30 8.95210200134212 0.371985157699443 31 10.8539752829967 0.351456521215334 32 9.20327359057869 0.351167385490205 33 9.75353209534712 0.350781871190034 34 10.3037709142789 0.350781871190034 35 11.3044062072782 0.346844117981144 36 11.605619896229 0.325627063103872 37 11.9709756653619 0.307769489985233 38 12.1453169496591 0.287172011661808 39 12.3668030003617 0.252943849153762 40 12.9601891890922 0.247624669702592 41 13.4448257777828 0.226212562947257 42 14.0118197043946 0.224622316459051 43 14.4122748983539 0.219109461966605 44 17.4644792147812 0.201876972748958 45 14.7133638634685 0.200334915548274 46 15.2636076038594 0.200238536973231 47 15.8138464227913 0.200238536973231 48 16.3640852417231 0.200238536973231 49 16.9143240606549 0.200238536973231 50 18.0148840509351 0.198625802150848 51 18.1162329716232 0.17305977881117 52 19.2167893528332 0.171517721610486 53 18.6665800626563 0.170939450160229 54 19.7670724648974 0.170650314435101 55 20.3174284145571 0.168356504349083 56 20.5190993114571 0.137335453661984 57 20.5202903045717 0.114011838501634 58 20.6216118525727 0.088981863617432 60 21.548162475822 0 59 23.9991157778392 0 61 24 0
nrisk_inp:
"interval" "time" "lower" "upper" "nrisk" 1 0 1 6 40 2 2 7 11 36 3 4 12 18 32 4 6 19 26 25 5 8 27 30 18 6 10 31 37 14 7 12 38 41 12 8 14 42 43 9 9 16 44 49 8 10 18 50 54 6 11 20 55 59 3 12 22 60 60 0 13 24 61 61 0