G1: Model parameters
 Data Calc NGroups=4
 Begin Matrices;
  X Lower 1 1 Free
  Y Lower 1 1 Free
  Z Lower 1 1 Free
  W Lower 1 1 
 End Matrices;
 ! parameters are fixed by default, unless declared free
 Begin Algebra;
  A= X*X'; 
  C= Y*Y';
  E= Z*Z';
  D= W*W';
 End Algebra:
End

G2: young female MZ twin pairs
 Data Ninput=2 
 CTable 2 2  
  -1 83
  95 83
 Begin Matrices= Group 1
  T full 2 1
 End Matrices;
 Matrix T .4814 .4814
 Covariances A+C+D+E | A+C+D _
             A+C+D   | A+C+D+E ;
 Thresholds T ;
 Options RSidual
End 

G3: young female DZ twin pairs
 Data Ninput=2
 CTable 2 2  
  -1 94 
  82 63

 Begin Matrices= Group 1
  H Full 1 1
  Q Full 1 1
  T Full 2 1 =T2
 End Matrices;
 Matrix H .5
 Matrix Q .25
 Start .6 All

 Covariances A+C+D+E   | H@A+C+Q@D _
             H@A+C+Q@D | A+C+D+E /
 Thresholds T ;
 Options RSidual NDecimals=4
End

Group 4: constrain variance to 1
 Constraint NI=1
 Begin Matrices = Group 1 ;
  I unit 1 1
 End Matrices;

 Constraint I = A+C+E+D ;
 Option Multiple
End
