Description Usage Arguments Details Value Warning Examples
Simulate genetic data in R, including genotypes, phenotype status and liabilities, for individuals.
1 |
n |
number of genotypes (individuals). |
m |
number of SNPS per genotype. |
q |
number of causal SNPs, i.e. SNPs that effect chances of having the phenotype. |
hsq |
squared heritability parameter. |
k |
prevalence of phenotype. |
to_ped |
if ‘TRUE', write the genotype output in PLINK’s .ped format. Else, write the number of minor alleles for each genotype at each SNP. |
A quick way of simulating a small amount of data to be stored in the R-session. Note that this function only simulates data for individuals without family history, i.e. they are not simulated as offspring. Hence, the simulation cannot be used in a study of family history.
Returns a list with 5 entries, containing a matrix of genotypes, a vector specifying effect sizes of SNPs, a vector with liability of individual i, a vector specifying phenotype status of individual i, and the transformed phenotype status used for linear regression in PLINK.
Since this function saves the generated data directly in R (that is, on RAM),
the function should not be used for large simulations, but rather to get an
idea of the general framework.
The function does not run in parallel.
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.