! Bivariate Genetic Factor Model
! Arithmetic Computation after Alcohol Administration in Australian female twins

G1: model parameters
Data Calc NGroups=3
Begin Matrices;
X Full 4 2 Free     ! genetic common factor
Y Full 4 1 Fixed    ! shared environmental common factor
Z Full 4 1 Free     ! specific environmental common factor
F Diag 4 4 Free     ! specific environmental specifics
End Matrices;
Specify X
1 0
2 5                 ! 5: second genetic common factor
3 5
4 5
Begin Algebra;
A= X*X' ;
C= Y*Y' ;
E= Z*Z'+ F*F' ;
End Algebra;
End

G2: female MZ twin pairs
Data NInput_vars=8 NObservations=43
Labels Tw1-T0 Tw1-T1 Tw1-T2 Tw1-T3 Tw2-T0 Tw2-T1 Tw2-T2 Tw2-T3
CMatrix File=ozarimz.cov
Matrices= Group 1
Covariances A+C+E | A+C _
            A+C   | A+C+E /
Option RSidual
End 

G3: female DZ twin pairs
Data NInput_vars=8 NObservations=44
Labels Tw1-T0 Tw1-T1 Tw1-T2 Tw1-T3 Tw2-T0 Tw2-T1 Tw2-T2 Tw2-T3
Cmatrix File=ozaridz.cov
Matrices= Group 1
H Full 1 1
Covariances A+C+E   | H@A+C _
            H@A+C   | A+C+E /
Matrix H .5
Start .5 All
Option RSidual
Options Iterations=500 NDecimals=4
End

