Univariate Analysis in Mx - PowerPoint PPT Presentation

About This Presentation
Title:

Univariate Analysis in Mx

Description:

End Algebra; Matrix Operations: Mx Manual p. 59. Matrix Functions: Mx Manual p. 64 ... Start 0.5 M 1 1 M 1 2 ! starting values for means. Begin Algebra; ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 22
Provided by: herm50
Category:

less

Transcript and Presenter's Notes

Title: Univariate Analysis in Mx


1
Univariate Analysis in Mx
  • Boulder, 2004

2
Group Structure
  • Title
  • Type Data/ Calculation/ Constraint
  • Reading Data
  • Matrices Declaration
  • Assigning Specifications/ Values
  • Matrix Algebra and/or
  • Means/ Covariances
  • Options
  • End

3
Additional Commands
  • ! Comments
  • NGroups ltnumber of groupsgt
  • define ltnamegt ltnumbergt
  • e.g. define nvar 1
  • define ltnamegt ltstringgt
  • include filename

4
Reading Data
  • Data NInputvarsltngt NObsltngt
  • Rectangular File
  • Missing
  • Labels
  • Select if
  • Select if zyg 1
  • Select
  • Summarized in filename.dat

5
Matrices Declaration
  • Begin Matrices
  • ltNamegt lttypegt ltrowsgt ltcolumnsgt
  • End Matrices
  • Matrix Types Mx manual p. 56
  • Begin Matrices Group ltnumbergt

6
Matrix Algebra
  • Begin Algebra
  • ltmatrix namegt ltmatrix formulagt
  • ltmatrix namegt ltmatrix formulagt
  • End Algebra
  • Matrix Operations Mx Manual p. 59
  • Matrix Functions Mx Manual p. 64

7
Means/Covariances
  • Means ltformulagt
  • e.g. Means M
  • dimensions of expected matrix must equal
    dimensions of observed means
  • Covariances ltformulagt
  • dimensions of expected covariance matrix must
    equal the square of the number of variables

8
Mx Script I
  • NGroups 2
  • define nvar 1
  • define nsib 2
  • G1 male MZ twin pairs
  • Data NInput_vars5
  • Missing-1.00
  • Rectangular FileAgg10.rec
  • Labels ZYG RB10A AGG10A RB10B AGG10B
  • Select if zyg 1 ! select MZM twins
  • Select AGG10A AGG10B
  • May be put in agg10.dat and included with
    Include filename

9
Mx Script II
  • Begin Matrices
  • X Symm nsib nsib Free ! covariances
  • I Iden nsib nsib
  • M Full nvar nsib Free ! means
  • End Matrices
  • Start 2 X 1 1 X 2 2 ! starting values for
    variances
  • Start 0.5 M 1 1 M 1 2 ! starting values for
    means
  • Begin Algebra
  • O \sqrt(I.X)X ! MZM correlation
  • End Algebra
  • Means M ! model for MZM means
  • Covariances X ! model for MZM (co)variances
  • ! Interval _at_95 O 2 1
  • Option RSiduals
  • End

10
Mx Script III
  • Begin Matrices
  • Y Symm nsib nsib Free ! covariances
  • I Iden nsib nsib
  • N Full nvar nsib Free ! means
  • End Matrices
  • Start 2 Y 1 1 X 2 2 ! starting values for
    variances
  • Start 0.5 N 1 1 N 1 2 ! starting values for
    means
  • Begin Algebra
  • P \sqrt(I.Y)Y ! DZM correlation
  • End Algebra
  • Means N ! model for DZM means
  • Covariances Y ! model for DZM (co)variances
  • ! Interval _at_95 P 2 1
  • Option RSiduals
  • End

11
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

12
Path Diagram for MZ and DZ twins
1.00 / 0.50
1.00
1.00 / 0.25
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
A1
C1
E1
A2
C2
E2
D1
D2
a
c
e
a
c
e
d
d
P1
P2
13
MZ Twins
Observed Covariance Variance Twin 1 Covariance
Covariance Variance Twin 2
Expected Covariance a2c2e2d2 a2c2d2
a2c2d2 a2c2e2d2
14
DZ Twins
Observed Covariance Variance Twin 1 Covariance
Covariance Variance Twin 2
Expected Covariance a2c2e2d2 .5a2c2.25d2
.5a2c2.25d2 a2c2e2d2
15
Univariate Mx Script I
  • NGroups 3
  • define nvar 1 ! define nvar as
    number of variables
  • define nsib 2
  • Title G1 Model Parameters
  • Calculation
  • Begin Matrices
  • X Lower nvar nvar Free ! additive genetic
    structure
  • Y Lower nvar nvar Free ! common environmental
    structure
  • Z Lower nvar nvar Free ! unique environmental
    path struct.
  • W Lower nvar nvar Free ! dominance structure
  • H Full 1 1 ! scalar fixed _at_ .5 for DZ cov of
    A
  • Q Full 1 1 ! scalar fixed _at_ .25 for DZ cov of
    D
  • End Matrices

16
Declared Matrices
1.00 / 0.50 H
1.00
1.00 / 0.25 Q
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00
A1
C1
E1
A2
C2
E2
D1
D2
a X
c Y
e Z
a X
c Y
e Z
d W
d W
P1
P2
17
Univariate Mx Script II
  • Matrix H .5
  • Matrix Q .25
  • Start .5 all ! starting values for free
    parameters
  • Begin Algebra
  • A XX' ! additive genetic variance
  • C YY' ! common environmental variance
  • E ZZ' ! unique environmental variance
  • D WW ! dominance variance
  • V ACED ! total variance
  • P ACED ! put parameters in one matrix
  • S P_at_V ! standardized variance components
  • End Algebra
  • Interval _at_95 S 1 1 S 1 3 ! confidence
    intervals
  • End

18
Univariate Mx Script III
  • G2 male MZ twins, datagroup
  • Data NInput_vars5
  • Missing-1.00
  • Rectangular File Agg10.rec
  • Labels ZYG RB10A AGG10A RB10B AGG10B
  • Select if zyg 1 ! select MZM twins
  • Select AGG10A AGG10B
  • 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
  • Means M ! model for means
  • Covariances ! model for MZ variance/covariances
  • ACED ACD _
  • AC D ACED
  • Options RSiduals
  • End

19
Univariate Mx Script IV
  • G3 male DZ twins, datagroup
  • Data NInput_vars
  • Missing-1.00
  • Rectangular File Agg10.rec
  • Labels ZYG RB10A AGG10A RB10B AGG10B
  • Select if zyg 2 ! select DZM twins
  • Select AGG10A AGG10B
  • 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
  • Means M ! model for means
  • Covariances ! model for DZ variance/covariances
  • ACED H_at_ACQ_at_D _
  • H_at_ACQ_at_D ACED
  • Option RSiduals
  • End

20
Path Diagram to Matrices
Path Coefficient a c e d
Matrix Name X Y Z W
Variance Component a2 c2 e2 d2
Matrix Name A C E D
21
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
Write a Comment
User Comments (0)
About PowerShow.com