18  Genetic Power Calculator

Author

Chrissy h Roberts

18.1 Background

These power calculations are useful for genetic case control studies They use the gap package and pbsize2 command

citation Jing Hua Zhao (2013). gap: Genetic Analysis Package. R package version 1.1-10

18.2 Libraries

library(gap)
Loading required package: gap.datasets
gap version 1.6
library(knitr)

18.3 Usage

18.3.1 Define study characteristics

prevalence=0.1
alpha=0.05
num.cases=2000
num.controls=2000
num.total=num.cases+num.controls
prop.cases=num.cases/num.total

18.3.2 Define ranges of minor allele frequency and effect sizes

maf_values<-seq(0.01,0.49,by=0.01)
risk_values<-seq(1,1.6,by=0.01)

18.3.3 Calculate power at all possible combinations

x<-matrix(nrow=length(risk_values),ncol=length(maf_values))

for (i in 1:length(risk_values)){risk = risk_values[i];for (j in 1:length(maf_values)){maf = maf_values[j];try(x[i,j]<-pbsize2(N=num.total,fc=prop.cases,alpha=alpha,gamma=risk,p=maf,kp=prevalence,model="additive"))}}

18.3.4 Define a matrix which contains the results

xx<-as.data.frame(x,row.names=as.character(risk_values));names(xx)<-as.character(maf_values)

kable(xx)
0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49
1 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000 0.0500000
1.01 0.0501394 0.0502758 0.0504094 0.0505402 0.0506680 0.0507930 0.0509151 0.0510343 0.0511507 0.0512642 0.0513748 0.0514826 0.0515875 0.0516896 0.0517887 0.0518851 0.0519786 0.0520692 0.0521569 0.0522418 0.0523239 0.0524031 0.0524795 0.0525530 0.0526237 0.0526916 0.0527566 0.0528187 0.0528781 0.0529346 0.0529882 0.0530391 0.0530871 0.0531323 0.0531747 0.0532142 0.0532509 0.0532849 0.0533160 0.0533443 0.0533698 0.0533924 0.0534123 0.0534294 0.0534437 0.0534551 0.0534638 0.0534697 0.0534728
1.02 0.0505549 0.0510983 0.0516302 0.0521506 0.0526594 0.0531566 0.0536424 0.0541166 0.0545792 0.0550304 0.0554700 0.0558980 0.0563146 0.0567196 0.0571131 0.0574951 0.0578655 0.0582245 0.0585720 0.0589080 0.0592325 0.0595455 0.0598471 0.0601372 0.0604159 0.0606832 0.0609390 0.0611834 0.0614165 0.0616381 0.0618483 0.0620472 0.0622348 0.0624110 0.0625759 0.0627295 0.0628718 0.0630028 0.0631226 0.0632312 0.0633285 0.0634146 0.0634895 0.0635532 0.0636058 0.0636473 0.0636776 0.0636968 0.0637050
1.03 0.0512433 0.0524609 0.0536530 0.0548193 0.0559599 0.0570746 0.0581635 0.0592265 0.0602636 0.0612747 0.0622599 0.0632190 0.0641521 0.0650591 0.0659401 0.0667951 0.0676240 0.0684268 0.0692036 0.0699543 0.0706789 0.0713776 0.0720502 0.0726969 0.0733176 0.0739123 0.0744811 0.0750240 0.0755410 0.0760322 0.0764976 0.0769372 0.0773511 0.0777394 0.0781020 0.0784390 0.0787504 0.0790364 0.0792969 0.0795320 0.0797417 0.0799262 0.0800854 0.0802195 0.0803285 0.0804124 0.0804713 0.0805052 0.0805144
1.04 0.0522012 0.0543582 0.0564707 0.0585383 0.0605609 0.0625382 0.0644700 0.0663560 0.0681962 0.0699903 0.0717382 0.0734398 0.0750949 0.0767036 0.0782656 0.0797810 0.0812497 0.0826717 0.0840469 0.0853752 0.0866568 0.0878917 0.0890797 0.0902210 0.0913156 0.0923635 0.0933648 0.0943196 0.0952279 0.0960897 0.0969052 0.0976744 0.0983974 0.0990744 0.0997053 0.1002904 0.1008298 0.1013234 0.1017716 0.1021743 0.1025317 0.1028440 0.1031113 0.1033337 0.1035114 0.1036444 0.1037331 0.1037774 0.1037776
1.05 0.0534259 0.0567856 0.0600782 0.0633027 0.0664583 0.0695444 0.0725602 0.0755051 0.0783785 0.0811802 0.0839095 0.0865661 0.0891497 0.0916600 0.0940969 0.0964600 0.0987492 0.1009645 0.1031057 0.1051728 0.1071657 0.1090844 0.1109290 0.1126995 0.1143960 0.1160185 0.1175672 0.1190422 0.1204436 0.1217716 0.1230263 0.1242080 0.1253168 0.1263529 0.1273165 0.1282079 0.1290273 0.1297749 0.1304510 0.1310558 0.1315896 0.1320527 0.1324453 0.1327677 0.1330203 0.1332032 0.1333168 0.1333614 0.1333372
1.06 0.0549148 0.0597397 0.0644721 0.0691099 0.0736510 0.0780937 0.0824362 0.0866773 0.0908155 0.0948499 0.0987794 0.1026031 0.1063204 0.1099307 0.1134334 0.1168282 0.1201146 0.1232926 0.1263620 0.1293225 0.1321743 0.1349173 0.1375517 0.1400775 0.1424949 0.1448042 0.1470055 0.1490993 0.1510857 0.1529652 0.1547380 0.1564046 0.1579654 0.1594208 0.1607712 0.1620171 0.1631589 0.1641971 0.1651322 0.1659646 0.1666949 0.1673235 0.1678510 0.1682778 0.1686045 0.1688316 0.1689595 0.1689889 0.1689201
1.07 0.0566656 0.0632174 0.0696502 0.0759589 0.0821393 0.0881877 0.0941006 0.0998752 0.1055088 0.1109993 0.1163447 0.1215436 0.1265945 0.1314963 0.1362483 0.1408497 0.1453001 0.1495991 0.1537466 0.1577426 0.1615871 0.1652803 0.1688226 0.1722142 0.1754558 0.1785477 0.1814906 0.1842851 0.1869319 0.1894316 0.1917852 0.1939932 0.1960566 0.1979761 0.1997525 0.2013868 0.2028797 0.2042321 0.2054449 0.2065189 0.2074550 0.2082540 0.2089168 0.2094442 0.2098370 0.2100962 0.2102224 0.2102166 0.2100794
1.08 0.0586762 0.0672167 0.0756109 0.0838493 0.0919236 0.0998267 0.1075524 0.1150951 0.1224505 0.1296145 0.1365840 0.1433562 0.1499292 0.1563012 0.1624709 0.1684376 0.1742007 0.1797600 0.1851154 0.1902674 0.1952163 0.1999629 0.2045079 0.2088523 0.2129971 0.2169435 0.2206928 0.2242462 0.2276052 0.2307711 0.2337453 0.2365294 0.2391248 0.2415330 0.2437555 0.2457938 0.2476493 0.2493235 0.2508178 0.2521337 0.2532725 0.2542357 0.2550244 0.2556402 0.2560842 0.2563577 0.2564618 0.2563979 0.2561670
1.09 0.0609447 0.0717356 0.0823531 0.0927803 0.1030025 0.1130072 0.1227836 0.1323228 0.1416172 0.1506607 0.1594481 0.1679757 0.1762403 0.1842398 0.1919728 0.1994385 0.2066365 0.2135673 0.2202314 0.2266299 0.2327642 0.2386358 0.2442467 0.2495988 0.2546944 0.2595358 0.2641253 0.2684655 0.2725589 0.2764080 0.2800153 0.2833835 0.2865152 0.2894127 0.2920786 0.2945154 0.2967254 0.2987109 0.3004743 0.3020178 0.3033434 0.3044532 0.3053493 0.3060334 0.3065075 0.3067734 0.3068326 0.3066869 0.3063377
1.1 0.0634695 0.0767725 0.0898755 0.1027499 0.1153713 0.1277191 0.1397763 0.1515287 0.1629649 0.1740757 0.1848540 0.1952944 0.2053934 0.2151485 0.2245584 0.2336231 0.2423432 0.2507201 0.2587559 0.2664532 0.2738149 0.2808446 0.2875457 0.2939223 0.2999783 0.3057180 0.3111456 0.3162653 0.3210815 0.3255985 0.3298204 0.3337516 0.3373960 0.3407576 0.3438405 0.3466482 0.3491845 0.3514529 0.3534568 0.3551993 0.3566836 0.3579125 0.3588890 0.3596155 0.3600946 0.3603287 0.3603198 0.3600702 0.3595817
1.11 0.0662489 0.0823259 0.0981762 0.1137539 0.1290205 0.1439443 0.1584994 0.1726649 0.1864244 0.1997654 0.2126787 0.2251578 0.2371987 0.2487996 0.2599605 0.2706827 0.2809689 0.2908228 0.3002490 0.3092526 0.3178395 0.3260159 0.3337882 0.3411633 0.3481479 0.3547491 0.3609738 0.3668288 0.3723210 0.3774572 0.3822438 0.3866873 0.3907937 0.3945692 0.3980193 0.4011496 0.4039654 0.4064715 0.4086729 0.4105738 0.4121786 0.4134912 0.4145154 0.4152544 0.4157116 0.4158900 0.4157921 0.4154206 0.4147777
1.12 0.0692815 0.0883940 0.1072521 0.1257848 0.1439344 0.1616540 0.1789061 0.1956617 0.2118987 0.2276008 0.2427572 0.2573610 0.2714092 0.2849018 0.2978410 0.3102315 0.3220793 0.3333921 0.3441784 0.3544476 0.3642096 0.3734749 0.3822541 0.3905581 0.3983976 0.4057835 0.4127264 0.4192366 0.4253244 0.4309996 0.4362718 0.4411501 0.4456434 0.4497600 0.4535079 0.4568947 0.4599275 0.4626132 0.4649579 0.4669677 0.4686480 0.4700038 0.4710400 0.4717607 0.4721700 0.4722713 0.4720679 0.4715625 0.4707578
1.13 0.0725659 0.0949751 0.1170986 0.1388317 0.1600902 0.1808077 0.2009328 0.2204265 0.2392608 0.2574164 0.2748815 0.2916506 0.3077232 0.3231030 0.3377969 0.3518148 0.3651682 0.3778706 0.3899366 0.4013815 0.4122212 0.4224721 0.4321504 0.4412723 0.4498540 0.4579112 0.4654592 0.4725128 0.4790865 0.4851940 0.4908484 0.4960624 0.5008476 0.5052156 0.5091767 0.5127411 0.5159179 0.5187159 0.5211431 0.5232071 0.5249145 0.5262717 0.5272844 0.5279576 0.5282961 0.5283039 0.5279845 0.5273410 0.5263761
1.14 0.0761009 0.1020668 0.1277094 0.1528786 0.1774564 0.2013520 0.2244972 0.2468425 0.2683541 0.2890110 0.3088028 0.3277274 0.3457894 0.3629992 0.3793711 0.3949226 0.4096738 0.4236464 0.4368632 0.4493479 0.4611242 0.4722160 0.4826469 0.4924401 0.5016182 0.5102030 0.5182156 0.5256761 0.5326038 0.5390170 0.5449330 0.5503682 0.5553378 0.5598564 0.5639374 0.5675933 0.5708357 0.5736753 0.5761219 0.5781846 0.5798715 0.5811900 0.5821467 0.5827475 0.5829976 0.5829014 0.5824628 0.5816849 0.5805704
1.15 0.0798850 0.1096662 0.1390758 0.1679049 0.1959929 0.2232197 0.2494984 0.2747688 0.2989930 0.3221507 0.3442357 0.3652529 0.3852160 0.4041452 0.4220659 0.4390068 0.4549994 0.4700767 0.4842723 0.4976204 0.5101549 0.5219092 0.5329156 0.5432058 0.5528100 0.5617572 0.5700749 0.5777895 0.5849256 0.5915066 0.5975542 0.6030890 0.6081299 0.6126948 0.6167999 0.6204604 0.6236902 0.6265019 0.6289072 0.6309164 0.6325391 0.6337835 0.6346571 0.6351663 0.6353169 0.6351134 0.6345598 0.6336592 0.6324138
1.16 0.0839170 0.1177696 0.1511866 0.1838840 0.2156497 0.2463297 0.2758169 0.3040421 0.3309658 0.3565724 0.3808643 0.4038582 0.4255813 0.4460685 0.4653603 0.4835005 0.5005357 0.5165130 0.5314800 0.5454837 0.5585701 0.5707838 0.5821678 0.5927630 0.6026084 0.6117410 0.6201956 0.6280048 0.6351992 0.6418074 0.6478559 0.6533693 0.6583704 0.6628801 0.6669176 0.6705005 0.6736448 0.6763652 0.6786745 0.6805847 0.6821061 0.6832479 0.6840182 0.6844238 0.6844706 0.6841634 0.6835058 0.6825008 0.6811502
1.17 0.0881956 0.1263727 0.1640275 0.2007837 0.2363675 0.2705871 0.3033160 0.3344783 0.3640380 0.3919894 0.4183498 0.4431534 0.4664467 0.4882846 0.5087274 0.5278387 0.5456834 0.5623265 0.5778320 0.5922622 0.6056771 0.6181340 0.6296874 0.6403889 0.6502868 0.6594265 0.6678502 0.6755974 0.6827046 0.6892054 0.6951310 0.7005100 0.7053685 0.7097306 0.7136180 0.7170506 0.7200462 0.7226208 0.7247889 0.7265632 0.7279550 0.7289738 0.7296283 0.7299253 0.7298709 0.7294695 0.7287246 0.7276388 0.7262133
1.18 0.0927193 0.1354700 0.1775816 0.2185655 0.2580770 0.2958842 0.3318428 0.3658757 0.3979570 0.4280984 0.4563395 0.4827392 0.5073700 0.5303127 0.5516528 0.5714780 0.5898757 0.6069315 0.6227285 0.6373463 0.6508603 0.6633418 0.6748578 0.6854707 0.6952386 0.7042154 0.7124508 0.7199908 0.7268774 0.7331492 0.7388416 0.7439867 0.7486139 0.7527496 0.7564178 0.7596402 0.7624360 0.7648225 0.7668149 0.7684268 0.7696697 0.7705537 0.7710873 0.7712775 0.7711300 0.7706491 0.7698378 0.7686979 0.7672302
1.19 0.0974867 0.1450549 0.1918283 0.2371848 0.2806999 0.3221009 0.3612308 0.3980188 0.4324578 0.4645866 0.4944759 0.5222179 0.5479185 0.5716908 0.5936510 0.6139152 0.6325967 0.6498049 0.6656439 0.6802120 0.6936012 0.7058975 0.7171804 0.7275233 0.7369940 0.7456546 0.7535617 0.7607673 0.7673185 0.7732584 0.7786256 0.7834556 0.7877799 0.7916271 0.7950228 0.7979900 0.8005488 0.8027173 0.8045113 0.8059444 0.8070286 0.8077738 0.8081884 0.8082792 0.8080515 0.8075089 0.8066542 0.8054883 0.8040112
1.2 0.1024962 0.1551198 0.2067440 0.2565910 0.3041490 0.3491070 0.3913026 0.4306820 0.4672685 0.5011391 0.5324063 0.5612050 0.5876821 0.6119899 0.6342803 0.6547020 0.6733974 0.6905018 0.7061417 0.7204351 0.7334911 0.7454102 0.7562842 0.7661973 0.7752260 0.7834399 0.7909020 0.7976692 0.8037931 0.8093199 0.8142914 0.8187450 0.8227142 0.8262289 0.8293155 0.8319978 0.8342965 0.8362299 0.8378138 0.8390618 0.8399857 0.8405952 0.8408984 0.8409014 0.8406090 0.8400245 0.8391498 0.8379851 0.8365296
1.21 0.1077461 0.1656557 0.2223016 0.2767274 0.3283292 0.3767630 0.4218725 0.4636342 0.5021162 0.5374468 0.5697920 0.5993391 0.6262843 0.6508252 0.6731546 0.6934570 0.7119065 0.7286653 0.7438835 0.7576987 0.7702367 0.7816119 0.7919279 0.8012783 0.8097476 0.8174115 0.8243382 0.8305889 0.8362181 0.8412746 0.8458020 0.8498391 0.8534204 0.8565762 0.8593335 0.8617161 0.8637447 0.8654373 0.8668095 0.8678745 0.8686437 0.8691261 0.8693293 0.8692590 0.8689192 0.8683125 0.8674400 0.8663015 0.8648952
1.22 0.1132344 0.1766524 0.2384707 0.2975320 0.3531385 0.4049228 0.4527499 0.4966438 0.5367335 0.5732136 0.6063161 0.6362908 0.6633912 0.6878658 0.7099522 0.7298735 0.7478367 0.7640318 0.7786318 0.7917937 0.8036587 0.8143541 0.8239936 0.8326791 0.8405012 0.8475407 0.8538697 0.8595519 0.8646440 0.8691962 0.8732529 0.8768532 0.8800318 0.8828191 0.8852416 0.8873228 0.8890827 0.8905388 0.8917061 0.8925971 0.8932224 0.8935904 0.8937079 0.8935799 0.8932098 0.8925994 0.8917492 0.8906583 0.8893241
1.23 0.1189591 0.1880984 0.2552176 0.3189377 0.3784692 0.4334357 0.4837429 0.5294827 0.5708637 0.6081628 0.6416910 0.6717702 0.6987185 0.7228402 0.7444206 0.7637228 0.7809870 0.7964304 0.8102481 0.8226146 0.8336853 0.8435981 0.8524754 0.8604251 0.8675426 0.8739122 0.8796080 0.8846951 0.8892312 0.8932664 0.8968452 0.9000063 0.9027836 0.9052069 0.9073017 0.9090906 0.9105927 0.9118245 0.9128000 0.9135309 0.9140268 0.9142954 0.9143426 0.9141726 0.9137882 0.9131906 0.9123795 0.9113532 0.9101089
1.24 0.1249179 0.1999805 0.2725053 0.3408728 0.4042090 0.4621484 0.5146613 0.5619309 0.6042662 0.6420430 0.6756638 0.7055322 0.7320364 0.7555404 0.7763786 0.7948543 0.8112401 0.8257788 0.8386856 0.8501504 0.8603402 0.8694016 0.8774631 0.8846369 0.8910213 0.8967020 0.9017537 0.9062419 0.9102234 0.9137479 0.9168585 0.9195927 0.9219833 0.9240584 0.9258426 0.9273567 0.9286187 0.9296440 0.9304453 0.9310332 0.9314163 0.9316015 0.9315938 0.9313967 0.9310121 0.9304407 0.9296816 0.9287327 0.9275907
1.25 0.1311085 0.2122844 0.2902939 0.3632618 0.4302427 0.4909075 0.5453199 0.5937806 0.6367209 0.6746322 0.7080207 0.7373793 0.7631712 0.7858216 0.8057144 0.8231919 0.8385568 0.8520750 0.8639791 0.8744715 0.8837282 0.8919017 0.8991242 0.9055101 0.9111585 0.9161548 0.9205732 0.9244776 0.9279233 0.9309581 0.9336235 0.9359549 0.9379831 0.9397347 0.9412321 0.9424949 0.9435393 0.9443794 0.9450265 0.9454901 0.9457779 0.9458955 0.9458473 0.9456360 0.9452629 0.9447281 0.9440303 0.9431669 0.9421342
1.26 0.1375280 0.2249943 0.3085409 0.3860260 0.4564533 0.5195620 0.5755418 0.6248398 0.6680318 0.7057415 0.7385893 0.7671636 0.7920051 0.8136006 0.8323818 0.8487274 0.8629672 0.8753868 0.8862325 0.8957159 0.9040190 0.9112974 0.9176846 0.9232949 0.9282262 0.9325623 0.9363750 0.9397259 0.9426676 0.9452455 0.9474982 0.9494590 0.9511563 0.9526143 0.9538536 0.9548919 0.9557438 0.9564216 0.9569356 0.9572940 0.9575031 0.9575681 0.9574922 0.9572776 0.9569250 0.9564341 0.9558031 0.9550292 0.9541084
1.27 0.1441736 0.2380932 0.3272010 0.4090844 0.4827238 0.5479651 0.6051609 0.6549347 0.6980299 0.7352170 0.7672397 0.7947857 0.8184740 0.8388513 0.8563938 0.8715128 0.8845611 0.8958396 0.9056046 0.9140734 0.9214304 0.9278317 0.9334098 0.9382766 0.9425272 0.9462421 0.9494899 0.9523285 0.9548074 0.9569685 0.9588477 0.9604751 0.9618768 0.9630743 0.9640864 0.9649285 0.9656136 0.9661525 0.9665541 0.9668252 0.9669716 0.9669970 0.9669044 0.9666951 0.9663694 0.9659266 0.9653646 0.9646806 0.9638705
1.28 0.1510420 0.2515624 0.3462269 0.4323544 0.5089386 0.5759765 0.6340241 0.6839128 0.7265748 0.7629407 0.7938838 0.8201929 0.8425636 0.8615987 0.8778146 0.8916500 0.9034757 0.9136035 0.9222953 0.9297703 0.9362123 0.9417753 0.9465879 0.9507584 0.9543773 0.9575209 0.9602531 0.9626278 0.9646906 0.9664797 0.9680276 0.9693614 0.9705042 0.9714754 0.9722912 0.9729652 0.9735088 0.9739311 0.9742396 0.9744403 0.9745378 0.9745351 0.9744344 0.9742367 0.9739419 0.9735489 0.9730556 0.9724590 0.9717550
1.29 0.1581299 0.2653824 0.3655692 0.4557525 0.5349846 0.6034643 0.6619938 0.7116440 0.7535556 0.7888301 0.8184737 0.8433755 0.8643038 0.8819121 0.8967510 0.9092810 0.9198850 0.9288810 0.9365320 0.9430558 0.9486324 0.9534110 0.9575150 0.9610468 0.9640915 0.9667199 0.9689909 0.9709538 0.9726497 0.9741130 0.9753726 0.9764525 0.9773730 0.9781509 0.9788004 0.9793331 0.9797587 0.9800849 0.9803181 0.9804631 0.9805236 0.9805021 0.9804002 0.9802184 0.9799563 0.9796126 0.9791853 0.9786713 0.9780667
1.3 0.1654335 0.2795320 0.3851773 0.4791957 0.5607531 0.6303063 0.6889491 0.7380216 0.7788910 0.8128367 0.8409987 0.8643624 0.8837627 0.8998971 0.9133434 0.9245771 0.9339879 0.9418945 0.9485573 0.9541890 0.9589633 0.9630224 0.9664827 0.9694397 0.9719721 0.9741445 0.9760105 0.9776142 0.9789923 0.9801753 0.9811883 0.9820525 0.9827852 0.9834011 0.9839120 0.9843279 0.9846568 0.9849053 0.9850785 0.9851805 0.9852140 0.9851811 0.9850828 0.9849194 0.9846902 0.9843939 0.9840283 0.9835906 0.9830771
1.31 0.1729487 0.2939891 0.4049990 0.5026015 0.5861403 0.6563918 0.7147866 0.7629630 0.8025286 0.8349444 0.8614816 0.8832155 0.9010398 0.9156877 0.9277565 0.9377297 0.9459981 0.9528765 0.9586186 0.9634289 0.9674727 0.9708834 0.9737692 0.9762178 0.9783008 0.9800766 0.9815927 0.9828884 0.9839958 0.9849414 0.9857471 0.9864309 0.9870076 0.9874896 0.9878869 0.9882077 0.9884588 0.9886455 0.9887719 0.9888413 0.9888559 0.9888172 0.9887258 0.9885818 0.9883843 0.9881321 0.9878230 0.9874544 0.9870227
1.32 0.1806715 0.3087306 0.4249817 0.5258894 0.6110491 0.6816222 0.7394214 0.7864091 0.8244428 0.8551658 0.8799741 0.9000244 0.9162592 0.9294386 0.9401709 0.9489413 0.9561355 0.9620601 0.9669588 0.9710257 0.9744153 0.9772512 0.9796325 0.9816387 0.9833339 0.9847698 0.9859885 0.9870241 0.9879044 0.9886522 0.9892861 0.9898213 0.9902703 0.9906434 0.9909489 0.9911936 0.9913830 0.9915213 0.9916119 0.9916573 0.9916592 0.9916187 0.9915361 0.9914114 0.9912436 0.9910315 0.9907731 0.9904658 0.9901065
1.33 0.1885971 0.3237322 0.4450723 0.5489813 0.6353896 0.7059119 0.7627873 0.8083232 0.8446337 0.8735395 0.8965527 0.9149002 0.9295629 0.9413177 0.9507759 0.9584174 0.9646179 0.9696719 0.9738103 0.9772145 0.9800273 0.9823616 0.9843066 0.9859334 0.9872987 0.9884479 0.9894174 0.9902365 0.9909291 0.9915143 0.9920078 0.9924224 0.9927684 0.9930542 0.9932866 0.9934711 0.9936122 0.9937132 0.9937768 0.9938050 0.9937989 0.9937594 0.9936867 0.9935803 0.9934396 0.9932632 0.9930493 0.9927957 0.9924994
1.34 0.1967209 0.3389691 0.4652177 0.5718023 0.6590799 0.7291891 0.7848360 0.8286905 0.8631235 0.8901257 0.9113131 0.9279703 0.9411046 0.9514998 0.9597623 0.9663604 0.9716556 0.9759267 0.9793896 0.9822118 0.9845233 0.9864257 0.9879987 0.9893048 0.9903935 0.9913041 0.9920676 0.9927090 0.9932484 0.9937019 0.9940823 0.9944002 0.9946641 0.9948808 0.9950558 0.9951934 0.9952973 0.9953700 0.9954137 0.9954298 0.9954193 0.9953826 0.9953197 0.9952303 0.9951137 0.9949685 0.9947933 0.9945858 0.9943437
1.35 0.2050376 0.3544154 0.4853651 0.5942813 0.6820471 0.7513955 0.8055371 0.8475154 0.8799545 0.9050030 0.9243663 0.9393726 0.9510438 0.9601607 0.9673172 0.9729648 0.9774465 0.9810232 0.9838943 0.9862120 0.9880937 0.9896295 0.9908894 0.9919280 0.9927878 0.9935023 0.9940978 0.9945953 0.9950114 0.9953593 0.9956498 0.9958912 0.9960905 0.9962532 0.9963836 0.9964852 0.9965608 0.9966124 0.9966417 0.9966497 0.9966370 0.9966041 0.9965507 0.9964766 0.9963810 0.9962627 0.9961204 0.9959522 0.9957559
1.36 0.2135418 0.3700448 0.5054628 0.6163516 0.7042271 0.7724864 0.8248765 0.8648203 0.8951858 0.9182640 0.9358334 0.9492512 0.9595415 0.9674728 0.9736200 0.9784129 0.9821732 0.9851420 0.9875010 0.9893874 0.9909051 0.9921335 0.9931334 0.9939516 0.9946243 0.9951797 0.9956399 0.9960221 0.9963401 0.9966046 0.9968243 0.9970060 0.9971551 0.9972761 0.9973723 0.9974466 0.9975009 0.9975370 0.9975560 0.9975587 0.9975456 0.9975168 0.9974723 0.9974115 0.9973339 0.9972385 0.9971239 0.9969887 0.9968308
1.37 0.2222280 0.3858305 0.5254599 0.6379513 0.7255654 0.7924306 0.8428559 0.8806431 0.9088901 0.9300117 0.9458420 0.9577515 0.9667553 0.9736011 0.9788387 0.9828727 0.9860010 0.9884442 0.9903656 0.9918873 0.9931006 0.9940744 0.9948608 0.9954996 0.9960212 0.9964491 0.9968015 0.9970925 0.9973333 0.9975326 0.9976973 0.9978328 0.9979434 0.9980325 0.9981029 0.9981566 0.9981952 0.9982200 0.9982319 0.9982314 0.9982188 0.9981943 0.9981576 0.9981083 0.9980460 0.9979696 0.9978782 0.9977703 0.9976442
1.38 0.2310901 0.4017452 0.5453072 0.6590240 0.7460171 0.8112093 0.8594908 0.8950349 0.9211507 0.9403563 0.9545220 0.9650174 0.9728371 0.9787006 0.9831281 0.9864959 0.9890772 0.9910710 0.9926228 0.9938399 0.9948015 0.9955668 0.9961799 0.9966743 0.9970752 0.9974020 0.9976695 0.9978892 0.9980700 0.9982188 0.9983412 0.9984413 0.9985226 0.9985877 0.9986387 0.9986771 0.9987043 0.9987210 0.9987281 0.9987258 0.9987143 0.9986938 0.9986640 0.9986245 0.9985748 0.9985142 0.9984418 0.9983563 0.9982564
1.39 0.2401221 0.4177614 0.5649573 0.6795186 0.7655466 0.8288160 0.8748092 0.9080577 0.9320589 0.9494114 0.9620030 0.9711876 0.9779298 0.9829145 0.9866284 0.9894181 0.9915309 0.9931448 0.9943878 0.9953532 0.9961090 0.9967053 0.9971793 0.9975587 0.9978642 0.9981117 0.9983130 0.9984775 0.9986121 0.9987224 0.9988126 0.9988860 0.9989452 0.9989924 0.9990290 0.9990562 0.9990751 0.9990862 0.9990900 0.9990868 0.9990768 0.9990599 0.9990359 0.9990046 0.9989653 0.9989176 0.9988607 0.9987934 0.9987148
1.4 0.2493174 0.4338516 0.5843648 0.6993899 0.7841278 0.8452551 0.8888500 0.9197819 0.9417110 0.9572919 0.9684112 0.9763940 0.9821660 0.9863727 0.9894648 0.9917579 0.9934739 0.9947699 0.9957576 0.9965171 0.9971064 0.9975673 0.9979308 0.9982195 0.9984505 0.9986363 0.9987867 0.9989088 0.9990082 0.9990892 0.9991552 0.9992086 0.9992514 0.9992852 0.9993113 0.9993304 0.9993433 0.9993505 0.9993523 0.9993489 0.9993404 0.9993267 0.9993076 0.9992829 0.9992522 0.9992149 0.9991704 0.9991178 0.9990563
1.41 0.2586693 0.4499883 0.6034868 0.7185989 0.8017432 0.8605412 0.9016609 0.9302846 0.9502058 0.9641112 0.9738677 0.9807597 0.9856670 0.9891919 0.9917475 0.9936183 0.9950015 0.9960342 0.9968130 0.9974059 0.9978617 0.9982151 0.9984916 0.9987096 0.9988829 0.9990214 0.9991328 0.9992227 0.9992956 0.9993546 0.9994025 0.9994410 0.9994717 0.9994958 0.9995142 0.9995275 0.9995362 0.9995408 0.9995413 0.9995380 0.9995309 0.9995199 0.9995049 0.9994856 0.9994617 0.9994328 0.9993983 0.9993575 0.9993096
1.42 0.2681711 0.4661442 0.6222829 0.7371124 0.8183843 0.8746979 0.9132973 0.9396469 0.9576429 0.9699792 0.9784864 0.9843980 0.9885420 0.9914751 0.9935723 0.9950876 0.9961942 0.9970110 0.9976204 0.9980797 0.9984295 0.9986985 0.9989072 0.9990706 0.9991995 0.9993019 0.9993838 0.9994496 0.9995026 0.9995453 0.9995798 0.9996074 0.9996292 0.9996463 0.9996591 0.9996683 0.9996741 0.9996769 0.9996767 0.9996737 0.9996679 0.9996592 0.9996475 0.9996326 0.9996141 0.9995918 0.9995652 0.9995337 0.9994966
1.43 0.2778154 0.4822921 0.6407157 0.7549031 0.8340500 0.8877564 0.9238203 0.9479525 0.9641203 0.9750009 0.9823736 0.9874119 0.9908884 0.9933125 0.9950215 0.9962401 0.9971191 0.9977604 0.9982338 0.9985870 0.9988535 0.9990567 0.9992131 0.9993346 0.9994298 0.9995050 0.9995648 0.9996125 0.9996508 0.9996815 0.9997061 0.9997257 0.9997412 0.9997531 0.9997620 0.9997683 0.9997721 0.9997737 0.9997732 0.9997706 0.9997659 0.9997591 0.9997500 0.9997385 0.9997244 0.9997073 0.9996869 0.9996627 0.9996342
1.44 0.2875951 0.4984053 0.6587505 0.7719499 0.8487472 0.8997550 0.9332949 0.9552859 0.9697332 0.9792754 0.9856267 0.9898940 0.9927917 0.9947818 0.9961651 0.9971383 0.9978316 0.9983317 0.9986967 0.9989664 0.9991679 0.9993203 0.9994366 0.9995263 0.9995962 0.9996510 0.9996943 0.9997287 0.9997561 0.9997781 0.9997955 0.9998094 0.9998202 0.9998285 0.9998347 0.9998389 0.9998414 0.9998422 0.9998416 0.9998394 0.9998357 0.9998304 0.9998234 0.9998146 0.9998039 0.9997908 0.9997753 0.9997568 0.9997350
1.45 0.2975025 0.5144578 0.6763558 0.7882372 0.8624890 0.9107371 0.9417893 0.9617307 0.9745727 0.9828945 0.9883339 0.9919263 0.9943263 0.9959496 0.9970618 0.9978339 0.9983770 0.9987642 0.9990437 0.9992482 0.9993996 0.9995130 0.9995989 0.9996648 0.9997156 0.9997553 0.9997865 0.9998111 0.9998306 0.9998462 0.9998585 0.9998682 0.9998757 0.9998815 0.9998857 0.9998885 0.9998901 0.9998905 0.9998898 0.9998880 0.9998851 0.9998810 0.9998757 0.9998691 0.9998609 0.9998510 0.9998392 0.9998252 0.9998086
1.46 0.3075301 0.5304240 0.6935034 0.8037552 0.8752948 0.9207509 0.9493728 0.9673688 0.9787251 0.9859429 0.9905747 0.9935809 0.9955565 0.9968723 0.9977608 0.9983693 0.9987919 0.9990896 0.9993023 0.9994562 0.9995691 0.9996530 0.9997161 0.9997640 0.9998008 0.9998294 0.9998516 0.9998691 0.9998830 0.9998939 0.9999025 0.9999093 0.9999145 0.9999185 0.9999213 0.9999232 0.9999241 0.9999243 0.9999236 0.9999222 0.9999199 0.9999168 0.9999128 0.9999078 0.9999017 0.9998942 0.9998853 0.9998747 0.9998621
1.47 0.3176698 0.5462791 0.7101681 0.8184990 0.8871892 0.9298475 0.9561150 0.9722789 0.9822707 0.9884976 0.9924196 0.9949206 0.9965371 0.9975970 0.9983023 0.9987788 0.9991055 0.9993330 0.9994937 0.9996088 0.9996925 0.9997541 0.9998001 0.9998348 0.9998612 0.9998816 0.9998974 0.9999098 0.9999195 0.9999272 0.9999332 0.9999379 0.9999415 0.9999441 0.9999461 0.9999473 0.9999479 0.9999479 0.9999473 0.9999461 0.9999444 0.9999421 0.9999391 0.9999353 0.9999307 0.9999251 0.9999184 0.9999104 0.9999009
1.48 0.3279138 0.5619993 0.7263283 0.8324690 0.8982014 0.9380806 0.9620850 0.9765361 0.9852839 0.9906278 0.9939306 0.9959994 0.9973143 0.9981630 0.9987194 0.9990902 0.9993412 0.9995139 0.9996345 0.9997201 0.9997817 0.9998267 0.9998600 0.9998849 0.9999038 0.9999183 0.9999295 0.9999381 0.9999449 0.9999503 0.9999544 0.9999576 0.9999601 0.9999619 0.9999632 0.9999640 0.9999643 0.9999642 0.9999637 0.9999629 0.9999615 0.9999598 0.9999575 0.9999547 0.9999513 0.9999471 0.9999421 0.9999361 0.9999289
1.49 0.3382540 0.5775616 0.7419655 0.8456701 0.9083642 0.9455052 0.9673499 0.9802113 0.9878327 0.9923953 0.9951617 0.9968635 0.9979270 0.9986025 0.9990388 0.9993256 0.9995172 0.9996475 0.9997375 0.9998007 0.9998458 0.9998785 0.9999024 0.9999202 0.9999337 0.9999439 0.9999517 0.9999578 0.9999625 0.9999662 0.9999690 0.9999712 0.9999729 0.9999741 0.9999750 0.9999755 0.9999756 0.9999755 0.9999752 0.9999745 0.9999735 0.9999722 0.9999705 0.9999684 0.9999659 0.9999628 0.9999590 0.9999546 0.9999492
1.5 0.3486820 0.5929440 0.7570643 0.8581112 0.9177137 0.9521768 0.9719748 0.9833703 0.9899789 0.9938549 0.9961598 0.9975521 0.9984073 0.9989419 0.9992821 0.9995026 0.9996480 0.9997457 0.9998125 0.9998589 0.9998917 0.9999152 0.9999323 0.9999450 0.9999545 0.9999616 0.9999671 0.9999713 0.9999746 0.9999771 0.9999791 0.9999805 0.9999817 0.9999825 0.9999830 0.9999834 0.9999834 0.9999833 0.9999830 0.9999825 0.9999818 0.9999808 0.9999795 0.9999780 0.9999761 0.9999738 0.9999711 0.9999677 0.9999637
1.51 0.3591896 0.6081256 0.7716127 0.8698055 0.9262883 0.9581507 0.9760217 0.9860744 0.9917780 0.9950544 0.9969650 0.9980980 0.9987820 0.9992027 0.9994664 0.9996349 0.9997446 0.9998175 0.9998667 0.9999005 0.9999243 0.9999411 0.9999533 0.9999623 0.9999689 0.9999739 0.9999777 0.9999806 0.9999828 0.9999846 0.9999859 0.9999869 0.9999877 0.9999882 0.9999886 0.9999887 0.9999888 0.9999887 0.9999884 0.9999880 0.9999875 0.9999868 0.9999859 0.9999847 0.9999833 0.9999817 0.9999796 0.9999771 0.9999741
1.52 0.3697684 0.6230866 0.7856017 0.8807691 0.9341283 0.9634813 0.9795492 0.9883795 0.9932795 0.9960358 0.9976115 0.9985286 0.9990727 0.9994020 0.9996052 0.9997333 0.9998156 0.9998696 0.9999057 0.9999302 0.9999473 0.9999593 0.9999679 0.9999742 0.9999788 0.9999823 0.9999849 0.9999869 0.9999885 0.9999896 0.9999905 0.9999912 0.9999917 0.9999921 0.9999923 0.9999924 0.9999924 0.9999923 0.9999921 0.9999919 0.9999915 0.9999909 0.9999903 0.9999894 0.9999884 0.9999872 0.9999857 0.9999838 0.9999816
1.53 0.3804099 0.6378087 0.7990252 0.8910214 0.9412750 0.9682217 0.9826126 0.9903364 0.9945272 0.9968349 0.9981280 0.9988666 0.9992972 0.9995535 0.9997093 0.9998061 0.9998675 0.9999073 0.9999336 0.9999513 0.9999635 0.9999720 0.9999781 0.9999825 0.9999857 0.9999881 0.9999899 0.9999912 0.9999923 0.9999931 0.9999937 0.9999941 0.9999945 0.9999947 0.9999948 0.9999949 0.9999949 0.9999948 0.9999947 0.9999945 0.9999942 0.9999938 0.9999933 0.9999927 0.9999920 0.9999910 0.9999899 0.9999886 0.9999869
1.54 0.3911058 0.6522744 0.8118800 0.9005844 0.9477703 0.9724231 0.9852629 0.9919911 0.9955595 0.9974827 0.9985388 0.9991307 0.9994696 0.9996681 0.9997869 0.9998597 0.9999052 0.9999344 0.9999534 0.9999662 0.9999748 0.9999808 0.9999851 0.9999881 0.9999903 0.9999920 0.9999932 0.9999941 0.9999948 0.9999954 0.9999958 0.9999961 0.9999963 0.9999965 0.9999966 0.9999966 0.9999966 0.9999965 0.9999964 0.9999962 0.9999960 0.9999958 0.9999954 0.9999950 0.9999944 0.9999938 0.9999929 0.9999920 0.9999907
1.55 0.4018474 0.6664678 0.8241657 0.9094823 0.9536565 0.9761345 0.9875476 0.9933848 0.9964102 0.9980056 0.9988640 0.9993360 0.9996014 0.9997543 0.9998445 0.9998989 0.9999325 0.9999538 0.9999675 0.9999766 0.9999827 0.9999869 0.9999899 0.9999920 0.9999935 0.9999946 0.9999955 0.9999961 0.9999966 0.9999969 0.9999972 0.9999974 0.9999975 0.9999976 0.9999977 0.9999977 0.9999977 0.9999977 0.9999976 0.9999975 0.9999973 0.9999971 0.9999968 0.9999965 0.9999961 0.9999957 0.9999951 0.9999943 0.9999934
1.56 0.4126264 0.6803742 0.8358843 0.9177408 0.9589751 0.9794022 0.9895101 0.9945541 0.9971082 0.9984259 0.9991203 0.9994948 0.9997018 0.9998189 0.9998870 0.9999275 0.9999521 0.9999676 0.9999774 0.9999839 0.9999882 0.9999911 0.9999932 0.9999946 0.9999957 0.9999964 0.9999970 0.9999974 0.9999977 0.9999980 0.9999981 0.9999983 0.9999984 0.9999984 0.9999985 0.9999985 0.9999985 0.9999984 0.9999984 0.9999983 0.9999982 0.9999980 0.9999978 0.9999976 0.9999973 0.9999970 0.9999966 0.9999960 0.9999954
1.57 0.4234342 0.6939803 0.8470401 0.9253874 0.9637673 0.9822702 0.9911898 0.9955314 0.9976787 0.9987622 0.9993214 0.9996173 0.9997778 0.9998671 0.9999182 0.9999482 0.9999662 0.9999773 0.9999844 0.9999889 0.9999920 0.9999940 0.9999954 0.9999964 0.9999971 0.9999976 0.9999980 0.9999983 0.9999985 0.9999987 0.9999988 0.9999989 0.9999989 0.9999990 0.9999990 0.9999990 0.9999990 0.9999990 0.9999989 0.9999988 0.9999988 0.9999987 0.9999985 0.9999984 0.9999982 0.9999979 0.9999976 0.9999972 0.9999967
1.58 0.4342624 0.7072742 0.8576399 0.9324505 0.9680730 0.9847793 0.9926225 0.9963452 0.9981431 0.9990302 0.9994786 0.9997111 0.9998351 0.9999029 0.9999411 0.9999631 0.9999762 0.9999842 0.9999892 0.9999924 0.9999945 0.9999960 0.9999969 0.9999976 0.9999981 0.9999984 0.9999987 0.9999989 0.9999990 0.9999991 0.9999992 0.9999993 0.9999993 0.9999993 0.9999993 0.9999993 0.9999993 0.9999993 0.9999993 0.9999992 0.9999992 0.9999991 0.9999990 0.9999989 0.9999987 0.9999986 0.9999983 0.9999980 0.9999977
1.59 0.4451027 0.7202450 0.8676921 0.9389591 0.9719310 0.9869677 0.9938403 0.9970203 0.9985197 0.9992429 0.9996008 0.9997828 0.9998781 0.9999293 0.9999577 0.9999739 0.9999834 0.9999891 0.9999926 0.9999949 0.9999963 0.9999973 0.9999979 0.9999984 0.9999987 0.9999990 0.9999991 0.9999993 0.9999994 0.9999994 0.9999995 0.9999995 0.9999995 0.9999996 0.9999996 0.9999996 0.9999996 0.9999995 0.9999995 0.9999995 0.9999994 0.9999994 0.9999993 0.9999992 0.9999991 0.9999990 0.9999988 0.9999986 0.9999984
1.6 0.4559468 0.7328836 0.8772072 0.9449428 0.9753783 0.9888704 0.9948720 0.9975784 0.9988238 0.9994111 0.9996955 0.9998374 0.9999102 0.9999487 0.9999698 0.9999816 0.9999884 0.9999925 0.9999950 0.9999965 0.9999975 0.9999982 0.9999986 0.9999989 0.9999992 0.9999993 0.9999994 0.9999995 0.9999996 0.9999996 0.9999997 0.9999997 0.9999997 0.9999997 0.9999997 0.9999997 0.9999997 0.9999997 0.9999997 0.9999997 0.9999996 0.9999996 0.9999995 0.9999995 0.9999994 0.9999993 0.9999992 0.9999990 0.9999989

18.3.5 Define a palette for the results

#set the colours used for the plot
wut.colors<-rev(c("red","magenta","pink","orange","yellow","green","dark green", "blue","purple","dark blue"))
#print plot of power

image(risk_values,maf_values,as.matrix(xx),zlim=c(0,1),col= wut.colors,breaks=seq(0,1,by=0.1),useRaster=T,main=paste("Power @ Prevalence :",prevalence,"| Cases :",num.cases,"| Controls :",num.controls,"| alpha :",alpha),xlab="Relative Risk",ylab="Minor allele frequency",cex.main=0.8);legend(x=1,y=0.4,cex=0.5,legend=c("0.00-0.09","0.10-0.19","0.20-0.29","0.30-0.39","0.40-0.49","0.50-0.59","0.60-0.69","0.70-0.79","0.80-0.89","0.90-1.00"),fill=wut.colors,title="Power")