! This is example script for k=3 trait test #DEFINE total 6 ! define the variable "total" #NGROUPS 3 G1: PARAMETER ESTIMATES ! parameter specification CALCULATION BEGIN MATRICES; A FULL 1 1 FREE ! A is free parameter whith dimension 1 by 1 B FULL 1 1 FREE C FULL 1 1 FREE X FULL total total FIXED ! X is 6 by 6 matrix with fixed values assigned in the following lines END MATRICES; ! (This is submatrix of inverted Fisher information matrixthat correspond to six parameter of interests Value 7.710474640438282 X 1 1 ! Assign the value to each element of X from the calculated submatrix of inverted Fisher information Value 7.709260663212016 X 2 2 Value 7.711691774397430 X 3 3 Value 4.663702915655440 X 4 4 Value 4.620667030846704 X 5 5 Value 4.679200672505286 X 6 6 Value 1.617538218457437 X 1 2 X 2 1 Value 1.530250893440179 X 1 3 X 3 1 Value 3.546715188981548 X 1 4 X 4 1 Value -3.449854515258192 X 1 5 X 5 1 Value -1.573289443908528 X 1 6 X 6 1 Value 1.647925282478313 X 2 3 X 3 2 Value 3.546421968829633 X 2 4 X 4 2 Value -1.632671504988344 X 2 5 X 5 2 Value -3.578418676335090 X 2 6 X 6 2 Value 1.588011722661225 X 3 4 X 4 3 Value -3.450140420881972 X 3 5 X 5 3 Value -3.579009967331238 X 3 6 X 6 3 Value -2.576001700429044 X 4 5 X 5 4 Value -2.541120409739163 X 4 6 X 6 4 Value 2.567510428234816 X 5 6 X 6 5 BEGIN ALGEBRA; ! Then specify the constraints among the parameters of intersts (theta1, theta2,..., theta6) H=A*A; ! This is theta 1 I=B*B; ! This is theta 2 J=C*C; ! This is theta 3 M=A*B; ! This is theta 4 N=A*C; ! This is theta 5 Q=B*C; ! This is theta 6 END ALGEBRA; END G2: MLE DATA NINPUT=6 NOBSERBATIONS=1 ! Read the data file "myData2.dat", which has one observation Z, which has 6 columns and one row. RECTANGULAR FILE=myData2.dat LABELS X1 X2 X3 X4 X5 X6 BEGIN MATRICES = GROUP 1; MEANS H_I_J_M_N_Q; ! this form mean parameters of Z COVARIANCES X; ! X is covariance of Z, but since we fixed the values in X, it will not estimate the covariance. START 1 ALL; ! Starting values for all parameters OPTION NDECIMALS=9 ! decimal places !DROP 1 2 3 ! Use this script twice both for the full model and the null model. When you estimate the null model remove "!" END ! sign at the beginig of this line, then it will drop parameter A, B, C. If you estimate the full model, keep "!" sign ! then it won't drop any parameters and thus estimate the full model G3: GET FUNCTION ! This is to get the maximum likelihood function value CALCULATION BEGIN MATRICES; Z FULL 1 1 = %F2 END MATRICES; END ! to run this scirpt in unix, use the command "mx < myscript.mx > output.FULL.mxo" (output.FULL.mxo can be any output file name) ! Note you also need input data file, "myData2.dat" to run this script