! K1. Social Homogamy Model 
! Rose Fear Data

Group 1: Mother-Father Covariance
!  cdc'
Data Calculation NGroups=8
Matrices
D Full 1 1 free    ! assortative mating paths
C Low  1 1 free    ! common environment paths
Compute C*D*C' /
End

Group 2: Mother-Child covariance
!  (Rpcm'+Rpcdf')c' + a.5a'
Data Calculation 
 Matrices
D Full 1 1 =D1     ! assortative mating paths
A Low  1 1 free    ! additive genetic paths
C Low  1 1 =C1     ! common environment paths
F Full 1 1 free    ! paternal cultural transmission
H Full 1 1         ! scalar, .5
M Full 1 1 free    ! maternal cultural transmission
Compute  (C*M' + C*D*F')*C' + A*H*A' /
Matrix H 0.5
End

Group 3: Father-Child Covariance
!  (Rpcf'+Rpcdm')c' + a.5a'
                                                      Data Calculation
Matrices
A Low  1 1 =A2     ! additive genetic paths
C Low  1 1 =C1     ! common environment paths
D Full 1 1 =D1     ! assortative mating delta paths 
F Full 1 1 =F2     ! paternal cultural transmission
H Full 1 1 =H2     ! scalar .5
M Full 1 1 =M2     ! maternal cultural transmission
Compute  (C*F' + C*D*M')*C' + A*H*A' /
Option No_output
End

Group 4:  MZ Twin Covariance
!  aRaa' + cRcc'
Data Calculation
Matrices
A Low  1 1 =A2     ! additive genetic paths
C Low  1 1 =C1     ! common environment paths
G Symm 1 1         ! additive genetic covariance (Ra)
R Symm 1 1 free    ! common environment covariance (Rc)
Compute  A*G*A' + C*R*C' /
Matrix G .5
End

Group 5:  DZ Twin Covariance
!  .5aRaa' + cRcc' 
Data Calculation
Matrices
A Low  1 1 =A2     ! additive genetic paths
C Low  1 1 =C1     ! common environment paths
G Symm 1 1 =G4     ! additive genetic covariance (Ra)
H Full 1 1 =H2     ! scalar, .5
R Symm 1 1 =R4     ! common environment covariance (Rc)
Compute  H@A*G*A' + C*R*C' /
End

Group 6: Phenotypic Variance 
!  Rp = aRaa + cRcc' + ee'
Data Calculation
Matrices
A Low  1 1 =A2     ! additive genetic paths
C Low  1 1 =C1     ! common environment paths
G Symm 1 1 =G4     ! additive genetic covariance (Ra)
J Low  1 1 free    ! specific environment paths
R Symm 1 1 =R4     ! common environment covariance
Constraint A*G*A' + C*R*C' + J*J' /
Start .3 All
Bound 0 1 D 1 1 1
Option Rsidual
End

Group 7 - MZ Twins and parents  
DA NInput=4 NObservations=144
Labels
MZ1 MZ2 Mother Father 
CMatrix
0.95 
0.54 0.89 
0.08 0.21 1.11 
0.28 0.18 0.11 0.90 
Select Father Mother MZ1 MZ2
Matrices
A Full 1 1 =%E2    ! Mother-child covariances
B Full 1 1 =%E3    ! Father-child covariances
C Full 1 1 =%E4    ! MZ twin covariances
D Full 1 1 =%E1    ! Spouse covariances
E Symm 1 1 =%E6    ! Within person covariances
Covariance ( E | D'| B | B )_
           ( D | E | A | A )_
           ( B'| A'| E | C )_
           ( B'| A'| C'| E )   /
Option rs
End

Group 8 - DZ twins and parents  
Data NInput=4 NObservations=106
Labels
DZ1 DZ2 Mother Father 
CMatrix
1.21 
0.29 1.03 
0.23 0.16 0.91 
0.13 0.09 0.21 1.08 
Select Father Mother DZ1 DZ2
Matrices
A Full 1 1 =%E2    ! Mother-child covariances
B Full 1 1 =%E3    ! Father-child covariances
C Full 1 1 =%E5    ! DZ twin covariances
D Full 1 1 =%E1    ! Spouse covariances
E Symm 1 1 =%E6    ! Within person covariances
Covariance ( E | D'| B | B )_
           ( D | E | A | A )_
           ( B'| A'| E | C )_
           ( B'| A'| C'| E )   /
Option Rsidual IT=800
End
