Description Usage Arguments Value Examples
View source: R/sim_individual_data.R
This function will take the results of a PheWAS study (most importantly a code, case and control numbers, and an OR) and simulate as many individual datapoints as you desire. Should only be used for testing of apps and not any real simulation studies.
1 | sim_individual_data(phewas_results, num_patients, snp_prev)
|
phewas_results |
Phewas results. Needs a column |
num_patients |
How many patients should be simulated. |
snp_prev |
The overall population prevalence of the snp you want to simulate. |
list with following components
tibble
with patient ID
and snp status (snp
)
wide
tibble with an ID
column and a column for each code provided in the
phewas_resuts
input. Cell values are if the patient had that given
code.
1 2 | simulated_phewas <- sim_phewas_results(n_codes = 100, n_categories = 11)
sim_individual_data(simulated_phewas, 10, 0.15)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.