! SCRIPT NAME : ordVCut2c.mx (cvb) ! GOAL : univariate Mx script for the analysis of one categorical phenotype ! DATA : ordinal ! INPUT : raw data ! UNI/BI/MULTI : uni ! DATA-GROUPS : MZ DZ ! MEANS MODEL : assuming no differences in prevalences across twin1, twin2, males, females and MZ, DZ ! VARIANCE COVARIANCE MODEL(S) : 1. ACE 2. AE 3. CE 4. E ! ! Downloading Mx software: http://www.vcu.edu/mx ! Mx script's library: http://www.psy.vu.nl/mxbib #define nvar 1 ! one phenotype per subject #define nthres 5 ! number of thresholds G1: calculation group Data Calc NGroups=4 Begin matrices; X Lower nvar nvar Free ! additive genetic path coefficient (standard deviation) Y Lower nvar nvar Free ! common environmental path coefficient (standard deviation) Z Lower nvar nvar Free ! unique environmental path coefficient (standard deviation) H Full 1 1 fix ! .5 for dz cov A B Full nthres 1 free ! first threshold + difference of any next threshold with previous J Lower nthres nthres fixed ! will be used to make sure that thresholds are all in ascending order End matrices; Matrix H .5 ! Matrix H is fixed and contains .5 Value 1 J 1 1 - J nthres nthres ! lower matrix is filled with 1's Begin algebra; A= X*X' ; ! additive genetic variance C= Y*Y' ; ! common environmental variance E= Z*Z' ; ! unique environmental variance W = J*B ; ! thresholds: formula makes sure that thresholds are in ascending order V = A%(A+C+E) | C%(A+C+E) | E%(A+C+E) ; ! standardized variance components End algebra; Labels Column V1 add_gen com_env uni_env Labels Column W1 threshold1 threshold2 threshold3 threshold4 threshold5 threshold6 st 0.6 X 1 1 1 ! provide starting values st 0.6 Y 1 1 1 ! total variance is 1 (standardized, see constraints group) st 0.6 Z 1 1 1 ! for 3 sources of variance, starting values are: square root of 1/3 st 0.1 B 1 1 1 - B 1 nthres 1 ! every next threshold is 0.1 z-value larger (steps can be increased, make sure last value does not exceed 5!) st 0.1 B 1 1 1 ! first threshold, can be derived from prevalences (can be negative too, not lower than -5 (see boundary) !boundary statements: Bound -1 5 B 1 1 1 - B 1 nthres 1 ! every next threshold is less than 5 z-values from former Bound -1 5 B 1 1 1 ! first threshold is within 5 z-values from mean end G2: MZ twins, datagroup Data NInput_vars= 5 ! nr of inputvars per family Missing=-99 ! missing values = -9 make sure this is EXACTLY the same as in datafile (string)! ORdinal_data file=C:\Users\Jenny\Desktop\DE Alc paper Mx\ordinalCBalc2.dat ! read in raw ordinal datafile, must be in same directory LABELS ! tell Mx what is found in the datafile zyg CBa CBb ALCa ALCb Select if zyg = 1; ! select MZM's ! Select if zygot < 4; ! 2 commands to ! Select if zygot ^= 2; ! select all MZ's Select CBa CBb ; Matrices = group 1 Threshold W | W ; Covariances ! model for MZM variance/covariances A+C+E | A+C _ A+C | A+C+E ; Options RSiduals End G3: DZ twins, datagroup Data NInput_vars= 5 Missing=-99 ORdinal_data file=C:\Users\Jenny\Desktop\DE Alc paper Mx\ordinalCBalc2.dat LABELS zyg CBa CBb ALCa ALCb Select if zyg = 2; ! select DZM's ! Select if zygot > 1; ! 2 commands to ! Select if zygot ^= 3; ! select all DZ's Select CBa CBb ; Matrices = group 1 Threshold W | W ; Covariances ! model for DZM variance/covariances A+C+E | H@A+C _ H@A+C | A+C+E ; !Interval @95 V 1 1 1 - V 1 1 3 W 1 1 1 - W nthres 1 Options RSiduals End G4: constraint group Constraint Begin Matrices = Group 1; I Unit nvar 1 End Matrices; Constraint (A+C+E)=I; Option Multiple Option Issat ! allows comparison of submodels with present model (ADE KLM) End save tmp.mxs ! AE model drop Y 1 1 1 end !get tmp.mxs ! CE model !drop X 1 1 1 !end ! E model !drop Y 1 1 1 !end