! SCRIPT NAME : Psychometric.mx (mb) ! GOAL : ACE model with sex limitation for a trait rated by mother and father of the subject. ! Using mother and father ratings to disentangle rater bias and rater specific view. ! DATA : continuous ! INPUT : raw data ! UNI/BI/MULTI : univariate ! DATA-GROUPS : MZM, DZM, MZF, DZF, DOSm-f ! MEANS MODEL : means ! VARIANCE COVARIANCE MODEL(S) : 1. ACE including rater bias and residuals ! Downloading Mx software: http://www.vcu.edu/mx ! Mx script's library: http://www.psy.vu.nl/mxbib ! ! A practical application of this script can be found in: ! 1. van der Valk, J. et al. (2001). J Child Psychol and Psychiat, 42(7), 921-931. ! 2. Bartels, M. et al. (2003). Behav Genet, 33(5); 607-621. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #ngroups 9 ! number of groups #define nvar 1 ! number of variables (phenotypes) under study #define nrater 2 ! number of raters (e.g. mother and father) #define nratnsib 4 ! number of rater * number of sibs (in this case twinpairs) G1: boys Data Calc Begin Matrices; X Lower nvar nvar Free ! genetic structure for behavior similar assessed by both parents Y Lower nvar nvar Free ! shared environmental structure for behavior similar assessed by both parents Z Lower nvar nvar Free ! nonshared environmental structure for behavior similar assessed by both parents K Diag nrater nrater Free ! unique part: genetic structure/ rater unique view O Diag nrater nrater Free ! unique part: rater bias / rate specific shared environment M Diag nrater nrater Free ! unique part: residuals (rater specific unique enironment/ measurement error) N Unit nrater nvar Fixed ! number of raters (mother & father) R full nratnsib nvar Free ! means I Ident nrater nrater H Full 1 1 Fixed End Matrices; Matrix H .5 ! Matrix H is fixed and contains .5 Matrix X .9 Matrix Y .1 Matrix Z .4 Matrix K .5 0 .2 Matrix O .3 0 .5 Matrix M .3 0 .3 Start 1 R 1 1 - R 4 1 Begin Algebra; A= X*X' ; ! additive genetic variance of behavior similar assessed by both parents C= Y*Y' ; ! shared environmental variance of behavior similar assesed by both parents E= Z*Z' ; ! nonshared environmental variance of behavior similar assessed by both parents G= K*K' ; ! additive genetic variance for behavior uniquelly assessed by a rater (rater unique view) S= O*O' ; ! shared environmental variance for behavior uniquelly assessed by a rater (rater bias) F= M*M' ; ! nonshared environmental variance for behavior uniquelly assessed by a rater (measurement error) L= I@N ; ! loadings of psychometric factor (=behavior similar assesed by both parents) on parental rating End Algebra; End G1: Girls Data Calc Begin Matrices; X Lower nvar nvar Free ! genetic structure for behavior similar assessed by both parents Y Lower nvar nvar Free ! shared environmental structure for behavior similar assessed by both parents Z Lower nvar nvar Free ! nonshared environmental structure for behavior similar assessed by both parents K Diag nrater nrater Free ! unique part: genetic structure/ rater unique view O Diag nrater nrater Free ! unique part: rater bias / rate specific shared environment M Diag nrater nrater Free ! unique part: residuals (rater specific unique enironment/ measurement error) N Unit nrater 1 Fixed ! number of raters (mother & father) R full nratnsib nvar Free ! means I Ident nrater nrater H Full 1 1 Fixed End Matrices; Matrix H .5 ! Matrix H is fixed and contains .5 Matrix X .9 Matrix Y .1 Matrix Z .4 Matrix K .5 0 .2 Matrix O .3 0 .5 Matrix M .3 0 .3 Start 1 R 1 1 - R 4 1 Begin Algebra; A= X*X' ; ! additive genetic variance of behavior similar assessed by both parents C= Y*Y' ; ! shared environmental variance of behavior similar assesed by both parents E= Z*Z' ; ! nonshared environmental variance of behavior similar assessed by both parents G= K*K' ; ! additive genetic variance for behavior uniquelly assessed by a rater (rater unique view) S= O*O' ; ! shared environmental variance for behavior uniquelly assessed by a rater (rater bias) F= M*M' ; ! nonshared environmental variance for behavior uniquelly assessed by a rater (measurement error) L= I@N ; ! loadings of psychometric factor (=behavior similar assesed by both parents) on parental rating End Algebra; End G3: male MZ twin pairs Data NInput_vars=29 ! number of variables in data file Missing=-1.00 ! missing value = -1.00 Rectangular File=TAD.dat ! read in raw data file LABELS NTRID SEXA SEXB ZYG COHORT TDELM7A TAGGM7A TDELV7A TAGGV7A TDELM7B TAGGM7B TDELV7B TAGGV7B TDELM10A TAGGM10A TDELV10A TAGGV10A TDELM10B TAGGM10B TDELV10B TAGGV10B TDELM12A TAGGM12A TDELV12A TAGGV12A TDELM12B TAGGM12B TDELV12B TAGGV12B ! Tell mx what is found in the datafile Select if ZYG = 1; ! select MZM twins Select TAGGM10A TAGGV10A TAGGM10B TAGGV10B ; ! select a phenotype (rated by mother and rated by father) Matrices= Group 1 Means R ; ! model for the means Covariances (G+S+F| G+S_ G+S | G+S+F) + L*(A+C+E | A+C_ A+C | A+C+E )*L' ; ! model for MZ variance/covariance Option RSidual End G4: male DZ twin pairs Data NInput_vars=29 ! number of variables in data file Missing=-1.00 ! missing value = -1.00 Rectangular File=TAD.dat ! read in raw data file LABELS NTRID SEXA SEXB ZYG COHORT TDELM7A TAGGM7A TDELV7A TAGGV7A TDELM7B TAGGM7B TDELV7B TAGGV7B TDELM10A TAGGM10A TDELV10A TAGGV10A TDELM10B TAGGM10B TDELV10B TAGGV10B TDELM12A TAGGM12A TDELV12A TAGGV12A TDELM12B TAGGM12B TDELV12B TAGGV12B ! Tell mx what is found in the datafile Select if ZYG = 2; ! select DZM twins Select TAGGM10A TAGGV10A TAGGM10B TAGGV10B ; ! select a phenotype (rated by mother and rated by father) Matrices= Group 1 Means R ; ! model for the means Covariances (G+S+F| H@G+S_ H@G+S | G+S+F) + L*(A+C+E | H@A+C_ H@A+C | A+C+E )*L' ; ! model for DZ variance/covariance Option RSidual End G5: female MZ twin pairs Data NInput_vars=29 ! number of variables in data file Missing=-1.00 ! missing value = -1.00 Rectangular File=TAD.dat ! read in raw data file LABELS NTRID SEXA SEXB ZYG COHORT TDELM7A TAGGM7A TDELV7A TAGGV7A TDELM7B TAGGM7B TDELV7B TAGGV7B TDELM10A TAGGM10A TDELV10A TAGGV10A TDELM10B TAGGM10B TDELV10B TAGGV10B TDELM12A TAGGM12A TDELV12A TAGGV12A TDELM12B TAGGM12B TDELV12B TAGGV12B ! Tell mx what is found in the datafile Select if ZYG = 3; ! select MZF twins Select TAGGM10A TAGGV10A TAGGM10B TAGGV10B ; ! select a phenotype (rated by mother and rated by father) Matrices= Group 2 Means R ; ! model for the means Covariances (G+S+F| G+S_ G+S | G+S+F) + L*(A+C+E | A+C_ A+C | A+C+E )*L' ; ! model for MZ variance/covariance Option RSidual End G6: female DZ twin pairs Data NInput_vars=29 ! number of variables in data file Missing=-1.00 ! missing value = -1.00 Rectangular File=TAD.dat ! read in raw data file LABELS NTRID SEXA SEXB ZYG COHORT TDELM7A TAGGM7A TDELV7A TAGGV7A TDELM7B TAGGM7B TDELV7B TAGGV7B TDELM10A TAGGM10A TDELV10A TAGGV10A TDELM10B TAGGM10B TDELV10B TAGGV10B TDELM12A TAGGM12A TDELV12A TAGGV12A TDELM12B TAGGM12B TDELV12B TAGGV12B ! Tell mx what is found in the datafile Select if ZYG = 4; ! select DZM twins Select TAGGM10A TAGGV10A TAGGM10B TAGGV10B ; ! select a phenotype (rated by mother and rated by father) Matrices= Group 2 Means R ; ! model for the means Covariances (G+S+F| H@G+S_ H@G+S | G+S+F) + L*(A+C+E | H@A+C_ H@A+C | A+C+E )*L' ; ! model for DZ variance/covariance Option RSidual End G7: Male-Female DZ twin pairs Data NInput_vars=29 ! number of variables in data file Missing=-1.00 ! missing value = -1.00 Rectangular File=TAD.dat ! read in raw data file LABELS NTRID SEXA SEXB ZYG COHORT TDELM7A TAGGM7A TDELV7A TAGGV7A TDELM7B TAGGM7B TDELV7B TAGGV7B TDELM10A TAGGM10A TDELV10A TAGGV10A TDELM10B TAGGM10B TDELV10B TAGGV10B TDELM12A TAGGM12A TDELV12A TAGGV12A TDELM12B TAGGM12B TDELV12B TAGGV12B ! Tell mx what is found in the datafile Select if ZYG = 5; ! select DOSMF twins Select TAGGM10A TAGGV10A TAGGM10B TAGGV10B ; ! select a phenotype (rated by mother and rated by father) MATRICES X Lower nvar nvar =X1 ! genetic structure boys Y Lower nvar nvar =Y1 ! common environmental structure boys Z Lower nvar nvar =Z1 ! specific environmental structure boys K Diag nrater nrater =K1 ! unique part: genetic structure boys O Diag nrater nrater =O1 ! unique part: common environmental structure boys M Diag nrater nrater =M1 ! unique part: specific environmental structure boys A Lower nvar nvar =X2 ! genetic structure girls C Lower nvar nvar =Y2 ! common environmental structure girls E Lower nvar nvar =Z2 ! specific environmental structure girls G Diag nrater nrater =K2 ! unique part: genetic structure girls S Diag nrater nrater =O2 ! unique part: common environmental structure girls F Diag nrater nrater =M2 ! unique part: specific environmental structure girls L Computed nratnsib nrater = L1 H Full 1 1 = H5 R full nratnsib nvar free ! means End Matrices Means R ; Covariances ((K*K')+(O*O')+(M*M') |H@(K*G')+(O*S')_ H@(G*K')+(S*O')| (G*G')+(S*S')+(F*F')) + L*((X*X')+(Y*Y')+(Z*Z') |H@(X*A')+(Y*C')_ H@(A*X')+(C*Y') | (A*A') + (C*C') + (E*E'))*L' ; ! model for DOSm-f variance/covariance Option RSidual End Gr 8: calculate standardized estimates for BOYS data calculation Matrices A Comp nvar nvar =A1 C Comp nvar nvar =C1 E Comp nvar nvar =E1 G Comp nrater nrater =G1 S Comp nrater nrater =S1 F Comp nrater nrater =F1 I IDENT nrater nrater End matrices Begin Algebra; X= A%(A+C+E) ; Y= C%(A+C+E) ; Z= E%(A+C+E) ; T= (I@(A+C+E))%((I@(A+C+E))+G+S+F); J= (I@A)%((I@(A+C+E))+G+S+F) ; K= (I@C)%((I@(A+C+E))+G+S+F) ; L= (I@E)%((I@(A+C+E))+G+S+F) ; M= G%((I@(A+C+E))+G+S+F) ; N= S%((I@(A+C+E))+G+S+F) ; O= F%((I@(A+C+E))+G+S+F) ; End Algebra; Option ND=4 End Gr 9: calculate standardized estimates for GIRLS data calculation Matrices A Comp nvar nvar =A2 C Comp nvar nvar =C2 E Comp nvar nvar =E2 G Comp nrater nrater =G2 S Comp nrater nrater =S2 F Comp nrater nrater =F2 I IDENT nrater nrater End matrices Begin Algebra; X= A%(A+C+E) ; Y= C%(A+C+E) ; Z= E%(A+C+E) ; T= (I@(A+C+E))%((I@(A+C+E))+G+S+F); J= (I@A)%((I@(A+C+E))+G+S+F) ; K= (I@C)%((I@(A+C+E))+G+S+F) ; L= (I@E)%((I@(A+C+E))+G+S+F) ; M= G%((I@(A+C+E))+G+S+F) ; N= S%((I@(A+C+E))+G+S+F) ; O= F%((I@(A+C+E))+G+S+F) ; End Algebra; Option ND=4 End