Learn R Programming

CNVassoc (version 1.4)

simCNVdataBinary: Simulation of CNV and discrete traits

Description

This function simulates intensity for a CNV and a binary trait response for different scenarios

Usage

simCNVdataBinary(n, mu.surrog, sd.surrog, w, p0, or, cnv.random = FALSE)

Arguments

n
number of simulated individuals
mu.surrog
a vector of intensity signal means for every copy number status
sd.surrog
a vector of intensity signal standard deviations for every copy number status
w
a vector of copy number status proportions
p0
prevalence of disease (trait) for populations with zero copies (reference category)
or
a vector of odds ratio for one, two,... copies respect to zero copies
cnv.random
A logical value. TRUE means that copy number status is drawn under a multinomial distribution with proportions indicated by 'w'. FALSE means that the real simulated frequency is always the same and is rounded to the most similar integer to the frequencies

Value

  • Data frame with individual simulated data per row and with the following variables:
  • respTrait (response) variable following a Bernoulli distribution given the CNV status
  • surrogSignal intensity following a mixture of normals with means, standard deviations and proportions specified by mu.surrog, sd.surrog and w respectively.
  • cnvTrue copy number status

Details

This function is useful to calculate the power of association models with binary traits under different scenarios, e.g. setting different degrees of association (odds ratios), considering different degrees of uncertainty controlled by the distribution of intensity signal data, i.e. mean mu.surrog, standard deviation sd.surrog and proportion w, etc.

See Also

simCNVdataCaseCon, simCNVdataNorm, simCNVdataPois, simCNVdataWeibull, cnv, CNVassoc

Examples

Run this code
maf<-0.3
set.seed(123)
simData<-simCNVdataBinary(n=1000, mu.surrog=c(0,0.5,1), sd.surrog=rep(0.15,3), 
         w=c((1-maf)^2,2*maf*(1-maf),maf^2), p0=0.1, or=c(1.3,1.3^2), cnv.random = FALSE)
CNV<-cnv(simData$surrog,mix.method="EMmixt")
getQualityScore(CNV,type="CNVtools")
mod<-CNVassoc(resp~CNV,data=simData,family="binomial")
CNVtest(mod)
summary(mod)

Run the code above in your browser using DataLab