Mixed effects modeling



Similar documents
SPSS Guide: Regression Analysis

DEPARTMENT OF PSYCHOLOGY UNIVERSITY OF LANCASTER MSC IN PSYCHOLOGICAL RESEARCH METHODS ANALYSING AND INTERPRETING DATA 2 PART 1 WEEK 9

Basic Statistics and Data Analysis for Health Researchers from Foreign Countries

1.5 Oneway Analysis of Variance

1. What is the critical value for this 95% confidence interval? CV = z.025 = invnorm(0.025) = 1.96

5. Linear Regression

2. Simple Linear Regression

Part 2: Analysis of Relationship Between Two Variables

Chapter 5 Analysis of variance SPSS Analysis of variance

THE KRUSKAL WALLLIS TEST

Outline. Topic 4 - Analysis of Variance Approach to Regression. Partitioning Sums of Squares. Total Sum of Squares. Partitioning sums of squares

Week TSX Index

Logistic Regression (a type of Generalized Linear Model)

Multiple Linear Regression

Moderation. Moderation

Module 5: Multiple Regression Analysis

Moderator and Mediator Analysis

NCSS Statistical Software Principal Components Regression. In ordinary least squares, the regression coefficients are estimated using the formula ( )

GLM I An Introduction to Generalized Linear Models

Simple Methods and Procedures Used in Forecasting

Chapter 13 Introduction to Linear Regression and Correlation Analysis

IAPRI Quantitative Analysis Capacity Building Series. Multiple regression analysis & interpreting results

Final Exam Practice Problem Answers

Regression step-by-step using Microsoft Excel

This chapter will demonstrate how to perform multiple linear regression with IBM SPSS

Testing for Lack of Fit

Regression Analysis: A Complete Example

Elementary Statistics Sample Exam #3

Regression III: Advanced Methods

" Y. Notation and Equations for Regression Lecture 11/4. Notation:

Research Methods & Experimental Design

Premaster Statistics Tutorial 4 Full solutions

NCSS Statistical Software

APPLICATION OF LINEAR REGRESSION MODEL FOR POISSON DISTRIBUTION IN FORECASTING

Multiple Regression in SPSS This example shows you how to perform multiple regression. The basic command is regression : linear.

Lecture 11: Confidence intervals and model comparison for linear regression; analysis of variance

Scrivere un articolo Statistica. Valter Torri Dip. Oncologia

2013 MBA Jump Start Program. Statistics Module Part 3

One-Way Analysis of Variance

I L L I N O I S UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN

Section 1: Simple Linear Regression

1. The parameters to be estimated in the simple linear regression model Y=α+βx+ε ε~n(0,σ) are: a) α, β, σ b) α, β, ε c) a, b, s d) ε, 0, σ

Handling attrition and non-response in longitudinal data

Chapter 14: Repeated Measures Analysis of Variance (ANOVA)

Violent crime total. Problem Set 1

When to use Excel. When NOT to use Excel 9/24/2014

Analyzing Intervention Effects: Multilevel & Other Approaches. Simplest Intervention Design. Better Design: Have Pretest

Introducing the Multilevel Model for Change

Chapter Seven. Multiple regression An introduction to multiple regression Performing a multiple regression on SPSS

Section 14 Simple Linear Regression: Introduction to Least Squares Regression

Using R for Linear Regression

HLM software has been one of the leading statistical packages for hierarchical

Stat 412/512 CASE INFLUENCE STATISTICS. Charlotte Wickham. stat512.cwick.co.nz. Feb

Chapter 4 and 5 solutions

Power and sample size in multilevel modeling

Hedge Effectiveness Testing

Outline. Definitions Descriptive vs. Inferential Statistics The t-test - One-sample t-test

HYPOTHESIS TESTING: CONFIDENCE INTERVALS, T-TESTS, ANOVAS, AND REGRESSION

1.1. Simple Regression in Excel (Excel 2010).

9.63 Laboratory in Cognitive Science. Interaction: memory experiment

Two-sample hypothesis testing, II /16/2004

13: Additional ANOVA Topics. Post hoc Comparisons

Statistical Models in R

Randomized Block Analysis of Variance

Lin s Concordance Correlation Coefficient

data visualization and regression

E(y i ) = x T i β. yield of the refined product as a percentage of crude specific gravity vapour pressure ASTM 10% point ASTM end point in degrees F

1/27/2013. PSY 512: Advanced Statistics for Psychological and Behavioral Research 2

Estimation of σ 2, the variance of ɛ

One-Way Analysis of Variance (ANOVA) Example Problem

Didacticiel - Études de cas

Time Series Analysis

Outline: Demand Forecasting

Multivariate Logistic Regression

Sample Size and Power in Clinical Trials

Parametric and non-parametric statistical methods for the life sciences - Session I

General Regression Formulae ) (N-2) (1 - r 2 YX

Handling missing data in Stata a whirlwind tour

Hypothesis testing - Steps

Recall this chart that showed how most of our course would be organized:

Problem of Missing Data

Ordinal Regression. Chapter

Multinomial and Ordinal Logistic Regression

10. Analysis of Longitudinal Studies Repeat-measures analysis

SAS Software to Fit the Generalized Linear Model

MULTIPLE LINEAR REGRESSION ANALYSIS USING MICROSOFT EXCEL. by Michael L. Orlov Chemistry Department, Oregon State University (1996)

Comparing Nested Models

Mixed-effects regression and eye-tracking data

ANOVA ANOVA. Two-Way ANOVA. One-Way ANOVA. When to use ANOVA ANOVA. Analysis of Variance. Chapter 16. A procedure for comparing more than two groups

Handling missing data in large data sets. Agostino Di Ciaccio Dept. of Statistics University of Rome La Sapienza

August 2012 EXAMINATIONS Solution Part I

Multiple Choice Models II

One-Way Analysis of Variance: A Guide to Testing Differences Between Multiple Groups

Statistical Models in R

CHAPTER 3 EXAMPLES: REGRESSION AND PATH ANALYSIS

Calculating the Probability of Returning a Loan with Binary Probability Models

Chapter 3 RANDOM VARIATE GENERATION

2. Making example missing-value datasets: MCAR, MAR, and MNAR

Simple linear regression

BIOL 933 Lab 6 Fall Data Transformation

Transcription:

Mixed effects modeling Generalising to the universe with random item and subject selection Davide Crepaldi MoMo Lab, Department of Psychology University of Milano Bicocca, Italy www.davidecrepaldi.net davide.crepaldi1@unimib.it Spring 2013 Davide Crepaldi 1 / 123

Part II Mixed effects models Davide Crepaldi 45 / 123

Outline of part II 3 Point prediction 4 5 Model fitting Model selection Parameter testing 6 Davide Crepaldi 46 / 123

A new way of thinking about problems Una serie di problemi, in rigoroso ordine di importanza Mangiare carne rossa determina un incremento del rischio di cancro all intestino. Un consumo moderato di alcool (2 bicchieri vino la settimana) durante la gravidanza abbassa il QI del nascituro Un consumo moderato di alcool (2 bicchieri vino la settimana) durante la gravidanza abbassa il QI del nascituro di circa 2 punti Davide Crepaldi 47 / 123

The classic approach Populations to be compared Sample data, to be generalized safely to populations Compare means Sample stats distribution in random sampling Davide Crepaldi 48 / 123

Mixed effect modeling How is it that any given datapoint is such? y ij = β 1 x 1 + β 2 x 2 +... + β n x n + Ss i + Ww j + ɛ i j (4) Davide Crepaldi 49 / 123

An example Suppose you have a dataset with three participants s1, s2, and s3 who each saw three words w1, w2, and w3 in a reading experiment. This is a priming experiment, and each word was tested under a short and a long SOA condition with each participant. Davide Crepaldi 50 / 123

An example ####### 500 ms dealer 30-55 ms DEAL 1500 ms press button Davide Crepaldi 51 / 123

Tabulate the data Davide Crepaldi 52 / 123

Tabulate the data Short SOA w1 w2 w3 s1 475 494 490 s2 491 544 526 s3 484 529 539 Davide Crepaldi 53 / 123

Tabulate the data Short SOA w1 w2 w3 s1 475 494 490 s2 491 544 526 s3 484 529 539 Long SOA w1 w2 w3 s1 466 520 502 s2 516 566 577 s3 470 511 528 Davide Crepaldi 54 / 123

Tabulate the data sbj word SOA RT s1 w1 long 466 s1 w2 long 520 s1 w3 long 502 s1 w1 short 475 s1 w2 short 494 s1 w3 short 490... Davide Crepaldi 55 / 123

Tabulate the data sbj word SOA RT Int s1 w1 long 466 522.2 s1 w2 long 520 522.2 s1 w3 long 502 522.2 s1 w1 short 475 522.2 s1 w2 short 494 522.2 s1 w3 short 490 522.2... Davide Crepaldi 56 / 123

Tabulate the data sbj word SOA RT Int SOA s1 w1 long 466 522.2 0 s1 w2 long 520 522.2 0 s1 w3 long 502 522.2 0 s1 w1 short 475 522.2-19 s1 w2 short 494 522.2-19 s1 w3 short 490 522.2-19... Davide Crepaldi 57 / 123

Tabulate the data sbj word SOA RT Int SOA WordInt s1 w1 long 466 522.2 0-28.3 s1 w2 long 520 522.2 0 14.2 s1 w3 long 502 522.2 0 14.1 s1 w1 short 475 522.2-19 -28.3 s1 w2 short 494 522.2-19 14.2 s1 w3 short 490 522.2-19 14.1... Davide Crepaldi 58 / 123

Tabulate the data sbj word SOA RT Int SOA WordInt SubInt s1 w1 long 466 522.2 0-28.3-26.2 s1 w2 long 520 522.2 0 14.2-26.2 s1 w3 long 502 522.2 0 14.1-26.2 s1 w1 short 475 522.2-19 -28.3-26.2 s1 w2 short 494 522.2-19 14.2-26.2 s1 w3 short 490 522.2-19 14.1-26.2... Davide Crepaldi 59 / 123

Tabulate the data sbj word SOA RT Int SOA WordInt SubInt SubSOA s1 w1 long 466 522.2 0-28.3-26.2 0 s1 w2 long 520 522.2 0 14.2-26.2 0 s1 w3 long 502 522.2 0 14.1-26.2 0 s1 w1 short 475 522.2-19 -28.3-26.2 11 s1 w2 short 494 522.2-19 14.2-26.2 11 s1 w3 short 490 522.2-19 14.1-26.2 11... Davide Crepaldi 60 / 123

Tabulate the data sbj word SOA RT Res Int SOA WordInt SubInt SubSOA s1 w1 long 466 522.2 0-28.3-26.2 0-2 s1 w2 long 520 522.2 0 14.2-26.2 0 9.8 s1 w3 long 502 522.2 0 14.1-26.2 0-8.2 s1 w1 short 475 522.2-19 -28.3-26.2 11 15.4 s1 w2 short 494 522.2-19 14.2-26.2 11-8.4 s1 w3 short 490 522.2-19 14.1-26.2 11-11.9... Davide Crepaldi 61 / 123

More than one X sbj word SOA Lan RT Int SOA Lan s1 w1 long L1 466 522.2 0 0... s1 w2 long L1 520 522.2 0 0 s1 w3 long L2 502 522.2 0 8.3 s1 w1 short L1 475 522.2-19 0 s1 w2 short L1 494 522.2-19 0 s1 w3 short L2 490 522.2-19 8.3... Davide Crepaldi 62 / 123

Interaction sbj word SOA Lan SOA Lan RT Int SOA Lan SOA Lan s1 w1 long L1 0 466 522.2 0 0 0... s1 w2 long L1 0 520 522.2 0 0 0 s1 w3 long L2 0 502 522.2 0 8.3 0 s1 w1 short L1 0 475 522.2-19 0 0 s1 w2 short L1 0 494 522.2-19 0 0 s1 w3 short L2 1 490 522.2-19 8.3 7.5... Davide Crepaldi 63 / 123

Continue X sbj word SOA Freq RT Int SOA Freq s1 w1 long.67 466 522.2 0-8.32... s1 w2 long 1.12 520 522.2 0-8.32 s1 w3 long.02 502 522.2 0-8.32 s1 w1 short.67 475 522.2-19 -8.32 s1 w2 short 1.12 494 522.2-19 -8.32 s1 w3 short.67 490 522.2-19 -8.32... Davide Crepaldi 64 / 123

Non linear effects sbj word SOA Freq Freq 2 RT Int SOA Freq Freq 2 s1 w1 long.67.45 466 522.2 0-8.32-1.34... s1 w2 long 1.12 1.25 520 522.2 0-8.32-1.34 s1 w3 long.02.0004 502 522.2 0-8.32-1.34 s1 w1 short.67.45 475 522.2-19 -8.32-1.34 s1 w2 short 1.12 1.25 494 522.2-19 -8.32-1.34 s1 w3 short.02.004 490 522.2-19 -8.32-1.34... Davide Crepaldi 65 / 123

Fixed and random sbj word SOA RT Res Int SOA WordInt SubInt SubSOA s1 w1 long 466 522.2 0-28.3-26.2 0-2 s1 w2 long 520 522.2 0 14.2-26.2 0 9.8 s1 w3 long 502 522.2 0 14.1-26.2 0-8.2 s1 w1 short 475 522.2-19 -28.3-26.2 11 15.4 s1 w2 short 494 522.2-19 14.2-26.2 11-8.4 s1 w3 short 490 522.2-19 14.1-26.2 11-11.9... Davide Crepaldi 66 / 123

Fixed and random sbj word SOA RT Fixed Random Res Int SOA WordInt SubInt SubSOA s1 w1 long 466 522.2 0-28.3-26.2 0-2 s1 w2 long 520 522.2 0 14.2-26.2 0 9.8 s1 w3 long 502 522.2 0 14.1-26.2 0-8.2 s1 w1 short 475 522.2-19 -28.3-26.2 11 15.4 s1 w2 short 494 522.2-19 14.2-26.2 11-8.4 s1 w3 short 490 522.2-19 14.1-26.2 11-11.9... Davide Crepaldi 67 / 123

Fixed and random Fixed effects Effects of interest Level selection NOT random Interest in estimating effect size Random effects Influence Y, but not of interest Level selection IS random Interest in estimating variability Davide Crepaldi 68 / 123

Random intercept and random slope sbj word SOA RT Fixed Random Res Int SOA WordInt SubInt SubSOA s1 w1 long 466 522.2 0-28.3-26.2 0-2 s1 w2 long 520 522.2 0 14.2-26.2 0 9.8 s1 w3 long 502 522.2 0 14.1-26.2 0-8.2 s1 w1 short 475 522.2-19 -28.3-26.2 11 15.4 s1 w2 short 494 522.2-19 14.2-26.2 11-8.4 s1 w3 short 490 522.2-19 14.1-26.2 11-11.9... Davide Crepaldi 69 / 123

Random intercept and random slope Random intercept Allows overall variation in the Y variable, due to specific subject or item features, independently of any X Random slope Allows X specific variation in the Y variable, due to specific subject or item features Davide Crepaldi 70 / 123

An example Suppose you want to know what is the priming effect related to orthography and semantics. Your hypothesis is that it changes with different exposure times for the primes. You also know that RTs change with the frequency of the target words, and that there are trial series effects. What kind of design would you use? What X? What fixed and what random effects? Davide Crepaldi 71 / 123

Another example Suppose you want to know what is the effect of seeing flashed high valence images before performing a pleasantness judgment. You suspect that this effect depends on some personality trait of the judges. What kind of design would you use? What X? What fixed and what random effects? Davide Crepaldi 72 / 123

Model fitting Model selection Parameter testing What s next? y ij = β 1 x 1 + β 2 x 2 +... + β n x n + Ss i + Ww j + ɛ i j Estimate the parameters, given the data Decide which X help and which do not (model refinement) Once we have the best model, decide which parameters differ reliably from zero Davide Crepaldi 73 / 123

ANOVA does all this in one step Model fitting Model selection Parameter testing df SumSq MeanSq F value p SOA 1 535.2 535.2 7.241.115 Residuals 2 147.8 73.9 Davide Crepaldi 74 / 123

Model fitting Model selection Parameter testing Model fitting Find our best guess at β 1, β 2, β 3...... that never appears into ANOVA tables...... but is the only index of how big is any effect. Questions: Is there an effect? can I be sure that that number isn t 0? How big is an effect? how far is that number from 0? Davide Crepaldi 75 / 123

Model selection Model fitting Model selection Parameter testing Need to be: As simple as you can As precise as you can Davide Crepaldi 76 / 123

Model selection Model fitting Model selection Parameter testing Davide Crepaldi 77 / 123

Model fitting Model selection Parameter testing Order and correlation between predictors Effects are always partialized Order matters because of the correlation between predictors Consider blocks of variables, and then remove one by one Davide Crepaldi 78 / 123

Fixed effect table Model fitting Model selection Parameter testing Is RT dependent on SOA? Estimate Std. Error t value Intercept 522.11 21.99 23.74 SOAshort -18.89 8.26-2.29 Davide Crepaldi 79 / 123

Fixed effect table Model fitting Model selection Parameter testing sbj word SOA RT Fixed Random Res Int SOA WordInt SubInt SubSOA s1 w1 long 466 522.2 0-28.3-26.2 0-2 s1 w2 long 520 522.2 0 14.2-26.2 0 9.8 s1 w3 long 502 522.2 0 14.1-26.2 0-8.2 s1 w1 short 475 522.2-19 -28.3-26.2 11 15.4 s1 w2 short 494 522.2-19 14.2-26.2 11-8.4 s1 w3 short 490 522.2-19 14.1-26.2 11-11.9... Davide Crepaldi 80 / 123

Levels and parameters Model fitting Model selection Parameter testing β level A 0 level B -19 Davide Crepaldi 81 / 123

Levels and parameters Model fitting Model selection Parameter testing β level A 0 level B -19 β level A 0 level B -19 level C? Davide Crepaldi 82 / 123

Levels and parameters Model fitting Model selection Parameter testing β level A 0 level B -19 β 1 β 2 level A 0 0 level B -19 0 level C 0 +12 Davide Crepaldi 83 / 123

Levels and parameters Model fitting Model selection Parameter testing β 1 β 2 β 3 level A 0 0 0 level B -19 0 0 level C 0 +12 0 level D 0 0-34 β 1 β 2 β 3 β 4 level A 0 0 0 0 level B -19 0 0 0 level C 0 +12 0 0 level D 0 0-34 0 level E 0 0 0-3 Davide Crepaldi 84 / 123

Reference level Model fitting Model selection Parameter testing β 1 β 2 β 3 level A 0 0 0 level B -19 0 0 level C 0 +12 0 level D 0 0-34 β 1 β 2 β 3 β 4 level A 0 0 0 0 level B -19 0 0 0 level C 0 +12 0 0 level D 0 0-34 0 level E 0 0 0-3 Davide Crepaldi 85 / 123

Reference level Model fitting Model selection Parameter testing The reference level is the one which is not in the table Estimate Std. Error t value Intercept 522.11 21.99 23.74 SOAshort -18.89 8.26-2.29 Davide Crepaldi 86 / 123

Levels and parameters Model fitting Model selection Parameter testing In this experiment five SOAs were used (12, 24, 36, 48, and 59 ms) Estimate Std. Error t value Intercept -1.664.026-65.21 soa24.008.009.90 soa36.007.008.89 soa48.001.007.19 soa59.004.007.62 Davide Crepaldi 87 / 123

Model fitting Model selection Parameter testing A little exercise Suppose you want to test the claim that low taxation makes people happy. You know that taxes are very high in Sweden, high in Italy, medium to high in Germany, moderate in the UK and low in the US. How would you proceed? Suppose you want to test whether grammatical class influence response times in a reading task. You have reasons to believe that nouns are faster than adjectives, which in turns are faster than adverbs, which in turns are faster than verbs. How would you proceed? Davide Crepaldi 88 / 123

Model fitting Model selection Parameter testing Parameters and effects Parameters and whole effects Whole effects relate to an overall increase in goodness of fit; single parameters relate to specific comparisons (roughly comparable to post hoc effects in the classic approach) With more than two levels, care is needed (some parameters may be significant, some others may not: what about the significance of the whole effect?) Significance testing on individual parameters Variance in the estimate distribution isn t very clear in mixed effect models Unclear how many degrees of freedom each test has Bootstrapping (Monte Carlo Markow Chain, mcmc) Davide Crepaldi 89 / 123

Markov chain Monte Carlo Model fitting Model selection Parameter testing Davide Crepaldi 90 / 123

Model fitting Model selection Parameter testing Markov chain Monte Carlo Estimate MCMCmean HPD95lower HPD95upper pmcmc Pr(> t )) Intercept 522.11 521.94 489.87 553.971 0.000 0.000 SOAshort 18.89 18.88 40.46 2.318 0.078 0.016 Davide Crepaldi 91 / 123

Random effect table Model fitting Model selection Parameter testing Groups Name Variance Std.Dev. SOA:sbj (Intercept) 33.752 5.8096 word (Intercept) 610.701 24.7124 sbj (Intercept) 485.296 22.0294 Residual 120.467 10.9757 Davide Crepaldi 92 / 123

Do the mice succeed? group1 group2 lab1 lab2 lab3 lab4 lab5 lab6 mouse1 1 1 1 0 1 1 mouse2 0 0 0 1 1 1 mouse3 0 1 0 1 1 1 mouse4 1 0 0 1 0 1 mouse5 1 1 0 1 1 1 mouse6 0 0 0 0 1 1 Davide Crepaldi 93 / 123

Impossible values Mean and SD in labs 4, 5 and 6 are.83 and.17 respectively Davide Crepaldi 94 / 123

ANOVA assumptions Mean and variance need to be independent Davide Crepaldi 95 / 123

The logit function Y = ln p 1 p Davide Crepaldi 96 / 123

Fixed effect table Is accuracy dependent on SOA? Estimate Std. Error z value Pr(> z )) Intercept 20.56 41.01 0.501 0.616 SOAshort 35.31 54.29 0.650 0.515 Davide Crepaldi 97 / 123

Random effect table Groups Name Variance Std.Dev. SOA:sbj (Intercept).0002 0.01 word (Intercept).0010 32.33 sbj (Intercept).0656 25.61 Davide Crepaldi 98 / 123