(Re)introduction to Mx. Starting at the beginning Data preparation Mx expects 1 line per case/family Almost limitless number of families and variables.

Slides:



Advertisements
Similar presentations
Multivariate Twin Analysis
Advertisements

Quantitative Methods Session 16 – Matrices Pranjoy Arup Das.
4.1 Introduction to Matrices
Bivariate analysis HGEN619 class 2007.
Factor analysis Caroline van Baal March 3 rd 2004, Boulder.
(Re)introduction to OpenMx Sarah Medland. Starting at the beginning  Opening R Gui – double click Unix/Terminal – type R  Closing R Gui – click on the.
(Re)introduction to Mx Sarah Medland. KiwiChinese Gooseberry.
Multivariate Analysis Nick Martin, Hermine Maes TC21 March 2008 HGEN619 10/20/03.
Extended sibships Danielle Posthuma Kate Morley Files: \\danielle\ExtSibs.
Summarizing Data Nick Martin, Hermine Maes TC21 March 2008.
Univariate Analysis in Mx Boulder, Group Structure Title Type: Data/ Calculation/ Constraint Reading Data Matrices Declaration Assigning Specifications/
Univariate Analysis Hermine Maes TC19 March 2006.
Mx Practical TC18, 2005 Dorret Boomsma, Nick Martin, Hermine H. Maes.
Thresholds and ordinal data Sarah Medland – Boulder 2010.
Raw data analysis S. Purcell & M. C. Neale Twin Workshop, IBG Colorado, March 2002.
Arithmetic Operations on Matrices. 1. Definition of Matrix 2. Column, Row and Square Matrix 3. Addition and Subtraction of Matrices 4. Multiplying Row.
Algebra 2: Lesson 5 Using Matrices to Organize Data and Solve Problems.
Karri Silventoinen University of Helsinki Osaka University.
Hydroinformatics: Session4 Dr Ivan Stoianov Room 328B Dr Andrew Ireson (Room 304) Mr Juan Rodriguez-Sanchez (411A) Mr Baback.
Introduction to OpenMx Sarah Medland. What is OpenMx? Free, Open-source, full–featured SEM package Software which runs on Windows, Mac OSX, and Linux.
Univariate modeling Sarah Medland. Starting at the beginning… Data preparation – The algebra style used in Mx expects 1 line per case/family – (Almost)
Lesson 11-1 Matrix Basics and Augmented Matrices Objective: To learn to solve systems of linear equation using matrices.
Power and Sample Size Boulder 2004 Benjamin Neale Shaun Purcell.
Class Opener:. Identifying Matrices Student Check:
The importance of the “Means Model” in Mx for modeling regression and association Dorret Boomsma, Nick Martin Boulder 2008.
Combined Linkage and Association in Mx Hermine Maes Kate Morley Dorret Boomsma Nick Martin Meike Bartels Boulder 2009.
Prepared by Deluar Jahan Moloy Lecturer Northern University Bangladesh
Univariate Analysis Hermine Maes TC21 March 2008.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
Multiplying Matrices Algebra 2—Section 3.6. Recall: Scalar Multiplication - each element in a matrix is multiplied by a constant. Multiplying one matrix.
MATRICES MATRIX OPERATIONS. About Matrices  A matrix is a rectangular arrangement of numbers in rows and columns. Rows run horizontally and columns run.
Section 9-1 An Introduction to Matrices Objective: To perform scalar multiplication on a matrix. To solve matrices for variables. To solve problems using.
Algebra Matrix Operations. Definition Matrix-A rectangular arrangement of numbers in rows and columns Dimensions- number of rows then columns Entries-
Mx modeling of methylation data: twin correlations [means, SD, correlation] ACE / ADE latent factor model regression [sex and age] genetic association.
Means, Thresholds and Moderation Sarah Medland – Boulder 2008 Corrected Version Thanks to Hongyan Du for pointing out the error on the regression examples.
Mx Practical TC20, 2007 Hermine H. Maes Nick Martin, Dorret Boomsma.
Frühling Rijsdijk & Kate Morley
Welcome  Log on using the username and password you received at registration  Copy the folder: F:/sarah/mon-morning To your H drive.
Linkage in Mx & Merlin Meike Bartels Kate Morley Hermine Maes Based on Posthuma et al., Boulder & Egmond.
Copy folder (and subfolders) F:\sarah\linkage2. Linkage in Mx Sarah Medland.
More on thresholds Sarah Medland. A plug for OpenMx? Very few packages can handle ordinal data adequately… OpenMx can also be used for more than just.
Do Now: Perform the indicated operation. 1.). Algebra II Elements 11.1: Matrix Operations HW: HW: p.590 (16-36 even, 37, 44, 46)
QTL Mapping Using Mx Michael C Neale Virginia Institute for Psychiatric and Behavioral Genetics Virginia Commonwealth University.
Categorical Data HGEN
Intro to Mx HGEN619 class 2005.
Lesson 43: Working with Matrices: Multiplication
12-1 Organizing Data Using Matrices
Multiplying Matrices.
Ordinal Data Sarah Medland.
Introduction to OpenMx
Re-introduction to openMx
Matrix Operations Monday, August 06, 2018.
Matrices and Data Holt Algebra 2.
Univariate Analysis HGEN619 class 2006.
Multiplying Matrices Algebra 2—Section 3.6.
Ordinal data, matrix algebra & factor analysis
More on thresholds Sarah Medland.
Multiplying Matrices.
Univariate modeling Sarah Medland.
Introduction to Matrices
(Re)introduction to Mx Sarah Medland
Sarah Medland faculty/sarah/2018/Tuesday
More on thresholds Sarah Medland.
Multiplying Matrices.
Matrices and Data Holt Algebra 2.
BOULDER WORKSHOP STATISTICS REVIEWED: LIKELIHOOD MODELS
Matrices.
Multiplying Matrices.
Multiplying Matrices.
Multiplying Matrices.
Presentation transcript:

(Re)introduction to Mx

Starting at the beginning Data preparation Mx expects 1 line per case/family Almost limitless number of families and variables Space delimited is best Can use a missing code ie -9 or can use the default ‘.’

Important structural stuff (As I was going to St Ives …) Script is composed of one or more jobs (can handle many ‘nested’ jobs in one script or 2 non nested jobs) Each job is composed of one or more groups Each group is ‘opened’ with a title Each group is ‘closed’ with an end statement You must tell Mx how many groups will be in the job

A bit about groups 3 types of groups Calculation Data If analysing raw data Mx expects a Means Model and a Covariance Model Constraint

Matrices: the building blocks Many types Denoted by a single letter Elements defined by letter and 3 numbers A = A matrix group 1 row 2 column 1 All constants and estimated parameters must be placed in a matrix & Mx must be told what type of matrix it is Letters can be reused in subsequent groups

Short cuts Anything after ! is read as a comment Can predefine frequently used/changed parameters #define nvar=2 Can read in another file within the script #include starting_values.txt Can run loops – via the repeat comand Use an end of line signal (; or /) except in the Labels command

Setting up the script – calculation group 1 st line is the title 2 nd specifies group type Matrix definition Begin Matrices – End Matrices If a matrix is not specified free it will be considered fixed Algebra Begin Algebra – End Algebra Starting values for free/estimated parameters or specified values for constants End

Setting up the script – data group 1 st line is the title 2 nd specifies group type and number of variables 3 rd line gives data location Rectangular file = continuous data Ordinal file = ordinal data (Mx will expect a thresholds model not a means model) List the variables Select if … Select variables Order is important! Select all vs for twin1 then twin2 then sib1 ect Specify which vs are covariates (definition variables)

Setting up the script – data group Matrix definition Call matrices from previous groups and/or define new matrices Algebra & starting values Means Model can include covariates ie age, sex … Covariance Model Expected to be nsib*nvar by nsib*nvar End

1 P-t1 E A C C A E z yzyxx P-t2 1/0.5 MZ t1 t2 t1a 2 +c 2 +e 2 a 2 +c 2 t2 a 2 +c 2 a 2 +c 2 +e 2 Variance/covariance matrices DZ t1 t2 t1a 2 +c 2 +e 2 0.5a 2 +c 2 t2 0.5a 2 +c 2 a 2 +c 2 +e 2

So what do you get Mx starts by reading back the script

So what do you get Data summary

So what do you get Parameter specifications

So what do you get Estimates

So what do you get Warnings & Fit information

Testing for significance Drop the parameter(s) from the model or equate parameters using the multiple job option Specify the matrix elements you wish to drop/equate Drop A EQ A B Compare the fit of the two models

1 P-t1 E A C C A E z yzyxx P-t2 1/0.5 MZ t1 t2 t1a 2 +c 2 +e 2 a 2 +c 2 t2 a 2 +c 2 a 2 +c 2 +e 2 Variance/covariance matrices DZ t1 t2 t1a 2 +c 2 +e 2 0.5a 2 +c 2 t2 0.5a 2 +c 2 a 2 +c 2 +e 2

Exercise 1 Save the full ACE model save name.mxs Drop C Retrieve the full model get name.mxs Drop A Drop C Record standardised VC and fit function

Questions Can you drop A? Can you drop C? Can you drop E from a model? How would you test to see if the means were equal for twin1 and twin2? How would you test to see if there was a significant effect of sex on the means?

Exercise 2: Adding a constraint group What will this do?

1 P-t1 E A C C A E e cecaa P-t2 1/0.5 A C E eca P-s Exercise 2: Adding siblings

General Advice/Problem solving Scripting styles differ Check the parameter numbers Check the sample description Learn to love the manual Comments are your friends

Time for coffee