(Re)introduction to Mx Sarah Medland. KiwiChinese Gooseberry.

Slides:



Advertisements
Similar presentations
Quantitative Methods Session 16 – Matrices Pranjoy Arup Das.
Advertisements

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.
Extended sibships Danielle Posthuma Kate Morley Files: \\danielle\ExtSibs.
Summarizing Data Nick Martin, Hermine Maes TC21 March 2008.
(Re)introduction to Mx. Starting at the beginning Data preparation Mx expects 1 line per case/family Almost limitless number of families and variables.
Introduction to Linkage
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.
Chapter 1 Systems of Linear Equations
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.
Section 8.1 – Systems of Linear Equations
HAWKES LEARNING SYSTEMS math courseware specialists Copyright © 2011 Hawkes Learning Systems. All rights reserved. Hawkes Learning Systems College Algebra.
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)
Power and Sample Size Boulder 2004 Benjamin Neale Shaun Purcell.
Class Opener:. Identifying Matrices Student Check:
Some Fortran programming tips ATM 562 Fall 2015 Fovell (see also PDF file on class page) 1.
The importance of the “Means Model” in Mx for modeling regression and association Dorret Boomsma, Nick Martin Boulder 2008.
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.
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.
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.
Heterogeneity HGEN619 class 2007.
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
Communication and Coding Theory Lab(CS491)
Sarah Medland faculty/sarah/2018/Tuesday
More on thresholds Sarah Medland.
Matrices.
Multiplying Matrices.
BOULDER WORKSHOP STATISTICS REVIEWED: LIKELIHOOD MODELS
Matrices.
Section 8.1 – Systems of Linear Equations
Multiplying Matrices.
Multiplying Matrices.
Multiplying Matrices.
Presentation transcript:

(Re)introduction to Mx Sarah Medland

KiwiChinese Gooseberry

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  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

Matrices: the building blocks  Many types

Short cuts  Anything after ! is read as a comment  Can predefine frequently used/changed parameters #define nvar2=2  Can read in another file within the script #include ozbmi2.dat  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 (in ozbmi2.dat)  3 rd line gives data location (in ozbmi2.dat) Rectangular file = continuous data Ordinal file = ordinal data (Mx will expect a thresholds model not a means model)  List the variables (in ozbmi2.dat)  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 (not from ozbmiyface.mx)

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

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 explodingdog.com