sim_phewas_results: Simulate PheWAS results

Description Usage Arguments Value Examples

View source: R/sim_phewas_results.R

Description

Produces a dataframe that can be used for testing out functions in package on simulated data. Usually paired with meToolkit::sim_individual_data(). Note that the results from this are a very rough simulation and should not be used for any legitimate simulation studies.

Usage

1
sim_phewas_results(n_codes, n_categories, avg_OR = 1.3)

Arguments

n_codes

How many phecodes should be simulated for the results?

n_categories

How many categories should the phecodes be grouped into? Can't be more than 26.

avg_OR

The rough average of the odds ratio for the each code.

Value

A dataframe with columns: code: a unique phecode id (numbers of the form x.00), p_val: P-value drawn from a beta distribution peaked near zero, OR: An odds ratio for the code's test results, category: A simulated category (just a letter currently) that fills in order with last group category having less codes in it if there is not an even division of codes to categories. tooltip: Simple two line html tooltip of the code name and simulated p-value.

Examples

1
sim_phewas_results(n_codes = 100, n_categories = 11)

tbilab/meToolkit documentation built on June 23, 2020, 9:55 a.m.