Learn R Programming

CNVassoc (version 2.2)

simCNVdataWeibull: Simulate of CNV and a right censored Weibull distributed trait

Description

This function simulates intensity for a CNV and a time to event response (followed-up cohort study design) for different scenarios

Usage

simCNVdataWeibull(n, mu.surrog, sd.surrog, w, lambda, shape, time.cens = Inf, cnv.random = FALSE)

Arguments

n
An integer indicating the desired number of individuals to be simulated
mu.surrog
A vector containing the signal (surrogate variable) means for every copy number status (latent classes). Its length must be equal to the number of latent classes
sd.surrog
A vector containing the signal standard deviation for every copy number status. Its length must be equal to mu.surrog.
w
A vector containing the frequencies for every copy number status. Its length must be equal to mu.surrog and its components must sum up one.
lambda
A vector containing the means of the response variable for every copy number status
shape
A vector containing the shape of the response variable for every copy number status
time.cens
Censoring time, e.g. end of follow-up
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

Value

Data frame with individual simulated data per row and with the following variables:
resp
Time to event or censoring variable (response)
cens
Censoring indicator
surrog
Signal intensity following a mixture of normals with means, standard deviations and proportions specified by mu.surrog, sd.surrog and w respectively
cnv
True copy number status

See Also

simCNVdataBinary, simCNVdataCaseCon, simCNVdataPois, simCNVdataNorm, cnv, CNVassoc

Examples

Run this code
library(survival)  
maf<-0.3
hr<-1.5
set.seed(123)
simData<-simCNVdataWeibull(n=3000, mu.surrog=c(0,0.5,1), sd.surrog=rep(0.15,3), 
         w=c((1-maf)^2,2*maf*(1-maf), maf^2), lambda=0.05*c(1,hr,hr^2), shape=rep(1,3), 
         time.cens=1.5, cnv.random = FALSE)
CNV<-cnv(simData$surrog,mix.method="EMmixt")
getQualityScore(CNV,type="CNVtools")  
mod<-CNVassoc(Surv(resp, cens)~CNV,data=simData,family="weibull")
CNVtest(mod)
summary(mod)

Run the code above in your browser using DataLab