# cp: Conditional power given observed log hazard ratio In PWEALL: Design and Monitoring of Survival Trials Accounting for Complex Situations

## Description

This will calculate the conditional power given the observed log hazard ratio based on Cox model

## Arguments

 Dplan Planned number of events at study end alpha Type 1 error rate two.sided =1 two-sided test and =0 one-sided test pi1 Allocation probability for the treatment group Obsbeta observed log hazard ratio BetaD designed log hazard ratio, i.e. under alternative hypothesis Beta0 null log hazard ratio, i.e. under null hypothesis prop proportion of Dplan observed

## Details

This is to calculated conditional power at time point when certain percent of target number of event has been observed and an observed log hazard ratio is provided.

## Value

 CPT Conditional power under current trend CPN Conditional power under null hypothesis CPD Conditional power according to design, i.e. under alternative hypothesis

## Note

This will calculate the conditional power given the observed log hazard ratio based on Cox model

Xiaodong Luo

## References

Halperin, Lan, Ware, Johnson and DeMets (1982). Controlled Clinical Trials.

## Examples

 1 2 3 4 ###Calculate the CP at 10-90 percent of the target 300 events when the observed HR ###are seq(1,0.6,by=-0.01) with 2:1 allocation ###ratio between the treatment group and the control group cp(pi1=2/3)

### Example output

\$CPT
HR= 1     HR= 0.99     HR= 0.98     HR= 0.97     HR= 0.96
[1,] 1.941502e-02 2.388077e-02 2.923841e-02 3.562880e-02 4.320529e-02
[2,] 1.421482e-02 1.788379e-02 2.238113e-02 2.785783e-02 3.448210e-02
[3,] 9.574822e-03 1.239936e-02 1.595857e-02 2.041000e-02 2.593427e-02
[4,] 5.698209e-03 7.667639e-03 1.024241e-02 1.357917e-02 1.786438e-02
[5,] 2.787298e-03 3.956538e-03 5.566013e-03 7.758226e-03 1.071177e-02
[6,] 9.709565e-04 1.492755e-03 2.268726e-03 3.407532e-03 5.056149e-03
[7,] 1.728598e-04 3.033887e-04 5.241656e-04 8.910547e-04 1.489726e-03
[8,] 5.863223e-06 1.339774e-05 2.987912e-05 6.498744e-05 1.377510e-04
[9,] 2.860159e-10 1.438631e-09 6.881215e-09 3.125003e-08 1.345242e-07
HR= 0.95     HR= 0.94     HR= 0.93     HR= 0.92     HR= 0.91
[1,] 5.213233e-02 6.258315e-02 7.473665e-02 8.877311e-02 1.048690e-01
[2,] 4.243841e-02 5.192552e-02 6.315335e-02 7.633844e-02 9.169794e-02
[3,] 3.273511e-02 4.103824e-02 5.108875e-02 6.314662e-02 7.748018e-02
[4,] 2.331619e-02 3.018521e-02 3.875329e-02 4.933017e-02 6.224702e-02
[5,] 1.464639e-02 1.982715e-02 2.656680e-02 3.522552e-02 4.620674e-02
[6,] 7.409314e-03 1.071938e-02 1.530556e-02 2.156116e-02 2.995676e-02
[7,] 2.448342e-03 3.953631e-03 6.270076e-03 9.761041e-03 1.490945e-02
[8,] 2.843388e-04 5.711131e-04 1.115366e-03 2.116337e-03 3.898420e-03
[9,] 5.480160e-07 2.109068e-06 7.654905e-06 2.615638e-05 8.399094e-05
HR= 0.9     HR= 0.89    HR= 0.88    HR= 0.87   HR= 0.86   HR= 0.85
[1,] 0.123190494 0.1438864313 0.167079903 0.192859688 0.22127131 0.25230840
[2,] 0.109442043 0.1297649321 0.152834365 0.178780259 0.20768271 0.23956011
[3,] 0.094357215 0.1140338316 0.136741000 0.162669293 0.19195234 0.22464996
[4,] 0.077846751 0.0964704410 0.118440132 0.144038062 0.17348320 0.20690630
[5,] 0.059948126 0.0769066019 0.097536842 0.122263115 0.15144518 0.18533991
[6,] 0.041037020 0.0554086814 0.073717196 0.096610471 0.12468930 0.15844609
[7,] 0.022334058 0.0327957818 0.047187188 0.066497956 0.09175034 0.12390212
[8,] 0.006966199 0.0120664748 0.020245469 0.032880680 0.05165904 0.07847027
[9,] 0.000253006 0.0007136809 0.001881907 0.004631131 0.01061918 0.02265691
HR= 0.84   HR= 0.83  HR= 0.82  HR= 0.81   HR= 0.8  HR= 0.79  HR= 0.78
[1,] 0.2859048 0.32192816 0.3601755 0.4003715 0.4421701 0.4851593 0.5288707
[2,] 0.2743581 0.31194037 0.3520820 0.3944669 0.4386891 0.4842596 0.5306187
[3,] 0.2607320 0.30006467 0.3423999 0.3873708 0.4344929 0.4831734 0.5327282
[4,] 0.2443253 0.28562334 0.3305315 0.3786197 0.4292975 0.4818261 0.5353438
[5,] 0.2240615 0.26754364 0.3155093 0.3674515 0.4226308 0.4800928 0.5387071
[6,] 0.1981960 0.24400712 0.2956391 0.3525005 0.4136350 0.4777454 0.5432588
[7,] 0.1637205 0.21163792 0.2676103 0.3310032 0.4005357 0.4743071 0.5499183
[8,] 0.1151921 0.16336650 0.2238034 0.2961899 0.3788177 0.4685436 0.5610573
[9,] 0.0449273 0.08272983 0.1414183 0.2244780 0.3312701 0.4555600 0.5860105
HR= 0.77  HR= 0.76  HR= 0.75  HR= 0.74  HR= 0.73  HR= 0.72  HR= 0.71
[1,] 0.5727918 0.6163822 0.6590932 0.7003879 0.7397632 0.7767698 0.8110315
[2,] 0.5771534 0.6232197 0.6681679 0.7113710 0.7522530 0.7903142 0.8251543
[3,] 0.5824066 0.6314229 0.6789929 0.7243722 0.7668944 0.8060045 0.8412862
[4,] 0.5889030 0.6415167 0.6922129 0.7400903 0.7843707 0.8244439 0.8598982
[5,] 0.5972257 0.6543591 0.7088605 0.7596118 0.8057000 0.8464748 0.8815815
[6,] 0.6084300 0.6714748 0.7307175 0.7847320 0.8324578 0.8732718 0.9070084
[7,] 0.6246845 0.6959105 0.7611860 0.8186471 0.8671549 0.9063588 0.9366389
[8,] 0.6514482 0.7349639 0.8077731 0.8675296 0.9135892 0.9468472 0.9692842
[9,] 0.7089977 0.8127239 0.8906456 0.9425504 0.9730629 0.9888139 0.9959168
HR= 0.7  HR= 0.69  HR= 0.68  HR= 0.67  HR= 0.66  HR= 0.65  HR= 0.64
[1,] 0.8422590 0.8702607 0.8949464 0.9163265 0.9345043 0.9496641 0.9620547
[2,] 0.8564886 0.8841568 0.9081246 0.9284764 0.9454016 0.9591745 0.9701308
[3,] 0.8724786 0.8994820 0.9223526 0.9412854 0.9565895 0.9686566 0.9779275
[4,] 0.8905356 0.9163685 0.9376003 0.9545913 0.9678155 0.9778134 0.9851465
[5,] 0.9109648 0.9348432 0.9536612 0.9680236 0.9786254 0.9861831 0.9913782
[6,] 0.9339251 0.9546233 0.9699396 0.9808285 0.9882531 0.9930996 0.9961226
[7,] 0.9589481 0.9745963 0.9850242 0.9916120 0.9955484 0.9977679 0.9989456
[8,] 0.9833874 0.9916228 0.9960766 0.9983001 0.9993215 0.9997515 0.9999169
[9,] 0.9986996 0.9996413 0.9999150 0.9999828 0.9999971 0.9999996 0.9999999
HR= 0.63  HR= 0.62  HR= 0.61   HR= 0.6
[1,] 0.9719710 0.9797344 0.9856740 0.9901102
[2,] 0.9786422 0.9850927 0.9898561 0.9932796
[3,] 0.9848597 0.9898982 0.9934536 0.9958857
[4,] 0.9903576 0.9939401 0.9963193 0.9978432
[5,] 0.9948162 0.9970027 0.9983367 0.9991161
[6,] 0.9979207 0.9989384 0.9994853 0.9997636
[7,] 0.9995322 0.9998057 0.9999247 0.9999729
[8,] 0.9999747 0.9999930 0.9999983 0.9999996
[9,] 1.0000000 1.0000000 1.0000000 1.0000000

\$CPN
HR= 1     HR= 0.99     HR= 0.98     HR= 0.97     HR= 0.96
[1,] 1.941502e-02 1.982708e-02 2.025083e-02 2.068670e-02 2.113513e-02
[2,] 1.421482e-02 1.489178e-02 1.560357e-02 1.635211e-02 1.713943e-02
[3,] 9.574822e-03 1.035635e-02 1.120172e-02 1.211604e-02 1.310485e-02
[4,] 5.698209e-03 6.424511e-03 7.240187e-03 8.155633e-03 9.182344e-03
[5,] 2.787298e-03 3.325996e-03 3.963455e-03 4.716471e-03 5.604388e-03
[6,] 9.709565e-04 1.259184e-03 1.627944e-03 2.097994e-03 2.694855e-03
[7,] 1.728598e-04 2.568461e-04 3.791642e-04 5.559878e-04 8.096397e-04
[8,] 5.863223e-06 1.138605e-05 2.179921e-05 4.112847e-05 7.643222e-05
[9,] 2.860159e-10 1.227661e-09 5.066670e-09 2.008050e-08 7.632550e-08
HR= 0.95     HR= 0.94     HR= 0.93     HR= 0.92     HR= 0.91
[1,] 2.159659e-02 2.207154e-02 2.256051e-02 2.306401e-02 2.358260e-02
[2,] 1.796768e-02 1.883913e-02 1.975617e-02 2.072137e-02 2.173741e-02
[3,] 1.417410e-02 1.533021e-02 1.658004e-02 1.793100e-02 1.939104e-02
[4,] 1.033301e-02 1.162161e-02 1.306354e-02 1.467568e-02 1.647656e-02
[5,] 6.649402e-03 7.876901e-03 9.315811e-03 1.099896e-02 1.296346e-02
[6,] 3.449724e-03 4.400482e-03 5.592823e-03 7.081469e-03 8.931451e-03
[7,] 1.170603e-03 1.680037e-03 2.392858e-03 3.381417e-03 4.739768e-03
[8,] 1.398412e-04 2.517715e-04 4.458338e-04 7.760910e-04 1.327393e-03
[9,] 2.778611e-07 9.675051e-07 3.217632e-06 1.020595e-05 3.082976e-05
HR= 0.9     HR= 0.89     HR= 0.88    HR= 0.87    HR= 0.86
[1,] 2.411686e-02 0.0246673829 0.0252348158 0.025819819 0.026423089
[2,] 2.280714e-02 0.0239335900 0.0251199577 0.026369630 0.027686196
[3,] 2.096869e-02 0.0226730918 0.0245140491 0.026502055 0.028648333
[4,] 1.848643e-02 0.0207273637 0.0232234192 0.026000698 0.029087461
[5,] 1.525105e-02 0.0179084792 0.0209878324 0.024546809 0.028648957
[6,] 1.121942e-02 0.0140349491 0.0174816962 0.021678429 0.026759705
[7,] 6.588433e-03 0.0090795045 0.0124017597 0.016785345 0.022505382
[8,] 2.229484e-03 0.0036753126 0.0059434063 0.009423081 0.014639727
[9,] 8.856083e-05 0.0002415562 0.0006246663 0.001529270 0.003539094
HR= 0.85   HR= 0.84   HR= 0.83   HR= 0.82   HR= 0.81    HR= 0.8
[1,] 0.027045357 0.02768739 0.02834999 0.02903401 0.02974033 0.03046990
[2,] 0.029073454 0.03053543 0.03207639 0.03370084 0.03541357 0.03721965
[3,] 0.030964878 0.03346449 0.03616083 0.03906844 0.04220277 0.04558025
[4,] 0.032514213 0.03631377 0.04052133 0.04517446 0.05031316 0.05597978
[5,] 0.033363814 0.03876694 0.04493978 0.05196944 0.05994813 0.06897243
[6,] 0.032876122 0.04019397 0.04889408 0.05916982 0.07122380 0.08526347
[7,] 0.029883681 0.03928761 0.05112500 0.06583411 0.08386759 0.10567006
[8,] 0.022275365 0.03317746 0.04834718 0.06889767 0.09597451 0.13063541
[9,] 0.007731455 0.01592278 0.03087809 0.05632801 0.09658883 0.15563452
HR= 0.79   HR= 0.78   HR= 0.77   HR= 0.76   HR= 0.75   HR= 0.74
[1,] 0.03122368 0.03200272 0.03280811 0.03364099 0.03450257 0.03539413
[2,] 0.03912443 0.04113360 0.04325318 0.04548954 0.04784942 0.05033997
[3,] 0.04921830 0.05313536 0.05735091 0.06188552 0.06676083 0.07199955
[4,] 0.06221893 0.06907739 0.07660391 0.08484893 0.09386427 0.10370270
[5,] 0.07914234 0.09055987 0.10332739 0.11754563 0.13331120 0.15071385
[6,] 0.10149521 0.12011707 0.14130998 0.16522783 0.19198646 0.22165221
[7,] 0.13164911 0.16214066 0.19737046 0.23741446 0.28216212 0.33128724
[8,] 0.17369403 0.22554404 0.28599064 0.35412553 0.42828305 0.50610704
[9,] 0.23568299 0.33569901 0.45050639 0.57118256 0.68693352 0.78788371
HR= 0.73   HR= 0.72   HR= 0.71    HR= 0.7   HR= 0.69   HR= 0.68
[1,] 0.03631701 0.03727263 0.03826250 0.03928820 0.04035141 0.04145389
[2,] 0.05296874 0.05574374 0.05867344 0.06176677 0.06503323 0.06848282
[3,] 0.07762549 0.08366353 0.09013957 0.09708050 0.10451416 0.11246919
[4,] 0.11441743 0.12606153 0.13868715 0.15234470 0.16708195 0.18294287
[5,] 0.16983327 0.19073567 0.21346997 0.23806402 0.26452054 0.29281339
[6,] 0.25423042 0.28965475 0.32777817 0.36836646 0.41109535 0.45555188
[7,] 0.38423120 0.44020336 0.49820180 0.55705590 0.61548932 0.67219903
[8,] 0.58473892 0.66111069 0.73229817 0.79586965 0.85015986 0.89441384
[9,] 0.86763189 0.92446957 0.96086431 0.98171024 0.99234139 0.99714544
HR= 0.67   HR= 0.66   HR= 0.65   HR= 0.64   HR= 0.63   HR= 0.62
[1,] 0.04259754 0.04378435 0.04501642 0.04629599 0.04762545 0.04900732
[2,] 0.07212612 0.07597431 0.08003920 0.08433324 0.08886958 0.09366208
[3,] 0.12097498 0.13006152 0.13975921 0.15009870 0.16111059 0.17282523
[4,] 0.19996649 0.21818557 0.23762522 0.25830139 0.28021933 0.30337200
[5,] 0.32288397 0.35463819 0.38794415 0.42263077 0.45848759 0.49526600
[6,] 0.50124100 0.54759747 0.59400320 0.63980959 0.68436359 0.72703637
[7,] 0.72594301 0.77562742 0.82038270 0.85961929 0.89305582 0.92071652
[8,] 0.92877613 0.95413857 0.97189310 0.98365327 0.99100556 0.99533266
[9,] 0.99905919 0.99972765 0.99993123 0.99998496 0.99999717 0.99999955
HR= 0.61    HR= 0.6
[1,] 0.05044430 0.05193923
[2,] 0.09872532 0.10407466
[3,] 0.18527234 0.19848063
[4,] 0.32773855 0.35328276
[5,] 0.53268201 0.57042075
[6,] 0.76725224 0.80451597
[7,] 0.94289913 0.96011902
[8,] 0.99772336 0.99895968
[9,] 0.99999994 0.99999999

\$CPD
HR= 1     HR= 0.99     HR= 0.98     HR= 0.97     HR= 0.96
[1,] 3.678621e-01 3.711266e-01 3.744337e-01 3.777841e-01 3.811786e-01
[2,] 2.871615e-01 2.934455e-01 2.998572e-01 3.063983e-01 3.130704e-01
[3,] 2.066088e-01 2.151086e-01 2.238973e-01 2.329797e-01 2.423605e-01
[4,] 1.315660e-01 1.408199e-01 1.506062e-01 1.609425e-01 1.718453e-01
[5,] 6.897243e-02 7.701183e-02 8.583658e-02 9.549917e-02 1.060518e-01
[6,] 2.578735e-02 3.082412e-02 3.671271e-02 4.356541e-02 5.150205e-02
[7,] 4.933439e-03 6.650907e-03 8.902584e-03 1.182960e-02 1.560115e-02
[8,] 1.799903e-04 3.119416e-04 5.325742e-04 8.953246e-04 1.481434e-03
[9,] 9.449109e-09 3.557402e-08 1.286365e-07 4.462108e-07 1.482867e-06
HR= 0.95     HR= 0.94     HR= 0.93     HR= 0.92     HR= 0.91
[1,] 3.846179e-01 3.881029e-01 3.916343e-01 0.3952130029 0.3988398268
[2,] 3.198752e-01 3.268140e-01 3.338885e-01 0.3410999684 0.3484497132
[3,] 2.520435e-01 2.620325e-01 2.723307e-01 0.2829405878 0.2938641410
[4,] 1.833300e-01 1.954105e-01 2.080993e-01 0.2214066614 0.2353409037
[5,] 1.175456e-01 1.300299e-01 1.435510e-01 0.1581515581 0.1738692761
[6,] 6.064872e-02 7.113608e-02 8.309710e-02 0.0966642054 0.1119659051
[7,] 2.041682e-02 2.650796e-02 3.413761e-02 0.0435983455 0.0552076161
[8,] 2.411520e-03 3.860195e-03 6.073500e-03 0.0093881857 0.0142508079
[9,] 4.714983e-06 1.432488e-05 4.152815e-05 0.0001147188 0.0003015527
HR= 0.9    HR= 0.89    HR= 0.88    HR= 0.87   HR= 0.86   HR= 0.85
[1,] 0.4025156273 0.406241282 0.410017688 0.413845761 0.41772644 0.42166067
[2,] 0.3559389608 0.363568830 0.371340333 0.379254366 0.38731170 0.39551295
[3,] 0.3051026709 0.316656746 0.328526143 0.340709779 0.35320565 0.36601077
[4,] 0.2499077906 0.265110340 0.280948519 0.297418943 0.31451459 0.33222450
[5,] 0.1907356655 0.208774888 0.228002450 0.248423908 0.27003359 0.29281339
[6,] 0.1291227402 0.148242751 0.169416463 0.192711542 0.21816729 0.24578918
[7,] 0.0692999952 0.086215901 0.106286626 0.129815744 0.15705737 0.18819225
[8,] 0.0212332793 0.031040112 0.044501381 0.062544972 0.08614250 0.11622593
[9,] 0.0007532227 0.001785322 0.004010114 0.008524759 0.01713039 0.03250441
HR= 0.84   HR= 0.83  HR= 0.82  HR= 0.81   HR= 0.8  HR= 0.79  HR= 0.78
[1,] 0.42564943 0.42969373 0.4337946 0.4379530 0.4421701 0.4464469 0.4507845
[2,] 0.40385862 0.41234902 0.4209843 0.4297644 0.4386891 0.4477579 0.4569701
[3,] 0.37912110 0.39253145 0.4062355 0.4202256 0.4344929 0.4490270 0.4638162
[4,] 0.35053352 0.36942207 0.3888658 0.4088357 0.4292975 0.4502118 0.4715342
[5,] 0.31673162 0.34174204 0.3677831 0.3947772 0.4226308 0.4512340 0.4804615
[6,] 0.27554376 0.30735415 0.3410965 0.3765977 0.4136350 0.4519368 0.4911867
[7,] 0.22330309 0.26235111 0.3051562 0.3513830 0.4005357 0.4519638 0.5048791
[8,] 0.15357666 0.19869550 0.2516692 0.3120563 0.3788177 0.4503162 0.5244011
[9,] 0.05818551 0.09819796 0.1561966 0.2342009 0.3312701 0.4427091 0.5603766
HR= 0.77  HR= 0.76  HR= 0.75  HR= 0.74  HR= 0.73  HR= 0.72  HR= 0.71
[1,] 0.4551842 0.4596469 0.4641740 0.4687665 0.4734258 0.4781530 0.4829495
[2,] 0.4663248 0.4758208 0.4854566 0.4952303 0.5051400 0.5151830 0.5253567
[3,] 0.4788474 0.4941056 0.5095747 0.5252366 0.5410718 0.5570591 0.5731755
[4,] 0.4932150 0.5151994 0.5374276 0.5598353 0.5823536 0.6049096 0.6274273
[5,] 0.5101729 0.5402145 0.5704208 0.6006166 0.6306199 0.6602448 0.6893049
[6,] 0.5310287 0.5710751 0.6109166 0.6501343 0.6883123 0.7250516 0.7599842
[7,] 0.5583855 0.6115205 0.6633042 0.7127944 0.7591408 0.8016347 0.8397476
[8,] 0.5985784 0.6702483 0.7369785 0.7967628 0.8482219 0.8907079 0.9242971
[9,] 0.6742834 0.7750374 0.8561841 0.9154736 0.9546218 0.9778873 0.9902794
HR= 0.7  HR= 0.69  HR= 0.68  HR= 0.67  HR= 0.66  HR= 0.65  HR= 0.64
[1,] 0.4878166 0.4927555 0.4977677 0.5028545 0.5080173 0.5132576 0.5185768
[2,] 0.5356578 0.5460827 0.5566274 0.5672875 0.5780579 0.5889334 0.5999079
[3,] 0.5893965 0.6056961 0.6220464 0.6384182 0.6547808 0.6711023 0.6873492
[4,] 0.6498275 0.6720291 0.6939496 0.7155061 0.7366162 0.7571992 0.7771767
[5,] 0.7176167 0.7450038 0.7713002 0.7963546 0.8200332 0.8422236 0.8628365
[6,] 0.7927858 0.8231873 0.8509838 0.8760406 0.8982960 0.9177604 0.9345112
[7,] 0.8731560 0.9017493 0.9256195 0.9450360 0.9604077 0.9722380 0.9810779
[8,] 0.9496805 0.9679817 0.9805458 0.9887418 0.9938111 0.9967769 0.9984144
[9,] 0.9961686 0.9986543 0.9995814 0.9998854 0.9999726 0.9999943 0.9999990
HR= 0.63  HR= 0.62  HR= 0.61   HR= 0.6
[1,] 0.5239763 0.5294577 0.5350226 0.5406724
[2,] 0.6109750 0.6221277 0.6333583 0.6446587
[3,] 0.7034873 0.7194812 0.7352951 0.7508922
[4,] 0.7964743 0.8150223 0.8327570 0.8496214
[5,] 0.8818084 0.8991023 0.9147086 0.9286439
[6,] 0.9486860 0.9604714 0.9700912 0.9777935
[7,] 0.9874828 0.9919763 0.9950243 0.9970202
[8,] 0.9992653 0.9996803 0.9998698 0.9999506
[9,] 0.9999998 1.0000000 1.0000000 1.0000000

PWEALL documentation built on May 2, 2019, 4:16 a.m.