Analysis of Australian BMI data-young female MZ twins pairs-MX DIY version ! DA NG=1 NI=2 NO=0 begin matrices; A LO 1 1 FR ! Additive genetic variance C LO 1 1 FR ! Shared environmental variance E LO 1 1 FR ! Non-shared environmental variance M FU 2 2 ! This will be observed MZ covariance matrix D FU 2 2 ! This will be observed DZ covariance matrix g fu 1 1 ! coefficient of 0.5 for DZ pairs n fu 1 1 ! sample size for MZ pairs (female in this illustration) k fu 1 1 ! sample size for DZ pairs (female in this illustration) p fu 1 1 ! order of matrices (i.e. number of variables =2 in this case) end matrices; mat g 0.5 mat p 2 mat m 0.7247 0.5891 0.5891 0.7915 mat n 532 mat d 0.7786 0.2461 0.2461 0.8365 mat k 326 mat a 0.25 mat c 0.25 mat e 0.25 BEGIN ALGEBRA; t=n+k; ! total sample size U=(A+C+E | A+C _ A+C | A+C+E); ! Expected MZ covariance matrix V=(A+C+E | g*A+C _ g*A+C | A+C+E); ! Expected DZ covariance matrix H=n*(\ln (\det(U))-\ln (\det(M)) + \tr((U~ *M))-p); ! fit-function for MZ group J=k*(\ln (\det(V))-\ln (\det(D)) + \tr((V~ *D))-p); ! fit-function for DZ group F=h+j; END ALGEBRA; bo 0.01 1.0 e(1,1) bo 0.0 1.0 c(1,1) a(1,1) CO F ; option user df=6 end