Learn R Programming

gap (version 1.1-16)

twinan90: Classic twin models

Description

Classic twin models

The function also allows for test for normality and Box-Cox transformation. It further allows for output data in FISHER format.

Usage

twinan90(mzdat,dzdat,vname='mzdz',xlamb=1,const=0,vmiss=-9,path=1,
           ped=0,nvar=1,form='((1x,a1,5x,F6.2))')

Arguments

mzdat
two columns of data for MZ twins
dzdat
two columns of data for DZ twins
vname
variable name
xlamb
the Box-Cox transformation parameter
const
constant to be added to each data value
vmiss
missing value indicator
path
path analysis to be conducted
ped
if 1, to output data in FISHER format
nvar
number of variables in the data file
form
the Fortran format for the data file

Value

  • The returned values is in a list with the following components, while the MLEs are in two system files (.log and .out):
  • h2The heritability estimate based on 2(rMZ-rDZ), where rMZ and rDZ are the intraclass correlation coefficients for MZ and DZ twin pairs
  • seh2The standard error for the above statistic
  • nMZThe number of MZ pairs used
  • nDZThe number of DZ pairs used
  • rMZThe intraclass correlation for MZ
  • rDZThe intraclass correlation for DZ
  • covMZThe variance-covariance matrix for MZ
  • covDZThe variance-covariance matrix for DZ
  • vname.logthe diagnostic file
  • vname.outthe output file

References

Williams CJ, Christian JC, Norton JA Jr. (1992) TWINAN90: A FORTRAN program for conducting ANOVA-based and likelihood-based analyses of twin data. Computer Methods and Programs in Biomedicine 38:(2-3):167-176

Williams CJ (1993). On the covariance between parameter estimates in models of twin data. Biometrics. 49(2):557-68

Examples

Run this code
filespec <- file.path(.path.package("gap"),"tests/twinan90/mzdz.dat")
mzdz <- matrix(scan(filespec,skip=1),ncol=2,byrow=T)
mzdat <- mzdz[1:131,]
dzdat <- mzdz[132:206,]
twinan90(mzdat,dzdat,xlamb=2)

# the normality test can be conducted as follows,
ks.test(mzdat,"pnorm")
ks.test(dzdat,"pnorm")
qqnorm(mzdat)
qqnorm(dzdat)
# contact e-mail for Prof Williams
# http://www.webpages.uidaho.edu/~chrisw/

Run the code above in your browser using DataLab