Welcome  Log on using the username and password you received at registration  Copy the folder: F:/sarah/mon-morning To your H drive.

Slides:



Advertisements
Similar presentations
Bivariate analysis HGEN619 class 2007.
Advertisements

Correlation and regression
The General Linear Model. The Simple Linear Model Linear Regression.
Latent Growth Curve Modeling In Mplus:
Multiple regression analysis
Section 4.2 Fitting Curves and Surfaces by Least Squares.
The Simple Linear Regression Model: Specification and Estimation
(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.
Copyright (c) Bani K. Mallick1 STAT 651 Lecture #18.
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/
Heterogeneity II Danielle Dick, Tim York, Marleen de Moor, Dorret Boomsma Boulder Twin Workshop March 2010.
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.
Multivariate Threshold Models Specification in Mx.
Practical statistics for Neuroscience miniprojects Steven Kiddle Slides & data :
Karri Silventoinen University of Helsinki Osaka University.
Overview of Meta-Analytic Data Analysis
Copy the folder… Faculty/Sarah/Tues_merlin to the C Drive C:/Tues_merlin.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
Multiple Regression The Basics. Multiple Regression (MR) Predicting one DV from a set of predictors, the DV should be interval/ratio or at least assumed.
Ordinal (yet again) Sarah Medland – Boulder 2010.
Regression. Population Covariance and Correlation.
Univariate modeling Sarah Medland. Starting at the beginning… Data preparation – The algebra style used in Mx expects 1 line per case/family – (Almost)
6-1 Introduction To Empirical Models Based on the scatter diagram, it is probably reasonable to assume that the mean of the random variable Y is.
Whole genome approaches to quantitative genetics Leuven 2008.
Research Seminars in IT in Education (MIT6003) Quantitative Educational Research Design 2 Dr Jacky Pow.
Power and Sample Size Boulder 2004 Benjamin Neale Shaun Purcell.
The importance of the “Means Model” in Mx for modeling regression and association Dorret Boomsma, Nick Martin Boulder 2008.
March 7, 2006Lecture 8aSlide #1 Matrix Algebra, or: Is this torture really necessary?! What for? –Permits compact, intuitive depiction of regression analysis.
Univariate Analysis Hermine Maes TC21 March 2008.
Linkage and association Sarah Medland. Genotypic similarity between relatives IBS Alleles shared Identical By State “look the same”, may have the same.
Special Topic: Matrix Algebra and the ANOVA Matrix properties Types of matrices Matrix operations Matrix algebra in Excel Regression using matrices ANOVA.
Topic 20: Single Factor Analysis of Variance. Outline Analysis of Variance –One set of treatments (i.e., single factor) Cell means model Factor effects.
Analysis of Experiments
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.
Outline of Today’s Discussion 1.Seeing the big picture in MR: Prediction 2.Starting SPSS on the Different Models: Stepwise versus Hierarchical 3.Interpreting.
Mx Practical TC20, 2007 Hermine H. Maes Nick Martin, Dorret Boomsma.
Continuous heterogeneity Danielle Dick & Sarah Medland Boulder Twin Workshop March 2006.
Frühling Rijsdijk & Kate Morley
Categorical Data Frühling Rijsdijk 1 & Caroline van Baal 2 1 IoP, London 2 Vrije Universiteit, A’dam Twin Workshop, Boulder Tuesday March 2, 2004.
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.
Categorical Data HGEN
BINARY LOGISTIC REGRESSION
Intro to Mx HGEN619 class 2005.
Ordinal Data Sarah Medland.
Univariate Twin Analysis
Re-introduction to openMx
Heterogeneity HGEN619 class 2007.
Univariate Analysis HGEN619 class 2006.
Ordinal data, matrix algebra & factor analysis
More on thresholds Sarah Medland.
Lab 2 Data Manipulation and Descriptive Stats in R
Univariate modeling Sarah Medland.
6-1 Introduction To Empirical Models
Heterogeneity Danielle Dick, Hermine Maes,
(Re)introduction to Mx Sarah Medland
Sarah Medland faculty/sarah/2018/Tuesday
More on thresholds Sarah Medland.
BOULDER WORKSHOP STATISTICS REVIEWED: LIKELIHOOD MODELS
Multivariate Genetic Analysis: Introduction
Presentation transcript:

Welcome  Log on using the username and password you received at registration  Copy the folder: F:/sarah/mon-morning To your H drive

Open Mx and increase memory  Go to preference Host options Back the backend memory larger

Intro to Mx Sarah Medland – Leuven 2008

This morning  Fitting a mean and regression with continuous data  Modelling Ordinal data  Fitting the regression model with ordinal data

Lets start with the data…  File: Wednesday.dat Contains 6 variables from the NLTR ntrid zygMZDZ age1 sekse1 AQ1 age2 sekse2 AQ2

Lets start with the data…

If this was a pedigree data file… FamidIndFatherMotherZygSexAge Trait xx xx 2312MZ MZ

How can we make this data file?  Assume we have data with 3 variables:

How do we make this data?  SPSS SORT CASES BY Family Individual. CASESTOVARS /ID = Family /INDEX = Individual /GROUPBY = VARIABLE.

Means…  In spss sas etc we calculate the mean  In Mx and other ML programs we estimate the mean

Spss…

Mx… Means.mx

Mx… Defining some frequently changed parameters

Mx… Adding comments !

Mx… Providing a title

Mx… Directly after the title tell Mx what kind of group it is Data Calculation Constraint

Mx… How many variables are in the data file

Mx… How many groups in the script

Mx… Missing code – default is a.

Mx… Provide the name of the data file Rectangular file = continuous Ordinal file =ordinal/binary

Mx… List of the variables

Mx… Tell Mx what to analyse

Mx… Tell Mx what matrices you want to use

Matrices: the building blocks  Many types

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

Mx… M & V matrices are both full 1 1 M=[?] V=[?]

Mx… Tell Mx what algebra you want to do S will contain the square root of the estimate of V

Mx… Provide some start values to aid estimation Default is.01

Mx… Tell Mx how which matrix contains the means and the variance/ covariance matrix

Mx… Each group needs an end statement

Output

 Spss assumes this is a sample  Mx assumes this is a population  Slightly different algebra

How about regression?  Y=X*B +C  Regression speak AutismQuotient = Sex*Beta1 + Age*Beta2 + Intercept  BG speak AutismQuotient = Sex Effect + Age Effect + Grand Mean

Spss…

regression.mx

Spss…

Run regression.mx

What does this mean?  Age Beta =.549 For every 1 unit increase in Age the mean shifts.549 Grand mean = Mean Age =18.2  So the mean for 20 year olds is predicted to be: = *.549

Sex effects?  Sex Beta =  Sex coded Male = 1 Female = 0  Female Mean: = *  Male Mean: = *-2.608

How do we get the p-values?

Set the elements to equal 0 regression.mx  Do this one at a time!

So…

Why bother with Mx?  Because most stat packages can’t handle non-independent data… Non-independence reduces the variance Biases t and F tests

Why bother with Mx?  Because we want complete flexibility in the model specification… As you see later today

Why bother with Mx?  Because very few packages can handle ordinal data adequately…

Working with non-independent data Correlation.mx

 Data from family members

Correlation.mx  Data from family members Defining the nsib as the number of siblings per family

Correlation.mx  Data from family members Selecting the AQ variable for sib 1 and sib 2

Correlation.mx  Data from family members The V matrix is now a symmetric 2 2 matrix Var1Cov CovVar2

Correlation.mx  Data from family members The S matrix will contain the standardised var/cov matrix (ie the correlation) 1r r1

Correlation.mx  Data from family members Some extra start values

Correlation.mx  Data from family members EQ V 1 1 V 2 2 sets the variances to be the same for the two siblings.

Correlation.mx  Data from family members We are also using the same mean for both siblings M|M = stack 2 M matrices side by side

Output – correlation.mxo Notice the small increase in variance when accounting for the non-independence

Re-conceptualising the correlation  The correlation is the standardised covariance – an index of the amount of variance shared between the 2 variables or 2 individuals  The variance of each variable is composed of that which is shared and that which is not V=S+N

Re-conceptualising the correlation  V=S+N  So another way to model the covariance would be S+N | S_ S | S+N ;

Re-conceptualising the correlation Alt_correlation.mx

Results  Correlation.mx  Alt_correlation.mx

Twin modelling takes this 1 step further  Covariance Var1 | Cov_ Cov | Var 2 ;  MZ A+C+E | A+C_ A+C | A+C+E ;  DZ A+C+E |.5*A+C_.5*A+C | A+C+E ;  A = Additive genetic variance  C = Common environment variance  E = unique Environmental variance (including measurement Error)

Working with ordinal data

Binary data  File: two_cat.dat  NI=5  Labels Zyg twin1 twin2 Age Sex  Trait – smoking initiation Never Smoked/Ever Smoked (Recoded from yesterday) Data is sorted to speed up the analysis

Twin 1 smoking initiation

Mean =.47 SD =.499 Non Smokers =53%

Raw data distribution Mean =.47 SD =.499 Non Smokers =53% Threshold=.53 Standard normal distribution Mean = 0 SD =1 Non Smokers =53% Threshold =.074

Threshold =.074 – Huh what?  How can I work this out Excell  =NORMSINV()

Why do we rescale the data this way?  Convenience Variance always 1 Mean is always 0 We can interpret the area under a curve between two z-values as a probability or percentage

Why do we rescale the data this way? You could use other distributions but you would have to specify the fit function

Threshold.mx

Threshold =.075 – Huh what?

How about age/sex correction? binary_regression.mx

How about age/sex correction?

What does this mean?  Age Beta =.007 For every 1 unit increase in Age the threshold shifts.007

What does this mean?  Beta =.007  Threshold is  38 is SD from the mean age The threshold for 38 year olds is:.1544= *38  22 is SD from the mean age The threshold for 38 year olds is:.0422= *22

22 year olds Threshold = year olds Threshold =.1544 Is the age effect significant?

How to interpret this  The threshold moved slightly to the right as age increases  This means younger people were more likely to have tried smoking than older people But this was not significant

How about the sex effect  Beta = -.05  Threshold =  Sex coded Male = 1, Female = 0  So the Male threshold is: = *-.05  The Female threshold is: = *-.05

Female Threshold = Male Threshold = Are males or females more likely to smoke?

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