\name{simTrios} \alias{simTrios} \title{Simulate Case-Parent Triad Data} \description{ Using log-linear model to fit a single SNP association we simulate corresponding case-parent triad data. The relative risks indicate preferential transmission of parental alleles to affected offspring. The simulation also generates missing data. } \usage{ simTrios(nfamily,pa,pmissing,RR,pedFormat=FALSE) } \arguments{ \item{nfamily}{an integer indicating the number of triads to simulate, requires an even number.} \item{pa}{a number between zero and one to indicate the minor allele frequency of the marker to simulate.} \item{pmissing}{a number between zero and one to indicate the proportion of nuclear trios with missing paternal genotypes.} \item{RR}{a vector with two numbers to indicate the relative risk of one allele copy and the relative risk of two allele copies.} \item{pedFormat}{if \code{FALSE} the simulated data is given as the counts generated for each triad type. If \code{TRUE} the simulated data is given as a \code{data.frame} containing eight variables. The format of output \code{peddata} then follows the standard pedigree format used for the majority of statistical genetics software packages like FASTLINK, Merlin, etc.} } \details{ This function simulates case-parent triads according to the parameters from a log-linear model to test for preferential transmission of an allele from unaffected parents to an affected offspring. The model contains two regression coefficients that estimate risk for transmission to the affected offspring of either one or two alleles. Currently the fit is an additive model with no restricting assumptions about recessive or dominant penetrance. The model equations are exactly as described in Weinberg, CR et al (1998). The function also simulates case-parent triad with missing paternal genotypes. } \value{ The function outputs an object of class \code{list} that has five components. \code{N} gives the number of families simulated. \code{MAF} gives the minor allele frequency of the simulated marker. \code{PercentMissing} gives the proportion of families with missing paternal genotypes. \code{RelativeRisk} gives a vector with two numbers to indicate the relative risk of one allele copy and the relative risk of two allele copies. \code{peddata} gives the counts for each trio type under the simulation by default. The counts are given for full trios and for trios with missing fathers. If \code{pedFormat=TRUE} then \code{peddata} gives a \code{data.frame} with eight variables. The variables are (1) \code{pedid} to indicate the ID number of the pedigree, (2) \code{id} to indicate the ID of the person genotyped, (3) \code{patid} to indicate the ID of the person's father and set to zero when unknown, (4) \code{matid} to indicate the ID of the person's mother and set to zero when unknown, (5) \code{gender} to indicate the gender of the person with a 1 for males and 2 for females, (6) \code{disease} to indicate if the person has the phenotype of interest with a 1 for no and a 2 for yes, (7) \code{marker1.1} to indicate the presence of at least one allele copy, and (8) \code{marker1.2} to indicate the presence of at least two allele copies. } \references{ Weinberg, C. R., Wilcox, A. J., and Lie, R. T. (1998) A log-linear approach to case-parent-triad data: assessing effects of disease genes that act either directly or through maternal effects and that may be subject to parental imprinting. \emph{Am J Hum Genet}, \bold{62}, 969--978. Weinberg, C. R. (1999) Allowing for missing parents in genetic studies of case-parent triads. \emph{Am J Hum Genet}, \bold{64}, 1186--1193. } \seealso{ \code{\link{glm}\link{logLinear}}. } \examples{ ## create data from case-parent triads with ## no missing genotypes and no association simTrios(300,0.10,0.0,c(1,1),pedFormat=F) ## create data from case-parent triads with relative ## risks of association and no missing genotypes simTrios(300,0.10,0.0,c(1.5,3),pedFormat=F) ## create data from case-parent triads with relative ## risks of association and 20% missing genotypes simTrios(300,0.10,0.20,c(1.5,3),pedFormat=F) ## create data with the pedigree info format out <- simTrios(300,0.10,0.20,c(1.5,3),pedFormat=T) ## fit the log-linear model logLinear(out$peddata[,7:8],300,out$peddata[,1:6]) } \keyword{genetics}