Hey, so I’m trying to conduct a meta-analysis of Kaplan-Meier curves and I’m using the "metasurvival" package. Even though every column is of the same length, R keeps telling me that "In ref.study != ref.data : longer object length is not a multiple of shorter object length". Does anyone know how to solve this? Thank you in advance!
library(metaSurvival)
dat<-Example
attach(dat)
head(dat)
results<-msurv(study = study, time = time, n.risk = NbRisk, surv.rate = survival, confidence = "Greenwood", correctionFlag = TRUE, correctionVal = c(0.25,0.5))
Created on 2023-03-19 with reprex v2.0.2
Example data set:
study | time | survival | NbRisk | censor | event |
---|---|---|---|---|---|
1 | 0.0000000 | 1.0000000 | 20 | 0 | 0 |
1 | 0.4154789 | 0.9982487 | 20 | 0 | 0 |
1 | 0.4212492 | 0.9877357 | 20 | 0 | 0 |
1 | 0.4212492 | 0.9669454 | 20 | 0 | 1 |
1 | 0.4280217 | 0.9506460 | 19 | 0 | 0 |
1 | 0.4295839 | 0.9506460 | 19 | 0 | 0 |
1 | 0.5407174 | 0.9506460 | 19 | 0 | 0 |
1 | 0.5970652 | 0.9506460 | 19 | 0 | 0 |
1 | 0.6534130 | 0.9506460 | 19 | 0 | 0 |
1 | 0.7661087 | 0.9506460 | 19 | 0 | 0 |
1 | 2.2042515 | 0.9506460 | 19 | 0 | 0 |
1 | 2.3311967 | 0.9499877 | 19 | 0 | 0 |
1 | 2.3600478 | 0.9285440 | 19 | 0 | 0 |
1 | 2.3600478 | 0.9181488 | 19 | 0 | 1 |
1 | 2.3645358 | 0.9181488 | 18 | 0 | 0 |
1 | 2.5043037 | 0.9015010 | 18 | 0 | 0 |
1 | 2.6312488 | 0.9015010 | 18 | 0 | 0 |
1 | 2.7581940 | 0.9015010 | 18 | 0 | 0 |
1 | 2.8851391 | 0.9009637 | 18 | 0 | 0 |
1 | 2.9543819 | 0.8786882 | 18 | 0 | 0 |
1 | 2.9543819 | 0.8682930 | 18 | 0 | 1 |
1 | 2.9607292 | 0.8537795 | 17 | 0 | 0 |
1 | 2.9630373 | 0.8537795 | 17 | 0 | 0 |
1 | 3.0928676 | 0.8514909 | 17 | 0 | 0 |
1 | 3.4737030 | 0.8514692 | 17 | 0 | 0 |
1 | 4.1084288 | 0.8512038 | 17 | 0 | 0 |
1 | 4.1949823 | 0.8252851 | 17 | 0 | 0 |
1 | 4.1949823 | 0.8148900 | 17 | 0 | 1 |
1 | 4.1963139 | 0.8148900 | 16 | 0 | 0 |
1 | 4.2101291 | 0.8029010 | 16 | 0 | 0 |
1 | 4.3392381 | 0.8014745 | 16 | 0 | 0 |
1 | 4.4661833 | 0.8014386 | 16 | 0 | 0 |
1 | 4.5931284 | 0.8014386 | 16 | 0 | 0 |
1 | 4.7200736 | 0.8014386 | 16 | 0 | 0 |
1 | 4.8470187 | 0.8014386 | 16 | 0 | 0 |
1 | 4.9739639 | 0.8000064 | 16 | 0 | 0 |
1 | 4.9843503 | 0.7883528 | 16 | 0 | 0 |
1 | 4.9855043 | 0.7777897 | 16 | 0 | 0 |
1 | 4.9855043 | 0.7673945 | 16 | 0 | 1 |
1 | 4.9927931 | 0.7536950 | 15 | 0 | 0 |
1 | 5.1239900 | 0.7507022 | 15 | 0 | 0 |
1 | 5.1586114 | 0.7256135 | 15 | 0 | 0 |
1 | 5.1586114 | 0.7152184 | 15 | 0 | 1 |
1 | 5.1619086 | 0.7152184 | 14 | 0 | 0 |
1 | 5.1681153 | 0.7030628 | 14 | 0 | 0 |
1 | 5.2855565 | 0.7001052 | 14 | 0 | 0 |
1 | 5.2866057 | 0.6870087 | 14 | 0 | 0 |
1 | 5.2913268 | 0.6753252 | 14 | 0 | 0 |
1 | 5.2913268 | 0.6649300 | 14 | 0 | 1 |
1 | 5.3064736 | 0.6529410 | 13 | 0 | 0 |
1 | 5.4355826 | 0.6512783 | 13 | 0 | 0 |
1 | 5.5625278 | 0.6502545 | 13 | 0 | 0 |
1 | 5.5751174 | 0.6370250 | 13 | 0 | 0 |
1 | 5.5798385 | 0.6253736 | 13 | 0 | 0 |
1 | 5.5798385 | 0.6149785 | 13 | 0 | 1 |
1 | 5.5949853 | 0.6030780 | 12 | 0 | 0 |
1 | 5.7240943 | 0.6012086 | 12 | 0 | 0 |
1 | 5.8510395 | 0.5997123 | 12 | 0 | 0 |
1 | 5.8625799 | 0.5890982 | 12 | 0 | 0 |
1 | 5.8625799 | 0.5724817 | 12 | 0 | 1 |
1 | 5.8716908 | 0.5524062 | 11 | 0 | 0 |
1 | 5.8914311 | 0.5255739 | 11 | 0 | 0 |
1 | 5.8914311 | 0.5151787 | 11 | 0 | 1 |
1 | 5.8946368 | 0.5151787 | 10 | 0 | 0 |
1 | 5.9004070 | 0.5022378 | 10 | 0 | 0 |
1 | 6.0241465 | 0.4992784 | 10 | 0 | 0 |
1 | 6.0299167 | 0.4888442 | 10 | 0 | 0 |
1 | 6.0299167 | 0.4160781 | 10 | 0 | 2 |
1 | 6.0332574 | 0.4022326 | 8 | 0 | 0 |
1 | 6.1626321 | 0.4017921 | 8 | 0 | 0 |
1 | 7.0454779 | 0.3999985 | 8 | 0 | 0 |
1 | 7.0570184 | 0.3893205 | 8 | 0 | 0 |
1 | 7.0570184 | 0.3685302 | 8 | 0 | 1 |
1 | 7.0670404 | 0.3538457 | 7 | 0 | 0 |
1 | 7.2012742 | 0.3517642 | 7 | 0 | 0 |
1 | 7.3282194 | 0.3517642 | 7 | 0 | 0 |
1 | 7.8879321 | 0.3291221 | 7 | 0 | 0 |
1 | 7.8879321 | 0.3187269 | 7 | 0 | 1 |
1 | 7.8948564 | 0.3187269 | 6 | 0 | 0 |
1 | 7.9052428 | 0.3187269 | 6 | 0 | 0 |
1 | 7.9990091 | 0.3012503 | 6 | 0 | 0 |
1 | 9.1285324 | 0.3012503 | 6 | 0 | 0 |
1 | 9.2554776 | 0.3008048 | 6 | 0 | 0 |
1 | 9.2958692 | 0.2791146 | 6 | 0 | 0 |
1 | 9.2958692 | 0.2687195 | 6 | 0 | 1 |
1 | 9.3027935 | 0.2687195 | 5 | 0 | 0 |
1 | 9.3042040 | 0.2540460 | 5 | 0 | 0 |
1 | 9.4069462 | 0.2505342 | 5 | 0 | 0 |
1 | 9.5209084 | 0.2505342 | 5 | 0 | 0 |
1 | 9.6478535 | 0.2505342 | 5 | 0 | 0 |
1 | 9.7747987 | 0.2505342 | 5 | 0 | 0 |
1 | 9.9017438 | 0.2505342 | 5 | 0 | 0 |
1 | 11.0442502 | 0.2500453 | 5 | 0 | 0 |
1 | 11.0796959 | 0.2343392 | 5 | 0 | 0 |
1 | 11.0915661 | 0.2199622 | 5 | 0 | 1 |
1 | 11.0946638 | 0.2034699 | 4 | 0 | 0 |
1 | 11.2288977 | 0.2008290 | 4 | 0 | 0 |
1 | 11.3558428 | 0.2007931 | 4 | 0 | 0 |
1 | 11.4862826 | 0.2007931 | 4 | 0 | 0 |
1 | 11.6097331 | 0.2007931 | 4 | 0 | 0 |
1 | 11.7366783 | 0.2000411 | 4 | 0 | 0 |
1 | 11.7650856 | 0.1868224 | 4 | 0 | 0 |
1 | 11.7655294 | 0.1735286 | 4 | 0 | 1 |
1 | 11.7655294 | 0.1423431 | 3 | 0 | 0 |
1 | 11.7795429 | 0.1331469 | 3 | 0 | 0 |
1 | 11.9097853 | 0.1331469 | 3 | 0 | 0 |
1 | 12.0367304 | 0.1331469 | 3 | 0 | 0 |
2 | 0.000000 | 1.0000000 | 16 | 4 | 0 |
2 | 2.972599 | 0.9898192 | 12 | 0 | 0 |
2 | 2.972868 | 0.9528280 | 12 | 0 | 1 |
2 | 3.007984 | 0.9360596 | 11 | 3 | 0 |
2 | 5.002664 | 0.9356764 | 8 | 1 | 0 |
2 | 5.978137 | 0.9349110 | 7 | 0 | 0 |
2 | 5.978271 | 0.9164154 | 7 | 0 | 0 |
2 | 5.978406 | 0.8979198 | 7 | 0 | 0 |
2 | 5.978540 | 0.8794242 | 7 | 0 | 0 |
2 | 5.978675 | 0.8609287 | 7 | 0 | 0 |
2 | 5.978776 | 0.8470570 | 7 | 0 | 1 |
2 | 5.978843 | 0.8378092 | 6 | 0 | 0 |
2 | 5.978910 | 0.8285614 | 6 | 0 | 0 |
2 | 5.978977 | 0.8193136 | 6 | 0 | 0 |
2 | 5.979044 | 0.8100658 | 6 | 0 | 0 |
2 | 5.979112 | 0.8008180 | 6 | 0 | 0 |
2 | 5.979179 | 0.7915702 | 6 | 0 | 0 |
2 | 5.979246 | 0.7823224 | 6 | 0 | 0 |
2 | 5.979313 | 0.7730746 | 6 | 0 | 0 |
2 | 5.979381 | 0.7638268 | 6 | 0 | 0 |
2 | 5.979414 | 0.7592029 | 6 | 0 | 0 |
2 | 5.979448 | 0.7545790 | 6 | 0 | 0 |
2 | 5.979481 | 0.7499551 | 6 | 0 | 0 |
2 | 5.979515 | 0.7453312 | 6 | 0 | 0 |
2 | 5.979549 | 0.7407073 | 6 | 0 | 0 |
2 | 5.979582 | 0.7360834 | 6 | 0 | 0 |
2 | 5.979616 | 0.7314595 | 6 | 0 | 0 |
2 | 5.979650 | 0.7268356 | 6 | 0 | 0 |
2 | 5.979683 | 0.7222117 | 6 | 0 | 0 |
2 | 5.979717 | 0.7175878 | 6 | 0 | 1 |
2 | 5.979750 | 0.7129639 | 5 | 0 | 0 |
2 | 5.979784 | 0.7083400 | 5 | 0 | 0 |
2 | 5.979818 | 0.7037161 | 5 | 0 | 0 |
2 | 5.979851 | 0.6990922 | 5 | 0 | 0 |
2 | 5.979885 | 0.6944683 | 5 | 0 | 0 |
2 | 5.979986 | 0.6805966 | 5 | 0 | 0 |
2 | 5.980053 | 0.6713488 | 5 | 0 | 0 |
2 | 5.980087 | 0.6667249 | 5 | 0 | 0 |
2 | 5.980120 | 0.6621010 | 5 | 0 | 0 |
2 | 5.980154 | 0.6574771 | 5 | 0 | 0 |
2 | 5.980187 | 0.6528532 | 5 | 0 | 0 |
2 | 5.980221 | 0.6482293 | 5 | 0 | 0 |
2 | 5.980255 | 0.6436054 | 5 | 0 | 0 |
2 | 5.980288 | 0.6389815 | 5 | 0 | 0 |
2 | 5.980322 | 0.6343576 | 5 | 0 | 0 |
2 | 5.980355 | 0.6297337 | 5 | 0 | 0 |
2 | 5.980389 | 0.6251098 | 5 | 0 | 0 |
2 | 5.980423 | 0.6204859 | 5 | 0 | 0 |
2 | 5.980456 | 0.6158620 | 5 | 0 | 0 |
2 | 5.980490 | 0.6112381 | 5 | 0 | 0 |
2 | 5.980524 | 0.6066142 | 5 | 0 | 0 |
2 | 5.980557 | 0.6019903 | 5 | 0 | 0 |
2 | 5.980591 | 0.5973664 | 5 | 0 | 0 |
2 | 5.980624 | 0.5927425 | 5 | 0 | 0 |
2 | 5.980658 | 0.5881186 | 5 | 0 | 1 |
2 | 5.980692 | 0.5834948 | 4 | 0 | 0 |
2 | 5.980725 | 0.5788709 | 4 | 0 | 0 |
2 | 5.980759 | 0.5742470 | 4 | 0 | 0 |
2 | 5.983340 | 0.5630996 | 4 | 4 | 0 |
2 | 8.986028 | 0.5563300 | 0 | 0 | 0 |
2 | 8.986095 | 0.5470822 | 0 | 0 | 0 |
2 | 8.986163 | 0.5378344 | 0 | 0 | 0 |
2 | 8.986230 | 0.5285866 | 0 | 0 | 0 |
2 | 8.986297 | 0.5193388 | 0 | 0 | 0 |
2 | 8.986364 | 0.5100910 | 0 | 0 | 0 |
2 | 8.986431 | 0.5008432 | 0 | 0 | 0 |
2 | 8.986499 | 0.4915954 | 0 | 0 | 0 |
2 | 8.986532 | 0.4869715 | 0 | 0 | 0 |
2 | 8.986566 | 0.4823476 | 0 | 0 | 0 |
2 | 8.986633 | 0.4730998 | 0 | 0 | 0 |
2 | 8.986700 | 0.4638520 | 0 | 0 | 0 |
2 | 8.986768 | 0.4546042 | 0 | 0 | 0 |
2 | 8.986835 | 0.4453564 | 0 | 0 | 0 |
2 | 8.986936 | 0.4314847 | 0 | 0 | 0 |
2 | 8.987003 | 0.4222369 | 0 | 0 | 0 |
2 | 8.987070 | 0.4129891 | 0 | 0 | 0 |
2 | 8.987137 | 0.4037413 | 0 | 0 | 0 |
2 | 8.987205 | 0.3944935 | 0 | 0 | 0 |
2 | 8.987272 | 0.3852457 | 0 | 0 | 0 |
2 | 8.987339 | 0.3759979 | 0 | 0 | 0 |
2 | 8.987406 | 0.3667501 | 0 | 0 | 0 |
2 | 8.987474 | 0.3575023 | 0 | 0 | 0 |
2 | 8.987743 | 0.3205112 | 0 | 0 | 0 |
2 | 10.982461 | 0.3149261 | 0 | 0 | 0 |
2 | 11.992995 | 0.3049061 | 0 | 0 | 0 |
2 | 11.993264 | 0.2679149 | 0 | 0 | 0 |
2 | 11.993398 | 0.2494194 | 0 | 0 | 0 |
2 | 11.993466 | 0.2401716 | 0 | 0 | 0 |
2 | 11.993533 | 0.2309238 | 0 | 0 | 0 |
2 | 11.993600 | 0.2216760 | 0 | 0 | 0 |
2 | 11.993667 | 0.2124282 | 0 | 0 | 0 |
2 | 11.993734 | 0.2031804 | 0 | 0 | 0 |
2 | 12.000000 | 0.1924876 | 0 | 0 | 0 |
3 | 0.0000000 | 1.0000000 | 86 | 0 | 0 |
3 | 0.3771191 | 0.9664148 | 86 | 1 | 3 |
3 | 0.9584646 | 0.9645975 | 82 | 1 | 0 |
3 | 1.5202772 | 0.9636304 | 81 | 1 | 0 |
3 | 2.0530596 | 0.9553136 | 80 | 1 | 1 |
3 | 2.3586153 | 0.9493715 | 78 | 0 | 0 |
3 | 2.5568189 | 0.9394176 | 78 | 1 | 1 |
3 | 2.7635765 | 0.9273941 | 76 | 0 | 1 |
3 | 2.9470398 | 0.9136588 | 75 | 1 | 1 |
3 | 3.2603652 | 0.8971583 | 73 | 0 | 2 |
3 | 3.4837739 | 0.8797844 | 71 | 0 | 1 |
3 | 3.5739556 | 0.8688014 | 70 | 1 | 1 |
3 | 3.7992385 | 0.8468332 | 68 | 0 | 1 |
3 | 3.8091664 | 0.8468332 | 67 | 0 | 0 |
3 | 3.8893630 | 0.8376799 | 67 | 0 | 1 |
3 | 4.0693268 | 0.8285221 | 66 | 1 | 1 |
3 | 4.1639719 | 0.8197711 | 64 | 0 | 1 |
3 | 4.3396434 | 0.8028921 | 63 | 0 | 1 |
3 | 4.3848484 | 0.7937411 | 62 | 0 | 1 |
3 | 4.6543659 | 0.7937274 | 61 | 1 | 0 |
3 | 4.7446046 | 0.7809147 | 60 | 0 | 1 |
3 | 5.0143505 | 0.7735821 | 59 | 0 | 0 |
3 | 5.1493946 | 0.7644266 | 59 | 0 | 1 |
3 | 5.1497942 | 0.7516184 | 58 | 0 | 1 |
3 | 5.1501366 | 0.7406400 | 57 | 1 | 1 |
3 | 5.2373718 | 0.7127646 | 55 | 0 | 2 |
3 | 5.2414027 | 0.6948920 | 53 | 0 | 1 |
3 | 5.4398484 | 0.6821550 | 52 | 1 | 1 |
3 | 6.0777028 | 0.6270670 | 50 | 1 | 4 |
3 | 6.3220985 | 0.6106694 | 45 | 0 | 1 |
3 | 6.5929288 | 0.5685717 | 44 | 0 | 3 |
3 | 6.5934425 | 0.5521041 | 41 | 0 | 1 |
3 | 6.6387045 | 0.5411234 | 40 | 1 | 1 |
3 | 6.9234504 | 0.5285246 | 38 | 1 | 1 |
3 | 7.4060170 | 0.5137801 | 36 | 1 | 1 |
3 | 7.9950469 | 0.5061289 | 34 | 1 | 1 |
3 | 8.5290893 | 0.4949369 | 32 | 1 | 0 |
3 | 9.0210135 | 0.4832529 | 31 | 0 | 1 |
3 | 9.3359918 | 0.4732862 | 30 | 1 | 1 |
3 | 9.6417921 | 0.4699296 | 28 | 1 | 0 |
3 | 10.1383012 | 0.4593659 | 27 | 1 | 0 |
3 | 10.5073361 | 0.4476621 | 26 | 0 | 1 |
3 | 10.6486332 | 0.4203638 | 25 | 0 | 2 |
3 | 10.8203930 | 0.4073404 | 23 | 0 | 0 |
3 | 10.8658263 | 0.3908704 | 23 | 0 | 1 |
3 | 10.8662829 | 0.3762326 | 22 | 1 | 1 |
3 | 11.0413336 | 0.3628733 | 20 | 1 | 1 |
3 | 11.4545212 | 0.3614794 | 18 | 0 | 0 |
3 | 11.7653026 | 0.3560598 | 18 | 0 | 0 |
3 | 11.9351305 | 0.3426886 | 18 | 0 | 1 |
3 | 12.3501705 | 0.3267543 | 17 | 1 | 1 |