generateExample: Generate example data for PheWAS

View source: R/generateExample.R

generateExampleR Documentation

Generate example data for PheWAS

Description

generateExample creates simulated ICD9CM/ICD10CM, id.sex, and genotype data to test PheWAS methods. Requires the package MASS.

Usage

generateExample(n=5000,phenotypes.per=10,hit="335")

Arguments

n

The number of individuals in the study.

phenotypes.per

The base number of phenotypes per individual.

hit

The phecode for which an artificial hit will be generated.

Details

The output from this function will be random results with a significant association found between the genotype data and the selected phecode. It does not represent actual treatment data, though some highly connected phenotypes can also have strong associations due to the data creation methods.

Value

List with three named items:

id.vocab.code.count

A data frame of columns id, vocabulary_id, ICD code, and count suitable for transformation by createPhenotypes.

genotypes

A data frame of columns id and rsEXAMPLE, suitable for use in phewas after joining with phenotypic data.

id.sex

A data frame of columns id and sex, suitable for use in phewas and createPhenotypes.


PheWAS/PheWAS documentation built on July 3, 2023, 3:40 p.m.