Credible set of putative causal variants

credset(pp, CV, thr)

## Arguments

pp Vector of posterior probabilities of causality Optional parameter: Index of CV Minimum threshold for credible set size

## Value

list of the variants in the credible set, the claimed.cov (cumulative sum of the posterior probabilities of the variants forming the credible set), binary covered indicator (1 if CV is contained in the credible set) and nvar (number of variants in the set)

## Details

If the CV parameter is supplied (index of causal variant) then the output includes a binary indicator of whether the CV is contained in the set

## Examples


set.seed(1)
nsnps <- 100
pp <- rnorm(nsnps, 0.3, 0.05)
pp <- pp/sum(pp)

credset(pp, thr = 0.9)#> $credset #> [1] 61 70 56 4 95 11 68 55 31 92 83 93 15 39 87 18 21 50 19 #> [20] 22 48 40 8 94 43 63 25 73 85 20 9 59 96 44 7 71 30 51 #> [39] 12 33 89 47 53 86 5 76 90 66 2 69 23 79 64 78 17 62 16 #> [58] 34 26 38 32 49 60 82 27 41 42 88 10 57 37 36 77 100 29 91 #> [77] 81 98 80 52 13 1 45 46 72 65 6 #> #>$claimed.cov
#> [1] 0.9019109
#>
#> $nvar #> [1] 87 #> iCV <- 71 credset(pp, CV = iCV, thr = 0.9)#>$credset
#>  [1]  61  70  56   4  95  11  68  55  31  92  83  93  15  39  87  18  21  50  19
#> [20]  22  48  40   8  94  43  63  25  73  85  20   9  59  96  44   7  71  30  51
#> [39]  12  33  89  47  53  86   5  76  90  66   2  69  23  79  64  78  17  62  16
#> [58]  34  26  38  32  49  60  82  27  41  42  88  10  57  37  36  77 100  29  91
#> [77]  81  98  80  52  13   1  45  46  72  65   6
#>
#> $claimed.cov #> [1] 0.9019109 #> #>$covered
#> [1] 1
#>
#> \$nvar
#> [1] 87
#>