Univariate Analysis in Mx Boulder 2004 Group Structure
Univariate Analysis in Mx Boulder, 2004
Group Structure Title n Type: Data/ Calculation/ Constraint n n n Reading Data Matrices Declaration n Assigning Specifications/ Values Matrix Algebra and/or n Means/ Covariances n n n Options End
Additional Commands ! Comments n #NGroups <number of groups> n #define <name> <number> n e. g. #define nvar 1 #define <$name> <string> n #include filename n
Reading Data NInputvars=<n> [NObs=<n>] n Rectangular File= n Missing= n Labels n Select if n n n Select if zyg =1; Select Summarized in filename. dat
Matrices Declaration n Begin Matrices; <Name> <type> <rows> <columns> n… n n End Matrices; Matrix Types: Mx manual p. 56 n Begin Matrices = Group <number> n
Matrix Algebra n Begin Algebra; <matrix name> = <matrix formula>; n… n n End Algebra; Matrix Operations: Mx Manual p. 59 n Matrix Functions: Mx Manual p. 64 n
Means/Covariances n Means <formula>; e. g. Means M; dimensions of expected matrix must equal dimensions of observed means n Covariances <formula>; dimensions of expected covariance matrix must equal the square of the number of variables
Mx Script I #NGroups 2 #define nvar 1 #define nsib 2 G 1: male MZ twin pairs Data NInput_vars=5 Missing=-1. 00 Rectangular File=Agg 10. rec Labels ZYG RB 10 A AGG 10 A RB 10 B AGG 10 B Select if zyg =1 ; ! select MZM twins Select AGG 10 A AGG 10 B ; May be put in agg 10. dat and included with #Include filename
Mx Script II Begin Matrices; X Symm nsib Free I Iden nsib M Full nvar nsib Free End Matrices; Start 2 X 1 1 X 2 2 Start 0. 5 M 1 1 M 1 2 Begin Algebra; O= sqrt(I. X)~&X; End Algebra; Means M; Covariances X; ! Interval @95 O 2 1 Option RSiduals End ! covariances ! means ! starting values for variances ! starting values for means ! MZM correlation ! model for MZM means ! model for MZM (co)variances
Mx Script III Begin Matrices; Y Symm nsib Free I Iden nsib N Full nvar nsib Free End Matrices; Start 2 Y 1 1 X 2 2 Start 0. 5 N 1 1 N 1 2 Begin Algebra; P= sqrt(I. Y)~&Y; End Algebra; Means N; Covariances Y; ! Interval @95 P 2 1 Option RSiduals End ! covariances ! means ! starting values for variances ! starting values for means ! DZM correlation ! model for DZM means ! model for DZM (co)variances
Mx Script IV ! equate means Equate M 1 1 1 M 1 1 2 N 2 1 1 N 2 1 2 End ! equate means and variances Equate X 1 1 1 X 1 2 2 Y 2 1 1 Y 2 2 2 End
Path Diagram for MZ and DZ twins 1. 00 / 0. 50 1. 00 / 0. 25 1. 00 1. 00 A 1 C 1 E 1 D 1 A 2 C 2 E 2 D 2 a c P 1 e d a c P 2 e d
MZ Twins Observed Covariance Expected Covariance Variance Twin 1 Covariance Variance Twin 2 a 2+c 2+e 2+d 2 a 2+c 2+e 2+d 2
DZ Twins Observed Covariance Expected Covariance Variance Twin 1 Covariance Variance Twin 2 a 2+c 2+e 2+d 2 . 5 a 2+c 2+. 25 d 2 a 2+c 2+e 2+d 2
Univariate Mx Script I #NGroups 3 #define nvar 1 #define nsib 2 Title G 1: Model Parameters Calculation Begin Matrices; X Lower nvar Free Y Lower nvar Free Z Lower nvar Free W Lower nvar Free H Full 1 1 Q Full 1 1 End Matrices; ! define nvar as number of variables ! ! ! additive genetic structure common environmental structure unique environmental path struct. dominance structure scalar fixed @. 5 for DZ cov of A scalar fixed @. 25 for DZ cov of D
Declared Matrices 1. 00 / 0. 50 [H] 1. 00 / 0. 25 [Q] 1. 00 1. 00 A 1 C 1 E 1 D 1 A 2 C 2 E 2 D 2 a [X] c [Y] e [Z] d [W] P 1 a [X] c [Y] e [Z] d [W] P 2
Univariate Mx Script II Matrix H. 5 Matrix Q. 25 Start. 5 all Begin Algebra; A= X*X' ; C= Y*Y' ; E= Z*Z' ; D= W*W’; V= A+C+E+D; P= A|C|E|D; S= P@V~; End Algebra; Interval @95 S 1 1 – S 1 3 End ! starting values for free parameters ! ! ! ! additive genetic variance common environmental variance unique environmental variance dominance variance total variance put parameters in one matrix standardized variance components ! confidence intervals
Univariate Mx Script III G 2: male MZ twins, datagroup Data NInput_vars=5 Missing=-1. 00 Rectangular File= Agg 10. rec Labels ZYG RB 10 A AGG 10 A RB 10 B AGG 10 B Select if zyg =1; ! select MZM twins Select AGG 10 A AGG 10 B ; Begin Matrices = Group 1; M Full nsib nvar Free ! means End Matrices; Start 0. 5 M 1 1 M 1 2 ! starting values for means M; ! model for means Covariances ! model for MZ variance/covariances A+C+E+D | A+C+D _ A+C +D | A+C+E+D ; Options RSiduals End
Univariate Mx Script IV G 3: male DZ twins, datagroup Data NInput_vars= Missing=-1. 00 Rectangular File= Agg 10. rec Labels ZYG RB 10 A AGG 10 A RB 10 B AGG 10 B Select if zyg =2; ! select DZM twins Select AGG 10 A AGG 10 B ; Begin Matrices = Group 1; M Full nsib nvar Free ! means End Matrices; Start 0. 5 M 1 1 M 1 2 ! starting values for means M; ! model for means Covariances ! model for DZ variance/covariances A+C+E+D | H@A+C+Q@D _ H@A+C+Q@D | A+C+E+D ; Option RSiduals End
Path Diagram to Matrices Path Coefficient a c e d Matrix Name X Y Z W Variance Component c 2 e 2 d 2 C E D a 2 Matrix Name A
Mx Script V Save satm. mxs ! equate means Equate M 1 1 1 M 1 1 2 N 2 1 1 N 2 1 2 End ! equate means and variances Equate X 1 1 1 X 1 2 2 Y 2 1 1 Y 2 2 2 End Get satm. mxs ! equate variances only Equate X 1 1 1 X 1 2 2 Y 2 1 1 Y 2 2 2 End
- Slides: 21