Mixed Effects Models

Size: px
Start display at page:

Download "Mixed Effects Models"

Transcription

1 Mixed Effects Models What is the effect of X on Y What is the effect of an independent variable on the dependent variable Independent variables are fixed factors. We want to measure their effect Random factors are variables who effect we don't want to measure, but we know it may be there. We want to eliminate it. Participants are random factors. Test items are random factors. Example of Participant affecting the outcome Research Question: What influences people to use or not use that in a sentence? Examples: I knew (that) he wouldn't show up. There are a lot of things (that) we don't know. Dependent Variable: that or no-that Independent Variables (fixed factors: Tense: past or present Sex: M, F Age 3-way: old, middle-aged, young Occupation: student, white collar, blue collar Random factor: participant Outcome without random effect of participant Tense (4.49e-32) Occ (5.97e-07) Age.3way (0.0044) Sex (0.132) Outcome with participant as random factor Tense (2.18e-31) Occ ( ) Age.3way (0.216) Sex (0.849)

2 Why does age become insignificant? Some participants were deleting that much more or less than others in their age group, which made it look like age was a factor, in reality, it was caused by a few individuals that were outliers. Repeated Measures Correlation, Chi square, independent t-test, ANOVA assume independence of (lack of correlation between) the measurements. This assumption would be violated if: 1 A single person is measured more than once Correlation of language proficiency and number of year in country. Same person's data added more than once influences outcome too much Measurements of one person's VOT to many different words taken 2 A single person belongs to more than one test group Three groups: highly fluent, intermediate, low One person is put into two different groups Linguistic data often uses repeated measurements 1 What is the effect of X on VOT? There are 10 participants, and measurements of their VOTs to many different words is taken (Participant is a random factor. We aren't interested in differences between participants) 2 What is the effect of pronunciation training on foreign accent Three groups: no pronunciation training, training X, training Y. 20 native speakers rate all members of each group on degree of accent (Rater is a random factor. We don't care about differences between raters) We aren't interested in differences in the random factor, but we must acknowledge they exist and account for them statistically, or the results are not valid!

3 Example: end up VERBing Research question: what is the effect of time on the use of end up VERBing? Dependent variable: # of end up VERBing per mission Independent variable: time Random factor: corpus (which is the subject here. It is measured several times) Time 0 is 1930s and Time 50 is 2000s (quadratic to make data linear) Regression line is best fit, predicted values Good fit if dots are close, bad if they are far away Difference between data points and regression line are residuals (What the model doesn't explain)

4 Let's pretend that there are no repeated measures only decade as a factor MODEL 1 (no compensation for repeated measures) Open end up VERBing. Analyze > Mixed Models > Linear > Continue. Put end up verbing in the dependent variable box and Decade square in the covariate box. Click on fixed and then on DecadeSq. Move it to the Model box by clicking on Add > Continue > OK Total number of parameter is 3 (from Model Dimension box) Type III Tests of Fixed Effects a Source Numerator df Denominator df F Intercept DecadeSq

5 Information Criteria a -2 Restricted Log Likelihood Akaike's Information Criterion (AIC) Hurvich and Tsai's Criterion (AICC) Bozdogan's Criterion (CAIC) Schwarz's Bayesian Criterion (BIC) Restricted log Likelihood Same as deviance in Rbrul Used to compare models Smaller is better Can use to perform log likelihood test BIC Used to compare models Smaller is better Cannot use to perform log likelihood test Formula: Calculate the -2LL of model X minus the -2LL of model Y. Look up the resulting difference in a Chi square chart by the difference in degrees of freedom between each model. -2LL degrees of freedom Model Model difference At df=1 the -2LL must be or greater to be significant at p <.05.

6

7 Notice that there is lots of correlation (lack of independence) between the corpora. Time is always higher than the rest, GoogleUK is always lower. Let's factor in subject (corpus) as a random effect by allowing each to have its own regression line. Now the residuals are measured from the data point to the individual corpus regression line. They are smaller. The individual regression lines differ in two aspects: Intercept: their average distance from the overall mean. Where they intersect with the Y axis at zero (too hard to see here). Slope: how the slant of the individual line varies from the overall regression line. Time has a steeper slope and GoogleUK has a less steep slope. There may be interaction between the intercept and the slope. Here lower intercepts are correlated with flatter slopes and higher intercepts are correlated with steeper slopes.

8 MODEL 2 (adding a random intercept) Results Analyze > Mixed Models > Linear. Move Corpus to Subjects box > Contine. Put end up verbing in the dependent variable box, Corpus in Factors box, and Decade square in the covariate box. Click on fixed and then on DecadeSq. Move it to the Model box by clicking on Add > Continue. Click on Random, then Corpus and Add to move it to the Combinations Box. Check Include Intercept. Change Covariance Type to Scaled Identity > Continue > OK. The model has a random intercept for each corpus. The regression line for each corpus is parallel to the overall regression line. Decade is still significant Information Criteria a -2 Restricted Log Likelihood Akaike's Information Criterion (AIC) Hurvich and Tsai's Criterion (AICC) Bozdogan's Criterion (CAIC) Schwarz's Bayesian Criterion (BIC) Chi square chart -2LL degrees of freedom Model Model difference At df=1 the -2LL must be or greater to be significant at p <.05. Model 2 is more complex, but has a better fit. Adding random intercepts improves fit.

9 In chart, the slope differs by corpus. Random slope may fit better

10 MODEL 3 (random slope) Analyze > Mixed Models > Linear. Move Corpus to Subjects box > Continue. Put end up verbing in the dependent variable box, Corpus in Factors box, and Decade square in the covariate box. Click on fixed and then on DecadeSq. Move it to the Model box by clicking on Add > Continue. Click on Random, then DecadeSq and Add to move it to the Model Box. Check Include Intercept. Click on Corpus and move to Combinations box with the arrow. Change Covariance Type to Scaled Identity > Continue > OK. Degrees of freedom (Parameters) = 4 Chi square chart -2LL degrees of freedom Model Model difference 62 0 At df=1(or 0) the -2LL must be or greater to be significant at p <.05. Model 3 is better fit. Decade is no longer significant! p =.052. It is the differences in corpora that cause the effect. Information Criteria a -2 Restricted Log Likelihood Akaike's Information Criterion (AIC) Hurvich and Tsai's Criterion (AICC) Bozdogan's Criterion (CAIC) Schwarz's Bayesian Criterion (BIC)

11 Practice Winter and Bergen (2012) contend that language comprehension does not uniquely involve language mechanisms but perceptual systems as well. The hypothesize that when processing a sentence that describes an object at a distance, that produces a mental image of the object that can affect the perception of a picture of that object. Their participants read sentences that described objects that were either near (e.g. While you're milking the cow it starts mooing) or far away (e.g. Across the field, the cow starts mooing). Afterwards, they were shown a picture and asked to respond yes if it matched the preceding sentence, or no if it did not. Of course, not all of the trials involved matches between sentences and picture. However, when there was a match there were actually two kinds of matching pictures: one showed the object close up and the other far away. The difference was in the size of the object in the picture. Large objects are perceived to be closer than small objects. When participants heard a sentence about a cow, they should answer yes to a picture of a cow regardless of whether the cow is depicted as being close or far away. However, the authors hypothesized that the participants would respond more quickly when the distance in the sentence matched the distance in the picture, and more slowly when there was a mismatch. This experiment involves repeated measures because each participant belongs to each of the four groups that were contrasted: far sentence, small object; far sentence, large object, close sentence, small object; close sentence, large object. In addition, each subject gave multiple responses in each of the four groups. Dependent variable: reaction time in seconds (RTinSeconds) Independent variable: Condition (far/big, far/small, near/big, near/small) Random factor: Subject Download these data. Model 1-Pretend there are no repeated measures. See if reaction time is influenced by condition. (Note: Condition in this case is a categorical variable. Put it in the factor box. Only numeric variables go in the covariate box) What are the results for condition? How many parameters (degrees of freedom)? What is the -2LL? What is the BIC?

12 What are the results for condition? not significant How many parameters (degrees of freedom)? 5 What is the -2LL? You can't use this model since it doesn't account for repeated measures What is the BIC? Model 2-Repeat the analysis, but this time give each subject a random intercept. See if reaction time is influenced by condition. (Note: Condition in this case is a categorical variable. Put it in the factor box. Only numeric variables go in the covariate box) What are the results for condition? How many parameters (degrees of freedom)? What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model.

13 What are the results for condition? not significant How many parameters (degrees of freedom)? 6 What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model. Model 3-Repeat the analysis, but this time give each subject a random slope. See if reaction time is influenced by condition. (Note: Condition in this case is a categorical variable. Put it in the factor box. Only numeric variables go in the covariate box) What are the results for condition? How many parameters (degrees of freedom)? What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model.

14 What are the results for condition? not significant How many parameters (degrees of freedom)? 6 What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model. No, it is worse Model 4-Repeat the analysis, but this time give each test item a random intercept. See if reaction time is influenced by condition. (Note: Condition in this case is a categorical variable. Put it in the factor box. Only numeric variables go in the covariate box) What are the results for condition? How many parameters (degrees of freedom)? What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model compared to Model 1.

15 What are the results for condition? not significant How many parameters (degrees of freedom)? 6 What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model compared to Model 1. Model Model Significantly smaller. Adding 1 df is justifiable.

16 Model 5-Repeat the analysis, but this time give each test item a random slope. See if reaction time is influenced by condition. (Note: Condition in this case is a categorical variable. Put it in the factor box. Only numeric variables go in the covariate box) What are the results for condition? How many parameters (degrees of freedom)? What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model compared to Model 4.

17 What are the results for condition? not significant How many parameters (degrees of freedom)? 6 What is the -2LL? What is the BIC? Use a log likelihood test to see if this is a better model compared to Model 4. Model Model (assume 1) No significant difference, BIC got bigger, so random slope doesn't help get a better fit.

18 Using the Syntax Editor Menus are confusing. You are not sure what you are doing. The syntax editor is easier to modify. Let's start by using the menus, then see what they give us as syntax. Analyze > Mixed Models > Linear. Move Subject to Subjects box > Continue. Put RtinSeconds in the dependent variable box and Condition and Subject in the Factors box. Click on Fixed and then on Condition. Move it to the Model box by clicking on Add > Continue. Click on Random, then Condition and Add to move it to the Model Box. Check Include Intercept. Click on Subject and move to Combinations box with the arrow. Change Covariance Type to Scaled Identity > Continue > Paste (This puts it into the syntax editor). Syntax The variables in our model are in green MIXED RTinSeconds BY Subject CONDITION /CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1) SINGULAR( ) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE( , ABSOLUTE) /FIXED=CONDITION SSTYPE(3) /METHOD=REML /RANDOM=INTERCEPT CONDITION SUBJECT(Subject) COVTYPE(ID). MIXED: run a mixed effects model RtinSeconds: dependent variable BY: specifies the categorical independent variables Subject CONDITION: the categorical independent variables (both fixed and random) WITH: specifies the numeric independent variables (there are none so there is no WITH here) /CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1) SINGULAR( ) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE( , ABSOLUTE): Directions to the computer on how to run the analysis. /FIXED: What the fixed effects are. CONDITION: the independent variable

19 SSTYPE(3): More directions to the computer. /METHOD=REML: More directions to the computer /RANDOM: What the random effects are INTERCEPT: calculate the intercept CONDITION SUBJECT(Subject): Calculate a random slope for each subject across each of the test conditions in CONDITION. COVTYPE(ID): Type of variance covariance matrix (Scaled identity). We'll talk about it. It is very important to put a period at the end of the syntax Random slope /RANDOM=INTERCEPT CONDITION SUBJECT(Subject) COVTYPE(ID). Random intercept /RANDOM=INTERCEPT SUBJECT(Subject) COVTYPE(ID). Running the syntax Highlight all of the syntax and press the green arrow. Look at the results in the Output window. Changing the syntax You can add and delete variables by deleting of typing them in the correct place. Practice 1 Change the syntax so that it runs a random intercept model 2 Change the syntax so that it runs a random intercept model with ITEM as the random factor instead of Subject. 3 We found that a random intercept for test item and a random intercept for subject produced a better model fit. Make a model that contains both random of these factors together. Compare the outcome to Models 2 and 4 above using a log likelihood test.

20 If each of these data points came from different people we wouldn't assume that there would be any correlation between any two points. We would measure the residuals to the overall predicted regression line.

21 When one person provides more than one data point, chances are that his/her responses to one item or at one point in time are correlated. To account for this we include a random factor. When this is done the residuals are measured to the individual's predicted response (the individual's regression line).

22 The repeated statement We can sometimes fit a model even better by providing information about how the residuals are structured. A covariance structure contains two kinds of data. First, it specifies information about any correlations that exist between repeated measurements. Second, it indicates what the variance of those measurements is like across time, or across experimental condition. Two graphs above, the variance goes up over time and the covariance get larger from one decade to the next. (Covariance is unstandardized correlation. It isn't +1 to -1, but given in the units of measurement.) 1930s 1940s 1950s 1960s 1970s 1980s 1990s 2000s 1930s s s s s s s s The covariance of a covariance is the variance and appears in bold along the diagonal. If we did a correlation they would all be 1. ARH1 Heterogenous first-order autoregressive This means the variance changes over time (or conditions), and the covariance does also. It assumes that the covariance between two adjacent decades is more similar that between more distant ones.

23 CS Compound symmetry The variance is about the same across time (or condition) and the covariance is about the same. 1930s 1940s 1950s 1960s 1970s 1980s 1990s 2000s 1930s s s s s s s s 1654

24

25 ID Scaled Identity The variance is the same across time (or conditions) and there is no covariance.

26

27 Common covariance structures. Covariance Structure Variance across repeated measures Covariance across repeated measures Acronym Compound Symmetry Constant Constant CS Heterogenous Compound Symmetry Different Constant CSH Unstructured Different Different UN Autoregressive Constant Closer measurements are more correlated than distant ones. Heterogenous Autoregressive Different Covariance grow smaller with each successive measurement. Toeplitz Constant Adjacent measurements have same covariance, but covariance is smaller for nonadjacent measurements. Identity Constant None ID AR1 ARH1 Diagonal Different None DIAG TP Other covariance structures: TPH, CSR, AD1, FA1, FAH1, HF, UNR Which one do you use? The one that fits best.

28 Practice 1 Open these data. 2 Open the syntax editor and paste in the code below. File > New > Syntax. MIXED Score WITH Decade /CRITERIA=CIN(95) MXITER(100) MXSTEP(10) SCORING(1) SINGULAR( ) HCONVERGE(0, ABSOLUTE) LCONVERGE(0, ABSOLUTE) PCONVERGE( , ABSOLUTE) /FIXED=Decade SSTYPE(3) /METHOD=REML /RANDOM=INTERCEPT Decade SUBJECT(Subject) COVTYPE(ID). This is a random slope model. 3 Run this model and note the number of parameters, the -2LL, and the BIC. 4 Modify the syntax to run a random intercept model. Determine which is a better fit. 5 Add the random statement to the end and be sure to delete unnecessary periods. Run this model. /REPEATED=Decade SUBJECT(Subject) COVTYPE(DIAG). 6 Try the model with different covariance structures to see which give the best fit.

Step 2: Select Analyze, Mixed Models, and Linear.

Step 2: Select Analyze, Mixed Models, and Linear. Example 1a. 20 employees were given a mood questionnaire on Monday, Wednesday and again on Friday. The data will be first be analyzed using a Covariance Pattern model. Step 1: Copy Example1.sav data file

More information

over Time line for the means). Specifically, & covariances) just a fixed variance instead. PROC MIXED: to 1000 is default) list models with TYPE=VC */

over Time line for the means). Specifically, & covariances) just a fixed variance instead. PROC MIXED: to 1000 is default) list models with TYPE=VC */ CLP 944 Example 4 page 1 Within-Personn Fluctuation in Symptom Severity over Time These data come from a study of weekly fluctuation in psoriasis severity. There was no intervention and no real reason

More information

Biostatistics 301A. Repeated measurement analysis (mixed models)

Biostatistics 301A. Repeated measurement analysis (mixed models) B a s i c S t a t i s t i c s F o r D o c t o r s Singapore Med J 2004 Vol 45(10) : 456 CME Article Biostatistics 301A. Repeated measurement analysis (mixed models) Y H Chan Faculty of Medicine National

More information

Describing Within-Person Fluctuation over Time using Alternative Covariance Structures

Describing Within-Person Fluctuation over Time using Alternative Covariance Structures Describing Within-Person Fluctuation over Time using Alternative Covariance Structures Today s Class: The Big Picture ACS models using the R matrix only Introducing the G, Z, and V matrices ACS models

More information

Introduction to Within-Person Analysis and RM ANOVA

Introduction to Within-Person Analysis and RM ANOVA Introduction to Within-Person Analysis and RM ANOVA Today s Class: From between-person to within-person ANOVAs for longitudinal data Variance model comparisons using 2 LL CLP 944: Lecture 3 1 The Two Sides

More information

Daniel J. Bauer & Patrick J. Curran

Daniel J. Bauer & Patrick J. Curran GET FILE='C:\Users\dan\Dropbox\SRA\antisocial.sav'. >Warning # 5281. Command name: GET FILE >SPSS Statistics is running in Unicode encoding mode. This file is encoded in >a locale-specific (code page)

More information

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data Ronald Heck Class Notes: Week 8 1 Class Notes: Week 8 Probit versus Logit Link Functions and Count Data This week we ll take up a couple of issues. The first is working with a probit link function. While

More information

An Introduction to Path Analysis

An Introduction to Path Analysis An Introduction to Path Analysis PRE 905: Multivariate Analysis Lecture 10: April 15, 2014 PRE 905: Lecture 10 Path Analysis Today s Lecture Path analysis starting with multivariate regression then arriving

More information

An Introduction to Mplus and Path Analysis

An Introduction to Mplus and Path Analysis An Introduction to Mplus and Path Analysis PSYC 943: Fundamentals of Multivariate Modeling Lecture 10: October 30, 2013 PSYC 943: Lecture 10 Today s Lecture Path analysis starting with multivariate regression

More information

Review of CLDP 944: Multilevel Models for Longitudinal Data

Review of CLDP 944: Multilevel Models for Longitudinal Data Review of CLDP 944: Multilevel Models for Longitudinal Data Topics: Review of general MLM concepts and terminology Model comparisons and significance testing Fixed and random effects of time Significance

More information

SAS Syntax and Output for Data Manipulation:

SAS Syntax and Output for Data Manipulation: CLP 944 Example 5 page 1 Practice with Fixed and Random Effects of Time in Modeling Within-Person Change The models for this example come from Hoffman (2015) chapter 5. We will be examining the extent

More information

Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study

Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study Subject-specific observed profiles of log(fev1) vs age First 50 subjects in Six Cities Study 1.4 0.0-6 7 8 9 10 11 12 13 14 15 16 17 18 19 age Model 1: A simple broken stick model with knot at 14 fit with

More information

Additional Notes: Investigating a Random Slope. When we have fixed level-1 predictors at level 2 we show them like this:

Additional Notes: Investigating a Random Slope. When we have fixed level-1 predictors at level 2 we show them like this: Ron Heck, Summer 01 Seminars 1 Multilevel Regression Models and Their Applications Seminar Additional Notes: Investigating a Random Slope We can begin with Model 3 and add a Random slope parameter. If

More information

Supplemental Materials. In the main text, we recommend graphing physiological values for individual dyad

Supplemental Materials. In the main text, we recommend graphing physiological values for individual dyad 1 Supplemental Materials Graphing Values for Individual Dyad Members over Time In the main text, we recommend graphing physiological values for individual dyad members over time to aid in the decision

More information

MLMED. User Guide. Nicholas J. Rockwood The Ohio State University Beta Version May, 2017

MLMED. User Guide. Nicholas J. Rockwood The Ohio State University Beta Version May, 2017 MLMED User Guide Nicholas J. Rockwood The Ohio State University rockwood.19@osu.edu Beta Version May, 2017 MLmed is a computational macro for SPSS that simplifies the fitting of multilevel mediation and

More information

36-309/749 Experimental Design for Behavioral and Social Sciences. Dec 1, 2015 Lecture 11: Mixed Models (HLMs)

36-309/749 Experimental Design for Behavioral and Social Sciences. Dec 1, 2015 Lecture 11: Mixed Models (HLMs) 36-309/749 Experimental Design for Behavioral and Social Sciences Dec 1, 2015 Lecture 11: Mixed Models (HLMs) Independent Errors Assumption An error is the deviation of an individual observed outcome (DV)

More information

Model Estimation Example

Model Estimation Example Ronald H. Heck 1 EDEP 606: Multivariate Methods (S2013) April 7, 2013 Model Estimation Example As we have moved through the course this semester, we have encountered the concept of model estimation. Discussions

More information

Longitudinal Data Analysis of Health Outcomes

Longitudinal Data Analysis of Health Outcomes Longitudinal Data Analysis of Health Outcomes Longitudinal Data Analysis Workshop Running Example: Days 2 and 3 University of Georgia: Institute for Interdisciplinary Research in Education and Human Development

More information

Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED. Maribeth Johnson Medical College of Georgia Augusta, GA

Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED. Maribeth Johnson Medical College of Georgia Augusta, GA Analysis of Longitudinal Data: Comparison Between PROC GLM and PROC MIXED Maribeth Johnson Medical College of Georgia Augusta, GA Overview Introduction to longitudinal data Describe the data for examples

More information

Module 8: Linear Regression. The Applied Research Center

Module 8: Linear Regression. The Applied Research Center Module 8: Linear Regression The Applied Research Center Module 8 Overview } Purpose of Linear Regression } Scatter Diagrams } Regression Equation } Regression Results } Example Purpose } To predict scores

More information

MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010

MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010 MIXED MODELS FOR REPEATED (LONGITUDINAL) DATA PART 2 DAVID C. HOWELL 4/1/2010 Part 1 of this document can be found at http://www.uvm.edu/~dhowell/methods/supplements/mixed Models for Repeated Measures1.pdf

More information

Mathematical Notation Math Introduction to Applied Statistics

Mathematical Notation Math Introduction to Applied Statistics Mathematical Notation Math 113 - Introduction to Applied Statistics Name : Use Word or WordPerfect to recreate the following documents. Each article is worth 10 points and should be emailed to the instructor

More information

EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7

EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7 Introduction to Generalized Univariate Models: Models for Binary Outcomes EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7 EPSY 905: Intro to Generalized In This Lecture A short review

More information

Chapter 1 Statistical Inference

Chapter 1 Statistical Inference Chapter 1 Statistical Inference causal inference To infer causality, you need a randomized experiment (or a huge observational study and lots of outside information). inference to populations Generalizations

More information

LAB 3 INSTRUCTIONS SIMPLE LINEAR REGRESSION

LAB 3 INSTRUCTIONS SIMPLE LINEAR REGRESSION LAB 3 INSTRUCTIONS SIMPLE LINEAR REGRESSION In this lab you will first learn how to display the relationship between two quantitative variables with a scatterplot and also how to measure the strength of

More information

SAS Code for Data Manipulation: SPSS Code for Data Manipulation: STATA Code for Data Manipulation: Psyc 945 Example 1 page 1

SAS Code for Data Manipulation: SPSS Code for Data Manipulation: STATA Code for Data Manipulation: Psyc 945 Example 1 page 1 Psyc 945 Example page Example : Unconditional Models for Change in Number Match 3 Response Time (complete data, syntax, and output available for SAS, SPSS, and STATA electronically) These data come from

More information

Longitudinal Invariance CFA (using MLR) Example in Mplus v. 7.4 (N = 151; 6 items over 3 occasions)

Longitudinal Invariance CFA (using MLR) Example in Mplus v. 7.4 (N = 151; 6 items over 3 occasions) Longitudinal Invariance CFA (using MLR) Example in Mplus v. 7.4 (N = 151; 6 items over 3 occasions) CLP 948 Example 7b page 1 These data measuring a latent trait of social functioning were collected at

More information

An Introduction to Multilevel Models. PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012

An Introduction to Multilevel Models. PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012 An Introduction to Multilevel Models PSYC 943 (930): Fundamentals of Multivariate Modeling Lecture 25: December 7, 2012 Today s Class Concepts in Longitudinal Modeling Between-Person vs. +Within-Person

More information

Multiple Group CFA Invariance Example (data from Brown Chapter 7) using MLR Mplus 7.4: Major Depression Criteria across Men and Women (n = 345 each)

Multiple Group CFA Invariance Example (data from Brown Chapter 7) using MLR Mplus 7.4: Major Depression Criteria across Men and Women (n = 345 each) Multiple Group CFA Invariance Example (data from Brown Chapter 7) using MLR Mplus 7.4: Major Depression Criteria across Men and Women (n = 345 each) 9 items rated by clinicians on a scale of 0 to 8 (0

More information

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS. Duration - 3 hours. Aids Allowed: Calculator

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS. Duration - 3 hours. Aids Allowed: Calculator UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS Duration - 3 hours Aids Allowed: Calculator LAST NAME: FIRST NAME: STUDENT NUMBER: There are 27 pages

More information

ANOVA Longitudinal Models for the Practice Effects Data: via GLM

ANOVA Longitudinal Models for the Practice Effects Data: via GLM Psyc 943 Lecture 25 page 1 ANOVA Longitudinal Models for the Practice Effects Data: via GLM Model 1. Saturated Means Model for Session, E-only Variances Model (BP) Variances Model: NO correlation, EQUAL

More information

Designing Multilevel Models Using SPSS 11.5 Mixed Model. John Painter, Ph.D.

Designing Multilevel Models Using SPSS 11.5 Mixed Model. John Painter, Ph.D. Designing Multilevel Models Using SPSS 11.5 Mixed Model John Painter, Ph.D. Jordan Institute for Families School of Social Work University of North Carolina at Chapel Hill 1 Creating Multilevel Models

More information

Review of Unconditional Multilevel Models for Longitudinal Data

Review of Unconditional Multilevel Models for Longitudinal Data Review of Unconditional Multilevel Models for Longitudinal Data Topics: Course (and MLM) overview Concepts in longitudinal multilevel modeling Model comparisons and significance testing Describing within-person

More information

Contingency Tables. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels.

Contingency Tables. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels. Contingency Tables Definition & Examples. Contingency tables are used when we want to looking at two (or more) factors. Each factor might have two more or levels. (Using more than two factors gets complicated,

More information

Advanced Quantitative Data Analysis

Advanced Quantitative Data Analysis Chapter 24 Advanced Quantitative Data Analysis Daniel Muijs Doing Regression Analysis in SPSS When we want to do regression analysis in SPSS, we have to go through the following steps: 1 As usual, we choose

More information

STA 303 H1S / 1002 HS Winter 2011 Test March 7, ab 1cde 2abcde 2fghij 3

STA 303 H1S / 1002 HS Winter 2011 Test March 7, ab 1cde 2abcde 2fghij 3 STA 303 H1S / 1002 HS Winter 2011 Test March 7, 2011 LAST NAME: FIRST NAME: STUDENT NUMBER: ENROLLED IN: (circle one) STA 303 STA 1002 INSTRUCTIONS: Time: 90 minutes Aids allowed: calculator. Some formulae

More information

Introduction to Generalized Models

Introduction to Generalized Models Introduction to Generalized Models Today s topics: The big picture of generalized models Review of maximum likelihood estimation Models for binary outcomes Models for proportion outcomes Models for categorical

More information

Multiple Linear Regression

Multiple Linear Regression Andrew Lonardelli December 20, 2013 Multiple Linear Regression 1 Table Of Contents Introduction: p.3 Multiple Linear Regression Model: p.3 Least Squares Estimation of the Parameters: p.4-5 The matrix approach

More information

Univariate ARIMA Models

Univariate ARIMA Models Univariate ARIMA Models ARIMA Model Building Steps: Identification: Using graphs, statistics, ACFs and PACFs, transformations, etc. to achieve stationary and tentatively identify patterns and model components.

More information

A Re-Introduction to General Linear Models (GLM)

A Re-Introduction to General Linear Models (GLM) A Re-Introduction to General Linear Models (GLM) Today s Class: You do know the GLM Estimation (where the numbers in the output come from): From least squares to restricted maximum likelihood (REML) Reviewing

More information

AMS 7 Correlation and Regression Lecture 8

AMS 7 Correlation and Regression Lecture 8 AMS 7 Correlation and Regression Lecture 8 Department of Applied Mathematics and Statistics, University of California, Santa Cruz Suumer 2014 1 / 18 Correlation pairs of continuous observations. Correlation

More information

Hierarchical Generalized Linear Models. ERSH 8990 REMS Seminar on HLM Last Lecture!

Hierarchical Generalized Linear Models. ERSH 8990 REMS Seminar on HLM Last Lecture! Hierarchical Generalized Linear Models ERSH 8990 REMS Seminar on HLM Last Lecture! Hierarchical Generalized Linear Models Introduction to generalized models Models for binary outcomes Interpreting parameter

More information

Dynamic Determination of Mixed Model Covariance Structures. in Double-blind Clinical Trials. Matthew Davis - Omnicare Clinical Research

Dynamic Determination of Mixed Model Covariance Structures. in Double-blind Clinical Trials. Matthew Davis - Omnicare Clinical Research PharmaSUG2010 - Paper SP12 Dynamic Determination of Mixed Model Covariance Structures in Double-blind Clinical Trials Matthew Davis - Omnicare Clinical Research Abstract With the computing power of SAS

More information

Review of Multiple Regression

Review of Multiple Regression Ronald H. Heck 1 Let s begin with a little review of multiple regression this week. Linear models [e.g., correlation, t-tests, analysis of variance (ANOVA), multiple regression, path analysis, multivariate

More information

Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras

Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras Biostatistics and Design of Experiments Prof. Mukesh Doble Department of Biotechnology Indian Institute of Technology, Madras Lecture - 39 Regression Analysis Hello and welcome to the course on Biostatistics

More information

Time-Invariant Predictors in Longitudinal Models

Time-Invariant Predictors in Longitudinal Models Time-Invariant Predictors in Longitudinal Models Today s Class (or 3): Summary of steps in building unconditional models for time What happens to missing predictors Effects of time-invariant predictors

More information

Mathematical Notation Math Introduction to Applied Statistics

Mathematical Notation Math Introduction to Applied Statistics Mathematical Notation Math 113 - Introduction to Applied Statistics Name : Use Word or WordPerfect to recreate the following documents. Each article is worth 10 points and can be printed and given to the

More information

Introduction to Random Effects of Time and Model Estimation

Introduction to Random Effects of Time and Model Estimation Introduction to Random Effects of Time and Model Estimation Today s Class: The Big Picture Multilevel model notation Fixed vs. random effects of time Random intercept vs. random slope models How MLM =

More information

Generalized Models: Part 1

Generalized Models: Part 1 Generalized Models: Part 1 Topics: Introduction to generalized models Introduction to maximum likelihood estimation Models for binary outcomes Models for proportion outcomes Models for categorical outcomes

More information

Repeated Measures ANOVA Multivariate ANOVA and Their Relationship to Linear Mixed Models

Repeated Measures ANOVA Multivariate ANOVA and Their Relationship to Linear Mixed Models Repeated Measures ANOVA Multivariate ANOVA and Their Relationship to Linear Mixed Models EPSY 905: Multivariate Analysis Spring 2016 Lecture #12 April 20, 2016 EPSY 905: RM ANOVA, MANOVA, and Mixed Models

More information

One-Way Repeated Measures Contrasts

One-Way Repeated Measures Contrasts Chapter 44 One-Way Repeated easures Contrasts Introduction This module calculates the power of a test of a contrast among the means in a one-way repeated measures design using either the multivariate test

More information

Using SPSS for One Way Analysis of Variance

Using SPSS for One Way Analysis of Variance Using SPSS for One Way Analysis of Variance This tutorial will show you how to use SPSS version 12 to perform a one-way, between- subjects analysis of variance and related post-hoc tests. This tutorial

More information

Chapter 19: Logistic regression

Chapter 19: Logistic regression Chapter 19: Logistic regression Self-test answers SELF-TEST Rerun this analysis using a stepwise method (Forward: LR) entry method of analysis. The main analysis To open the main Logistic Regression dialog

More information

Basic IRT Concepts, Models, and Assumptions

Basic IRT Concepts, Models, and Assumptions Basic IRT Concepts, Models, and Assumptions Lecture #2 ICPSR Item Response Theory Workshop Lecture #2: 1of 64 Lecture #2 Overview Background of IRT and how it differs from CFA Creating a scale An introduction

More information

Answer to exercise: Blood pressure lowering drugs

Answer to exercise: Blood pressure lowering drugs Answer to exercise: Blood pressure lowering drugs The data set bloodpressure.txt contains data from a cross-over trial, involving three different formulations of a drug for lowering of blood pressure:

More information

Confidence Intervals for One-Way Repeated Measures Contrasts

Confidence Intervals for One-Way Repeated Measures Contrasts Chapter 44 Confidence Intervals for One-Way Repeated easures Contrasts Introduction This module calculates the expected width of a confidence interval for a contrast (linear combination) of the means in

More information

UNIVERSITY OF TORONTO Faculty of Arts and Science

UNIVERSITY OF TORONTO Faculty of Arts and Science UNIVERSITY OF TORONTO Faculty of Arts and Science December 2013 Final Examination STA442H1F/2101HF Methods of Applied Statistics Jerry Brunner Duration - 3 hours Aids: Calculator Model(s): Any calculator

More information

Logistic Regression. Continued Psy 524 Ainsworth

Logistic Regression. Continued Psy 524 Ainsworth Logistic Regression Continued Psy 524 Ainsworth Equations Regression Equation Y e = 1 + A+ B X + B X + B X 1 1 2 2 3 3 i A+ B X + B X + B X e 1 1 2 2 3 3 Equations The linear part of the logistic regression

More information

Regression, Part I. - In correlation, it would be irrelevant if we changed the axes on our graph.

Regression, Part I. - In correlation, it would be irrelevant if we changed the axes on our graph. Regression, Part I I. Difference from correlation. II. Basic idea: A) Correlation describes the relationship between two variables, where neither is independent or a predictor. - In correlation, it would

More information

Describing Change over Time: Adding Linear Trends

Describing Change over Time: Adding Linear Trends Describing Change over Time: Adding Linear Trends Longitudinal Data Analysis Workshop Section 7 University of Georgia: Institute for Interdisciplinary Research in Education and Human Development Section

More information

Analysing categorical data using logit models

Analysing categorical data using logit models Analysing categorical data using logit models Graeme Hutcheson, University of Manchester The lecture notes, exercises and data sets associated with this course are available for download from: www.research-training.net/manchester

More information

Chapter 6. Logistic Regression. 6.1 A linear model for the log odds

Chapter 6. Logistic Regression. 6.1 A linear model for the log odds Chapter 6 Logistic Regression In logistic regression, there is a categorical response variables, often coded 1=Yes and 0=No. Many important phenomena fit this framework. The patient survives the operation,

More information

MITOCW ocw f99-lec17_300k

MITOCW ocw f99-lec17_300k MITOCW ocw-18.06-f99-lec17_300k OK, here's the last lecture in the chapter on orthogonality. So we met orthogonal vectors, two vectors, we met orthogonal subspaces, like the row space and null space. Now

More information

Three Factor Completely Randomized Design with One Continuous Factor: Using SPSS GLM UNIVARIATE R. C. Gardner Department of Psychology

Three Factor Completely Randomized Design with One Continuous Factor: Using SPSS GLM UNIVARIATE R. C. Gardner Department of Psychology Data_Analysis.calm Three Factor Completely Randomized Design with One Continuous Factor: Using SPSS GLM UNIVARIATE R. C. Gardner Department of Psychology This article considers a three factor completely

More information

A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data

A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data A (Brief) Introduction to Crossed Random Effects Models for Repeated Measures Data Today s Class: Review of concepts in multivariate data Introduction to random intercepts Crossed random effects models

More information

Ron Heck, Fall Week 3: Notes Building a Two-Level Model

Ron Heck, Fall Week 3: Notes Building a Two-Level Model Ron Heck, Fall 2011 1 EDEP 768E: Seminar on Multilevel Modeling rev. 9/6/2011@11:27pm Week 3: Notes Building a Two-Level Model We will build a model to explain student math achievement using student-level

More information

Analysis of Longitudinal Data: Comparison between PROC GLM and PROC MIXED.

Analysis of Longitudinal Data: Comparison between PROC GLM and PROC MIXED. Analysis of Longitudinal Data: Comparison between PROC GLM and PROC MIXED. Maribeth Johnson, Medical College of Georgia, Augusta, GA ABSTRACT Longitudinal data refers to datasets with multiple measurements

More information

Categorical and Zero Inflated Growth Models

Categorical and Zero Inflated Growth Models Categorical and Zero Inflated Growth Models Alan C. Acock* Summer, 2009 *Alan C. Acock, Department of Human Development and Family Sciences, Oregon State University, Corvallis OR 97331 (alan.acock@oregonstate.edu).

More information

Latent Growth Models 1

Latent Growth Models 1 1 We will use the dataset bp3, which has diastolic blood pressure measurements at four time points for 256 patients undergoing three types of blood pressure medication. These are our observed variables:

More information

Covariance Structure Approach to Within-Cases

Covariance Structure Approach to Within-Cases Covariance Structure Approach to Within-Cases Remember how the data file grapefruit1.data looks: Store sales1 sales2 sales3 1 62.1 61.3 60.8 2 58.2 57.9 55.1 3 51.6 49.2 46.2 4 53.7 51.5 48.3 5 61.4 58.7

More information

Review of Multilevel Models for Longitudinal Data

Review of Multilevel Models for Longitudinal Data Review of Multilevel Models for Longitudinal Data Topics: Concepts in longitudinal multilevel modeling Describing within-person fluctuation using ACS models Describing within-person change using random

More information

Regression, part II. I. What does it all mean? A) Notice that so far all we ve done is math.

Regression, part II. I. What does it all mean? A) Notice that so far all we ve done is math. Regression, part II I. What does it all mean? A) Notice that so far all we ve done is math. 1) One can calculate the Least Squares Regression Line for anything, regardless of any assumptions. 2) But, if

More information

Ordinary Least Squares Regression Explained: Vartanian

Ordinary Least Squares Regression Explained: Vartanian Ordinary Least Squares Regression Eplained: Vartanian When to Use Ordinary Least Squares Regression Analysis A. Variable types. When you have an interval/ratio scale dependent variable.. When your independent

More information

y response variable x 1, x 2,, x k -- a set of explanatory variables

y response variable x 1, x 2,, x k -- a set of explanatory variables 11. Multiple Regression and Correlation y response variable x 1, x 2,, x k -- a set of explanatory variables In this chapter, all variables are assumed to be quantitative. Chapters 12-14 show how to incorporate

More information

1 Quantitative Techniques in Practice

1 Quantitative Techniques in Practice 1 Quantitative Techniques in Practice 1.1 Lecture 2: Stationarity, spurious regression, etc. 1.1.1 Overview In the rst part we shall look at some issues in time series economics. In the second part we

More information

This module focuses on the logic of ANOVA with special attention given to variance components and the relationship between ANOVA and regression.

This module focuses on the logic of ANOVA with special attention given to variance components and the relationship between ANOVA and regression. WISE ANOVA and Regression Lab Introduction to the WISE Correlation/Regression and ANOVA Applet This module focuses on the logic of ANOVA with special attention given to variance components and the relationship

More information

Glossary. The ISI glossary of statistical terms provides definitions in a number of different languages:

Glossary. The ISI glossary of statistical terms provides definitions in a number of different languages: Glossary The ISI glossary of statistical terms provides definitions in a number of different languages: http://isi.cbs.nl/glossary/index.htm Adjusted r 2 Adjusted R squared measures the proportion of the

More information

Investigating Models with Two or Three Categories

Investigating Models with Two or Three Categories Ronald H. Heck and Lynn N. Tabata 1 Investigating Models with Two or Three Categories For the past few weeks we have been working with discriminant analysis. Let s now see what the same sort of model might

More information

Time Invariant Predictors in Longitudinal Models

Time Invariant Predictors in Longitudinal Models Time Invariant Predictors in Longitudinal Models Longitudinal Data Analysis Workshop Section 9 University of Georgia: Institute for Interdisciplinary Research in Education and Human Development Section

More information

Ch. 16: Correlation and Regression

Ch. 16: Correlation and Regression Ch. 1: Correlation and Regression With the shift to correlational analyses, we change the very nature of the question we are asking of our data. Heretofore, we were asking if a difference was likely to

More information

Statistical Practice. Selecting the Best Linear Mixed Model Under REML. Matthew J. GURKA

Statistical Practice. Selecting the Best Linear Mixed Model Under REML. Matthew J. GURKA Matthew J. GURKA Statistical Practice Selecting the Best Linear Mixed Model Under REML Restricted maximum likelihood (REML) estimation of the parameters of the mixed model has become commonplace, even

More information

Ling 289 Contingency Table Statistics

Ling 289 Contingency Table Statistics Ling 289 Contingency Table Statistics Roger Levy and Christopher Manning This is a summary of the material that we ve covered on contingency tables. Contingency tables: introduction Odds ratios Counting,

More information

2/26/2017. PSY 512: Advanced Statistics for Psychological and Behavioral Research 2

2/26/2017. PSY 512: Advanced Statistics for Psychological and Behavioral Research 2 PSY 512: Advanced Statistics for Psychological and Behavioral Research 2 When and why do we use logistic regression? Binary Multinomial Theory behind logistic regression Assessing the model Assessing predictors

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Objective: Students will gain familiarity with using Excel to record data, display data properly, use built-in formulae to do calculations, and plot and fit data with linear functions.

More information

1 A Review of Correlation and Regression

1 A Review of Correlation and Regression 1 A Review of Correlation and Regression SW, Chapter 12 Suppose we select n = 10 persons from the population of college seniors who plan to take the MCAT exam. Each takes the test, is coached, and then

More information

Week 2 Video 4. Metrics for Regressors

Week 2 Video 4. Metrics for Regressors Week 2 Video 4 Metrics for Regressors Metrics for Regressors Linear Correlation MAE/RMSE Information Criteria Linear correlation (Pearson s correlation) r(a,b) = When A s value changes, does B change in

More information

Path Analysis. PRE 906: Structural Equation Modeling Lecture #5 February 18, PRE 906, SEM: Lecture 5 - Path Analysis

Path Analysis. PRE 906: Structural Equation Modeling Lecture #5 February 18, PRE 906, SEM: Lecture 5 - Path Analysis Path Analysis PRE 906: Structural Equation Modeling Lecture #5 February 18, 2015 PRE 906, SEM: Lecture 5 - Path Analysis Key Questions for Today s Lecture What distinguishes path models from multivariate

More information

Fixed effects results...32

Fixed effects results...32 1 MODELS FOR CONTINUOUS OUTCOMES...7 1.1 MODELS BASED ON A SUBSET OF THE NESARC DATA...7 1.1.1 The data...7 1.1.1.1 Importing the data and defining variable types...8 1.1.1.2 Exploring the data...12 Univariate

More information

Correlation & Simple Regression

Correlation & Simple Regression Chapter 11 Correlation & Simple Regression The previous chapter dealt with inference for two categorical variables. In this chapter, we would like to examine the relationship between two quantitative variables.

More information

Introduction to SAS proc mixed

Introduction to SAS proc mixed Faculty of Health Sciences Introduction to SAS proc mixed Analysis of repeated measurements, 2017 Julie Forman Department of Biostatistics, University of Copenhagen 2 / 28 Preparing data for analysis The

More information

STAT 3900/4950 MIDTERM TWO Name: Spring, 2015 (print: first last ) Covered topics: Two-way ANOVA, ANCOVA, SLR, MLR and correlation analysis

STAT 3900/4950 MIDTERM TWO Name: Spring, 2015 (print: first last ) Covered topics: Two-way ANOVA, ANCOVA, SLR, MLR and correlation analysis STAT 3900/4950 MIDTERM TWO Name: Spring, 205 (print: first last ) Covered topics: Two-way ANOVA, ANCOVA, SLR, MLR and correlation analysis Instructions: You may use your books, notes, and SPSS/SAS. NO

More information

CRP 272 Introduction To Regression Analysis

CRP 272 Introduction To Regression Analysis CRP 272 Introduction To Regression Analysis 30 Relationships Among Two Variables: Interpretations One variable is used to explain another variable X Variable Independent Variable Explaining Variable Exogenous

More information

Midterm 2 - Solutions

Midterm 2 - Solutions Ecn 102 - Analysis of Economic Data University of California - Davis February 23, 2010 Instructor: John Parman Midterm 2 - Solutions You have until 10:20am to complete this exam. Please remember to put

More information

Data Analysis and Statistical Methods Statistics 651

Data Analysis and Statistical Methods Statistics 651 Data Analysis and Statistical Methods Statistics 651 http://www.stat.tamu.edu/~suhasini/teaching.html Suhasini Subba Rao Motivations for the ANOVA We defined the F-distribution, this is mainly used in

More information

Modeling the Covariance

Modeling the Covariance Modeling the Covariance Jamie Monogan University of Georgia February 3, 2016 Jamie Monogan (UGA) Modeling the Covariance February 3, 2016 1 / 16 Objectives By the end of this meeting, participants should

More information

Discrete Structures Proofwriting Checklist

Discrete Structures Proofwriting Checklist CS103 Winter 2019 Discrete Structures Proofwriting Checklist Cynthia Lee Keith Schwarz Now that we re transitioning to writing proofs about discrete structures like binary relations, functions, and graphs,

More information

t-test for b Copyright 2000 Tom Malloy. All rights reserved. Regression

t-test for b Copyright 2000 Tom Malloy. All rights reserved. Regression t-test for b Copyright 2000 Tom Malloy. All rights reserved. Regression Recall, back some time ago, we used a descriptive statistic which allowed us to draw the best fit line through a scatter plot. We

More information

Black White Total Observed Expected χ 2 = (f observed f expected ) 2 f expected (83 126) 2 ( )2 126

Black White Total Observed Expected χ 2 = (f observed f expected ) 2 f expected (83 126) 2 ( )2 126 Psychology 60 Fall 2013 Practice Final Actual Exam: This Wednesday. Good luck! Name: To view the solutions, check the link at the end of the document. This practice final should supplement your studying;

More information

Basic Statistics Exercises 66

Basic Statistics Exercises 66 Basic Statistics Exercises 66 42. Suppose we are interested in predicting a person's height from the person's length of stride (distance between footprints). The following data is recorded for a random

More information

Time-Invariant Predictors in Longitudinal Models

Time-Invariant Predictors in Longitudinal Models Time-Invariant Predictors in Longitudinal Models Today s Topics: What happens to missing predictors Effects of time-invariant predictors Fixed vs. systematically varying vs. random effects Model building

More information