# fuzzyBHexact: Exact calculation of fuzzy decision rules (Benjamini and... In fuzzyFDR: Exact calculation of fuzzy decision rules for multiple testing

## Description

Exact calculation of fuzzy decision rules for multiple testing. Controls the FDR (false discovery rate) using the Benjamini and Hochberg method.

## Usage

 `1` ```fuzzyBHexact(pvals, pprev, alpha = 0.05, tol = 1e-05, q.myuni = T, dp = 20) ```

## Arguments

 `pvals` observed discrete p-values `pprev` previously attainable p-values under the null distribution `alpha` significance level of the FDR procedure `tol` tolerance for my.match and my.unique `q.myuni` logical. Use my.match instead of match? `dp` no. decimal places to round p-values to

## Details

my.match and my.unique may be used instead of match and unique if there is a problem with calculating the unique set of p-values (sometimes a problem with very small p-values)

## Value

Data frame containing the p-values and previously attainable p-values input to the function, and the tau (fuzzy decision rule) output. Also contains the minimum and maximum ranks over allocations for each p-value.

Alex Lewin

## References

Kulinsakaya and Lewin (2007).

## Examples

 ```1 2 3 4 5 6``` ```data(example1) names(example1) fuzzyBHexact(example1\$pvals,example1\$pprev,alpha=0.05) data(example2) names(example2) fuzzyBHexact(example2\$pvals,example2\$pprev,alpha=0.05) ```

### Example output

```[1] "pvals" "pprev"
[1] "total no. intervals =  8"
[1] "total no. possible alloc. =  1296"
[1] "global sf =  6"
[1] "global sc =  4"
p.minus p.plus r.minus r.plus leng a.minus a.plus
1  0.0000 0.0010       1      2    2  0.0071 0.0143
2  0.0010 0.0039       1      3    3  0.0071 0.0214
3  0.0039 0.0107       2      4    3  0.0143 0.0286
4  0.0107 0.0156       3      5    3  0.0214 0.0357
5  0.0156 0.0352       4      6    3  0.0286 0.0429
6  0.0352 0.0547       5      7    3  0.0357 0.0500
7  0.0547 0.1094       6      7    2  0.0429 0.0500
8  0.1094 0.1445       7      7    1  0.0500 0.0500
[1] "reduced no. intervals =  4"
[1] "reduced no. alloc. =  36"
new.p.minus new.p.plus new.r.minus new.r.plus
1      0.0000     0.0156           1          5
2      0.0156     0.0352           4          6
3      0.0352     0.0547           5          7
4      0.0547     0.1445           6          7
[1] "starting loop over allocations"
[1] ""
[1] "Exact Method"
[1] "alpha =  0.05"
pvals  pprev z.min z.max new.z.min new.z.max    tau
1 0.0039 0.0000     1     2         1         1 1.0000
2 0.0107 0.0010     2     3         1         1 1.0000
3 0.0156 0.0000     1     4         1         1 1.0000
4 0.0352 0.0039     3     5         1         2 0.9340
5 0.0547 0.0107     4     6         1         3 0.6325
6 0.1094 0.0156     5     7         2         4 0.2815
7 0.1445 0.0352     6     8         3         4 0.0801
pvals  pprev z.min z.max new.z.min new.z.max    tau
1 0.0039 0.0000     1     2         1         1 1.0000
2 0.0107 0.0010     2     3         1         1 1.0000
3 0.0156 0.0000     1     4         1         1 1.0000
4 0.0352 0.0039     3     5         1         2 0.9340
5 0.0547 0.0107     4     6         1         3 0.6325
6 0.1094 0.0156     5     7         2         4 0.2815
7 0.1445 0.0352     6     8         3         4 0.0801
[1] "pvals" "pprev"
[1] "total no. intervals =  4"
[1] "total no. possible alloc. =  1"
[1] "global sf =  2"
[1] "global sc =  1"
p.minus p.plus r.minus r.plus leng a.minus a.plus
1   0.000  0.004       1      1    1   0.005  0.005
2   0.004  0.035       2      4    3   0.010  0.020
3   0.035  0.145       5      6    2   0.025  0.030
4   0.145  0.363       7     10    4   0.035  0.050
[1] "reduced no. intervals =  3"
[1] "reduced no. alloc. =  1"
new.p.minus new.p.plus new.r.minus new.r.plus
1       0.000      0.004           1          1
2       0.004      0.035           2          4
3       0.035      0.363           5         10
[1] "starting loop over allocations"
[1] ""
[1] "Exact Method"
[1] "alpha =  0.05"
pvals pprev z.min z.max new.z.min new.z.max    tau
1  0.004 0.000     1     1         1         1 1.0000
2  0.035 0.004     2     2         2         2 0.3349
3  0.035 0.004     2     2         2         2 0.3349
4  0.035 0.004     2     2         2         2 0.3349
5  0.145 0.035     3     3         3         3 0.0000
6  0.145 0.035     3     3         3         3 0.0000
7  0.363 0.145     4     4         3         3 0.0000
8  0.363 0.145     4     4         3         3 0.0000
9  0.363 0.145     4     4         3         3 0.0000
10 0.363 0.145     4     4         3         3 0.0000
pvals pprev z.min z.max new.z.min new.z.max    tau
1  0.004 0.000     1     1         1         1 1.0000
2  0.035 0.004     2     2         2         2 0.3349
3  0.035 0.004     2     2         2         2 0.3349
4  0.035 0.004     2     2         2         2 0.3349
5  0.145 0.035     3     3         3         3 0.0000
6  0.145 0.035     3     3         3         3 0.0000
7  0.363 0.145     4     4         3         3 0.0000
8  0.363 0.145     4     4         3         3 0.0000
9  0.363 0.145     4     4         3         3 0.0000
10 0.363 0.145     4     4         3         3 0.0000
```

fuzzyFDR documentation built on May 2, 2019, 5:14 a.m.