!
! Rose Fear data:  Social phobia on twins and parents
!
! Twins and parents: Genetic and cultural transmission model.
!                    P--P assortment
!                    Reduced P-C genetic correlation is 
!                              commented out group 7
!
Group 1 - Assortative mating constraints
DAta CAlculation NGroups=10
MATrices
A FUll 1 3
D STandardized 3 3
M FUll 1 1
COmpute (A*D)'*M*(A*D) /
LAbels Column A
A C E
LAbels Row A
P
SPecification A
1 2 3
MAtrix A
.7 .5 .5
LAbels Row D
A C E
LAbels Col D
A C E
SPecification D
4
0 0
SPecification M
5
OUtput

Group 2 - construct the overall covariance matrix of parents' 
!         latent variables
DAta CAlculate
MATrices
D STan 3 3 = D1
E FUll 3 3 = %E1
COmpute
  (D|E
  _E|D) /
LAbels row E
Ah Ch Eh
LAbels col E
Aw Cw Ew
OUtput

Group 3 - precalculate parents model
DAta CAlculate
MATrices
P SYmmetric 6 6 = %E2
G FUll 4 6
R DIagonal 4 4
COmpute G*P*G' + R/
! For reduced genetic correlation between parent & child model 
! parts commented out with ! are needed
SPecification G
1 2 3 0 0 0
0 0 0 1 2 3
0 0 0 0 0 0 !99 0 0 0 0 0
0 0 0 0 0 0 !0 0 0 99 0 0
LAbels row G
PH PW AH' AW'
LAbels column G
AH CH EH AW CW EW
VAlue 1 G 3 1 G 4 4
! SPecification r
! 0 0 100 100
OUtput

Group 4 - precalculate middle of model
DAta CAlculate
MATrices
P SYmmetric 4 4 = %E3
F FUll 5 4
S SYmmetric 5 5
COmpute F*P*F'+S /
LAbels row F
PH PW AC1 AC2 CT
LAbels col F
PH PW AH' AW'
SPecification F
 0 0 0 0
 0 0 0 0
 0 0 0 0
 0 0 0 0
 6 7 0 0
VAlue 1 F 1 1 F 2 2
VAlue .5 F 3 3  F 3 4  F 4 3  F 4 4
LAbels row S
PH PW AC1 AC2 CT
LAbels col S
PH PW AC1 AC2 CT
SPecification S
0
0 0
0 0 8
0 0 0 8
0 0 0 0 9
STart .5 S 3 3   S 4 4
STart 1 s 5 5
OUtput

G5 - Constraints on genetic environmental variance and 
!    covariance in children
DAta COnstraint NInput=2
MATrices
D STandardized 3 3 = D1  
!Correlation matrix of AH CH EH
H FUll 5 5 = %E4         
!Correlation matrix of PH PW AC1 AC2 CE
Y IZero 2 3              
!Filter matrix to get corr matrix AH CH
Z ZIden 2 5              
!Filter matrix to get corr matrix AC2 CE
COnstraint Y*D*Y' - Z*H*Z' /
OUtput NOne

G6 - Fourth constraint for standardization
DAta COnstraint NInput_vars=1
MATrices
H FUll 5 5 = %E4
Z IZ 1 5
I IDentity 1 1
COnstraint I - Z*H*Z' /
OUtput NOne

Group 7 new constraint for genetic transmission parameter
! The commented out parts of this group are needed if reduced 
! genetic correlation between parent and child model is to be 
! fitted, and the covariance statement should be commented out
DAta CAlculation ni=1
! Change the above to DAta COnstraint ni=1 for Rg model
MATrices
A SYmm 1 1
B SYmm 1 1
I IDen 1 1
COnstraint a /
! Delete the above line for Rg model and uncomment 
! the next five lines:
!constraint (a*a+b)-i /
!SPecification a
!99
!SPecification b
!100
OUtput None

Group 8 - Rose fear data: MZ twins & their parents
DAta NInput=4 NObservations=144
LAbels
Husband Wife MZ_Twin1 MZ_Twin2
CMatrix
.903
.113 1.1053
.2547 .0864 .9467
.1602 .2052 .4938 .8947
MATrices
C FUll 5 5 = %E4
L FUll 4 5
V symm 4 4  !Matrix of standard deviations
E lower 4 4  !Matrix to add random environment for children
COvariance_Model V*(L*C*L'+E*E)*V'/
SPecification V
10
0 10
0 0 10
0 0 0 10
MAtrix V
1 
0 1
0 0  1 
0 0 0 1
LAbels row V
PH PW PT1 PT2
LAbels column V
PH PW PT1 PT2
LAbels row E
Dummy Dummy Et1 Et2
LAbels column E
Dummy Dummy Et1 Et2
SPecification E
0 
0 0 
0 0 3
0 0 0 3
BOundary 1 5 v 1 1 v 2 2 v 3 3 V 4 4
LAbels row L
Ph Pw Pmzt1 Pmzt2
LAbels column L
Ph Pw At1 At2 Ct
SPecification L
0 0 0 0 0
0 0 0 0 0
0 0 1 0 2
0 0 1 0 2
VAlue 1 L 1 1 L 2 2
Value 1 E 3 3 E 4 4 
OUtput RSiduals

Group 9 - Rose social criticism DZ  twins & their parents
DAta NInput_vars=4 NObservations=106
LAbels
Husband Wife DZ_Twin1 DZ_Twin2
CM
1.0811
.2111 .9063
.1443 .2398 1.2079
.1001 .1551 .3246 1.0318
MATrices
C FUll 5 5 = %E4
L FUll 4 5
V DIag 4 4 = V8
E lower 4 4 = E8
COvariances V*(L*C*L'+E*E)*V'/
SPecification L
0 0 0 0 0
0 0 0 0 0
0 0 1 0 2
0 0 0 1 2
VAlue 1 L 1 1 L 2 2
LAbels row E
Dummy Dummy Et1 Et2
LAbels column E
Dummy Dummy Et1 Et2
LAbels row L
Ph Pw Pdzt1 Pdzt2
LAbels column L
Ph Pw At1 At2 Ct
STart 1.5 v 1 1 v 2 2 v 3 3 V 4 4
BOundary .5 2 v 1 1 v 2 2 v 3 3 V 4 4
OUtput RSiduals IT=500

Group 10 - summary printout of parameter estimates
DAta CAlculation
MATrices
P FUll 1 10
COmpute P/
SPecification P
1 2 3 4 5 6 7 8 9 10
LAbels c p
a c e s mu zf zm res(a) res(c) vp
BOundary -.99 .99 4 5 6 7
BOundary 0 1 1 2 3 8 9
OUtput MUltiple
!
! Re-fit the model with Father-child and Mother-child 
!  cultural transmission set equal
!
EQuate f 4 5 1 f 4 5 2
End

