! Analysis of IHD data from diagnostic index
! add unknown zygosity pairs and estimate additive coefficient
! which will not be .50 and .25
Group 1 Compute squared terms
DAta CAlc NGroups=4
Matrices
W lower 1 1 free
X lower 1 1 free
Y lower 1 1 free
Z lower 1 1 
Begin Algebra;
A = W*W';
C = X*X';
E = Y*Y';
D = Z*Z';
End algebra;
End group;

Group 2  MZ data
DAta NInputs=2
CTable 2 2
-1 19
19 31
Matrices = Group 1
R FU 2 1 FR !new matrix for threshold pararmeters
End Matrices

Covariance
  (A+D+C+E | A+D+C_
   A+D+C   | A+D+C+E)
/
Thresholds R /
Start .6 all
Specify R
5 5
Drop @2.4066 R 1 1
Option RS
END

Group 3 DZ PAIRS
DAta NInputs=2
Ctable 2 2
-1 41
41 14
Matrices = Group 2
q di 1 1 ! .25
h di 1 1 ! .5
MO
  (A+D+C+E | h*A+q*D+C_
   h*A+q*D+C   | A+D+C+E)
/
TH R /
MAT h 0.5
MAT q 0.25
OPTIONS RS
END

Group 4: Constraint group to ensure A+D+C+E=1
DAta COnstraint NI=1
MAT
A lower 1 1 =a1
D lower 1 1 =d1
C lower 1 1 =c1
E lower 1 1 =e1
I ID 1 1
Constraint I = A + D + C + E /
END

