simulateSNPdata: simulate SNP data

Description Usage Arguments Value Note Examples

Description

This is a very simple function to simulate SNP data. For more sophisticated methods for simulating SNP data consider for example the scrime package.

Usage

1
2
simulateSNPdata(n.obs = 500, n.snp = 200, seed = NA, 
	maf = rep(c(0.05, 0.1, 0.25, 0.4), each = 50), prob1 = 0.5)

Arguments

n.obs

A integer. The number of observations.

n.snp

A integer. The number of SNPs.

seed

The seed to be used in data simulation.

maf

A numeric of length n.snps indicating the MAF with which the according SNP should be simulated.

prob1

The probability with which every observation of the response vector y has value 1. Defaults to 0.5.

Value

A data.frame with dimensions n.obs x (n.snps + 1). The response y is contained in the first column and is simulated binary (0,1), with equal probabilities.

Note

The user can provide his own data set and use the other functions in this package as long as the first column contains the response and the other columns 1-3 categorical variables coded (0,1,2). One could use the more advanced package scrime to simulate the SNP data for example.

Examples

1
2
3
4
YX <- simulateSNPdata(seed = 123)
dim(YX) 
class(YX)
colnames(YX)[1:10]

adibender/rFtools documentation built on May 14, 2019, 5:13 a.m.