Description Usage Arguments Details Value See Also Examples
View source: R/simCNVdataBinary.R
This function simulates intensity for a CNV and a binary trait response for different scenarios
1 | simCNVdataBinary(n, mu.surrog, sd.surrog, w, p0, or, cnv.random = FALSE)
|
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 indicated by 'w'. Default value is FALSE |
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.
Data frame with individual simulated data per row and with the following variables:
resp |
Trait (response) variable following a Bernoulli distribution given the CNV status |
surrog |
Signal intensity following a mixture of normals with means, standard deviations
and proportions specified by |
cnv |
True copy number status |
simCNVdataCaseCon
,
simCNVdataNorm
,
simCNVdataPois
,
simCNVdataWeibull
,
cnv
,
CNVassoc
1 2 3 4 5 6 7 8 9 | 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)
|
Loading required package: CNVassocData
Loading required package: mixdist
Loading required package: mclust
Package 'mclust' version 5.3
Type 'citation("mclust")' for citing this R package in publications.
Loading required package: survival
--CNVtools Quality Score: 3.348075
----CNV Wald test----
Chi= 1.156755 (df= 2 ) , pvalue= 0.5608077
Call:
CNVassoc(formula = resp ~ CNV, data = simData, family = "binomial")
Deviance: 736.682
Number of parameters: 3
Number of individuals: 1000
Coefficients:
OR lower.lim upper.lim SE stat pvalue
CNV0 1.0000
CNV1 1.1912 0.7665 1.8512 0.2249 0.7777 0.437
CNV2 1.3851 0.6897 2.7816 0.3558 0.9156 0.360
(Dispersion parameter for binomial family taken to be 1 )
Covariance between coefficients:
CNV1 CNV2 CNV3
CNV1 0.0224 -0.0019 0.0003
CNV2 0.0243 -0.0038
CNV3 0.1047
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.