# BUHMBOX Power calculation manual

<< Go back to BUHMBOX main homepage

## Prerequisite

1. R installed in the system

2. Disease A case and control sample sizes.

3. List of disease B associated loci (risk allele frequencies, and odds ratios)

## How to run

The file includes one R function. You can read the file with "source" command and run the `get.power` function.
The function arguments are as follows,

## ARGUMENTS #########################################################
## nexp: number of simulation experiments to measure power (e.g 1000)
## N: case sample size
## Ncont: control sample size (New: 7/14/15)
## p: number of SNPs
## rafs: risk allele frequency
## ORs: true odds ratios for generative model
## ORs.for.method: odds ratios that the method "think" are true
## phi: proportion of contaminating group
## thres: p-value threshold (can be vector, for examining multiple different thresholds.)

- nexp: Number of repeats.. 1,000 is typically enough, and 10,000 for accurate power calculation
- N: case sample size of disease A
- Ncont: control sample size
- p: Number of known disease-B-associated SNPs that will be used for BUHMBOX
- rafs: risk allele frequencies of those SNPs.
- ORs: ORs of those SNPs. (must be > 1.0) Simulation runs assuming these ORs are true ORs.
- ORs.for.method: This is the OR that is given to the BUHMBOX method. This is for simulating situations that BUHMBOX
is given with inaccurate OR. Otherwise, you can just simply use the same values as OR above
- phi: proportion of heterogeneous group. (We used "pi" in our paper, but pi has different meaning in R).
- thres: the significance threshold that will be used for power calculation. Typical values can be 0.05, or 0.01. (Or divided by the number of diseases, if you want to test e.g. K different disease B.)
This argument can be a vector -- in that case, the power calculation will be done for each threshold automatically.

rafs, ORs, ORs.for.method will be repeated as necessary for p SNPs. That is,
if you want to use OR of 1.2 for all SNPs, you can just put 1.2.
## Output

In our output dataframe:
PowerBUHMBOX |
Power of BUHMBOX |

PowerUnweighted |
Power if we ignore the weighting based on OR and RAF |

PowerNondirectional |
Power if we combine correlations using Jennrich's chi-square-like style, which ignores the directions of z-scores |

Threshold |
Significance threshold |

Nexp |
Number of repeats for power calculation |

N |
Case sample size |

Ncont |
Control sample size |

NSNP |
Number of SNPs used. |

Pi |
Heterogeneity proportion. |

<< Go back to BUHMBOX main homepage