! Common Pathway Model
! Asthma, Hayfever, Dust allergy, Eczema in Australian female twins

G1: model parameters
Data Calc NGroups=3
Begin Matrices;
X Lower 1 1 Free    ! genetic factor on latent phenotype
Y Lower 1 1 Fixed   ! common env factor on latent phenotype
Z Lower 1 1 Free    ! specific env factor on latent phenotype
W Lower 1 1 Fixed   ! dominance factor on latent phenotype
B Diag 4 4 Free     ! genetic specifics
F Diag 4 4 Free     ! specific environmental specifics
S Full 4 1 Free     ! factor structure
I Iden 2 2
End Matrices;
Begin Algebra;
A= X*X' ;
C= Y*Y' ;
E= Z*Z' ;
D= W*W' ;
G= B*B';
J= F*F' ;
End Algebra;
End

G2: female MZ twin pairs
Data NInput_vars=8 NObservations=1232
Labels asthma1 hayfvr1 dustal1 eczema1 asthma2 hayfvr2 dustal2 eczema2
PMatrix File=ozastmz.cov
ACov File=ahdemzf.acv
Matrices= Group 1
Covariances  (G+J | G _
              G   | G+J) + (I@S*(A+C+D+E | A+C+D _
                                 A+C+D   | A+C+D+E)*(I@S)') /
End 

G3: female DZ twin pairs
Data NInput_vars=8 NObservations=751
Labels asthma1 hayfvr1 dustal1 eczema1 asthma2 hayfvr2 dustal2 eczema2
PMatrix File=ozastdz.cov
ACov File=ahdedzf.acv
Matrices= Group 1
H Full 1 1
Q Full 1 1
Covariances  (G+J | H@G _
              H@G | G+J)  +  (I@S*(A+C+D+E   | H@A+C+Q@D _
                                   H@A+C+Q@D | A+C+D+E  )*(I@S)')/
Matrix H .5 
Matrix Q .25
Start .3 All
Options Rsidual DFreedom=-12 NDecimals=4 Iterations=200
End

