(Re)introduction to Mx Sarah Medland

Slides:



Advertisements
Similar presentations
Bivariate analysis HGEN619 class 2007.
Advertisements

Missing Data Analysis. Complete Data: n=100 Sample means of X and Y Sample variances and covariances of X Y
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.
(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/
Multivariate Analysis Hermine Maes TC19 March 2006 HGEN619 10/20/03.
Univariate Analysis Hermine Maes TC19 March 2006.
Mx Practical TC18, 2005 Dorret Boomsma, Nick Martin, Hermine H. Maes.
Basic Mathematics for Portfolio Management. Statistics Variables x, y, z Constants a, b Observations {x n, y n |n=1,…N} Mean.
Thresholds and ordinal data Sarah Medland – Boulder 2010.
Introduction to Multivariate Genetic Analysis Kate Morley and Frühling Rijsdijk 21st Twin and Family Methodology Workshop, March 2008.
Raw data analysis S. Purcell & M. C. Neale Twin Workshop, IBG Colorado, March 2002.
Karri Silventoinen University of Helsinki Osaka University.
Karri Silventoinen University of Helsinki Osaka University.
Some matrix stuff.
Using Matrices to Solve Systems of Equations Matrix Equations l We have solved systems using graphing, but now we learn how to do it using matrices.
Inverse Matrices and Systems
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:
The importance of the “Means Model” in Mx for modeling regression and association Dorret Boomsma, Nick Martin Boulder 2008.
Introduction to Matrices and Matrix Approach to Simple Linear Regression.
Univariate Analysis Hermine Maes TC21 March 2008.
SEM Basics 2 Byrne Chapter 2 Kline pg 7-15, 50-51, ,
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.
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.
QTL Mapping Using Mx Michael C Neale Virginia Institute for Psychiatric and Behavioral Genetics Virginia Commonwealth University.
March 7, 2012M. de Moor, Twin Workshop Boulder1 Copy files Go to Faculty\marleen\Boulder2012\Multivariate Copy all files to your own directory Go to Faculty\kees\Boulder2012\Multivariate.
Multivariate Genetic Analysis (Introduction) Frühling Rijsdijk Wednesday March 8, 2006.
Categorical Data HGEN
Extended Pedigrees HGEN619 class 2007.
Intro to Mx HGEN619 class 2005.
Multivariate Analysis
Ordinal Data Sarah Medland.
Univariate Twin Analysis
Introduction to OpenMx
Introduction to Multivariate Genetic Analysis
Re-introduction to openMx
Heterogeneity HGEN619 class 2007.
Univariate Analysis HGEN619 class 2006.
Path Analysis Danielle Dick Boulder 2008
Ordinal data, matrix algebra & factor analysis
More on thresholds Sarah Medland.
Matrices Definition: A matrix is a rectangular array of numbers or symbolic elements In many applications, the rows of a matrix will represent individuals.
Univariate modeling Sarah Medland.
Applying Determinants to solve Systems of Equations 2x2 & 3x3
Sarah Medland faculty/sarah/2018/Tuesday
More on thresholds Sarah Medland.
Lucía Colodro Conde Sarah Medland & Matt Keller
BOULDER WORKSHOP STATISTICS REVIEWED: LIKELIHOOD MODELS
Power Calculation Practical
Matrices.
Power Calculation Practical
Multivariate Genetic Analysis
Multivariate Genetic Analysis: Introduction
Presentation transcript:

(Re)introduction to Mx Sarah Medland

Starting at the beginning Data preparation Mx expects 1 line per case/family Almost limitless number of families and variables White space delimited No fixed column formats (unlike ped files) 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 Constraint 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 1 2 1 = 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 1st line is the title 2nd 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 1st line is the title 2nd specifies group type and number of variables (in ozbmi2.dat) 3rd 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)

Select all vs for twin1 then twin2 then sib1 ect Order is important! Select all vs for twin1 then twin2 then sib1 ect

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

Variance/covariance matrices 1 P-t1 E A C z y x P-t2 1/0.5 MZ t1 t2 t1 a2+c2+e2 a2+c2 t2 a2+c2 a2+c2+e2 Variance/covariance matrices DZ t1 a2+c2+e2 0.5a2+c2 t2 0.5a2+c2 a2+c2+e2

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 1 1 1 EQ A 1 1 1 B 1 1 1 Compare the fit of the two models

Variance/covariance matrices 1 P-t1 E A C z y x P-t2 1/0.5 MZ t1 t2 t1 a2+c2+e2 a2+c2 t2 a2+c2 a2+c2+e2 Variance/covariance matrices DZ t1 a2+c2+e2 0.5a2+c2 t2 0.5a2+c2 a2+c2+e2

What to report Summary statistics Standardized estimates Usually from a simplified ‘saturated’ model Standardized estimates Easier to conceptualise ie 40% of the phenotypic variance vs a genetic effect of 2.84 Can easily be returned to original scale if summary statistics are provided

What to report Path coefficients Very Important in multivariate analyses Gives a much clearer picture of the directionality of effects Variance components/proportion of variance explained Genetic correlations

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