# NOT RUN {
# The simulated data set described in Details.
sim1 <- simulateSNPglm()
sim1
# A bit more information: Table of probabilities of being a case
# vs. numbers of cases and controls.
summary(sim1)
# Calling an observation a case if its probability of being
# a case is larger than 0.5 (the default for p.cutoff).
sim2 <- simulateSNPglm(sample.y = FALSE)
summary(sim2)
# If ((SNP4 != 2) & (SNP3 == 1)), (SNP5 ==3) and
# ((SNP12 !=1) & (SNP9 == 3)) should be the three interactions
# (or variables) that are explanatory for the response,
# list.ia and list.snp are specified as follows.
list.ia <- list(c(-2, 1), 3, c(-1,3))
list.snp <- list(c(4, 3), 5, c(12,9))
# The binary response and the data set consisting of
# 600 observations and 25 SNPs, where the minor allele
# frequency of each SNP is randomly drawn from a
# uniform distribution with minimum 0.1 and maximum 0.4,
# is then generated by
sim3 <- simulateSNPglm(n.obs = 600, n.snp = 25,
list.ia = list.ia, list.snp = list.snp, maf = c(0.1, 0.4))
sim3
summary(sim3)
# If the response should be quantitative, err.fun has
# to be specified. To use a normal distribution with mean 0
# (default in rnorm) and a standard deviation of 2
# as the distribution of the error, call
simulateSNPglm(err.fun = rnorm, sd = 2)
# }
Run the code above in your browser using DataLab