# Set number of outcomes
k = 2
# Set number of observations
n = 100
# Set number of covariates
p = 2
# Set number of SNPs
q = 50
# Set number of causal SNPs
num = 5
# Set number of quadrature nodes
d = 100
# Variance of subject-specific random effect
tauSq = 1
# Define the effect sizes
effectSizes <- c(.03, .15)
# Set MAF cutoff for causal SNPs
Causal.MAF.Cutoff = 0.1
# the baseline cumulative hazard function
bhFunInv <- function(x) {x}
set.seed(1)
# Generate covariate matrix
xMat <- cbind(rnorm(n), rbinom(n=n, size=1, prob=0.5))
# Generate genetic matrix
gMat <- matrix(data=rbinom(n=n*q, size=2, prob=0.1), nrow=n)
# Get indices to specific select causal variants
idx <- Get_CausalSNPs_bynum(gMat, num, Causal.MAF.Cutoff)
# Subset the gMat
gMatCausal <- gMat[,idx]
# Generate the multiple outcomes
exampleDat <- simico_gen_dat(bhFunInv = bhFunInv, obsTimes = 1:3,
windowHalf = 0.1, n, p, k, tauSq, gMatCausal,
xMat, effectSizes)
Run the code above in your browser using DataLab