SampleSNPPhenotype: Simulation of a sample of genotype and binary phenotype...

View source: R/SampleSNPPhenotype.R

SampleSNPPhenotypeR Documentation

Simulation of a sample of genotype and binary phenotype values

Description

SampleSNPPhenotype is used to generate a sample of genotype values for a gene and of phenotype values. The phenotype is generated conditionally to the gene using a logistic model.

Usage

SampleSNPPhenotype(X, beta0, beta, I, n0, n1, U = NULL, alpha = NULL,
  mod = rep("A", length(I)))

Arguments

X

a N x p matrix of genotype values (coded as 0/1/2) for a given gene for a population

beta0

the intercept of the logistic model

beta

the vector of effect parameters for the logistic model

I

the vector of coordinates corresponding to the coefficients in beta

n0

the desired number of controls

n1

the desired number of cases

U

an optional matrix of covariates profiles

alpha

an optional vector of covariates effects parameters

mod

an optional vector of characters specifying the genetic association model for each SNP position given in I. Possibles values: "A" (additive model), "D" (dominant) and "R" (recessive). Models can be combined (causal SNPs can be associated to the phenotype with different models).

Value

A list containing 3 elements:

SNP

the sample matrix of genotypic profiles

Y

the vector of phenotype values

Covariates

the sample matrix of covariates profiles (if any)


fhebert/SNPSetSimulations documentation built on Jan. 9, 2025, 3:17 a.m.