Using Mixed Effects Models in Psychology
Scott Fraundorf sfraundo@pitt.edu Office: 608 LRDC Office hours: Tu 12:30-1:30, Wed 1-1:30,
- r by appointment
Using Mixed Effects Models in Psychology Scott Fraundorf - - PowerPoint PPT Presentation
Using Mixed Effects Models in Psychology Scott Fraundorf sfraundo@pitt.edu Office: 608 LRDC Office hours: Tu 12:30-1:30, Wed 1-1:30, or by appointment Mixed Effects Models Intro l Course goals & requirements l Motivation for mixed effects
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l Psychology, cognitive area, 5th year at Pitt
l Office here in Learning Research and Development
l Research interests:
l Memory & metacognition l Language processing
l Enjoy teaching stats!
l We will:
l We won’t:
l Midterm project:
l Final project:
l We’ll be fitting models in R
l Free & runs on basically any computer l Next week, will cover basics of using R
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
Subject 1 Subject 2 Subject 3
doesn’t tell us anything about Subject 2’s
Subject 1 Subject 2 Subject 3
et al., 2010, Nature)
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
Child 2
FAMILY 1 FAMILY 2
Child 3 Child 1
Student 2
CLASS- ROOM 1
Student 3 Student 1
CLASS- ROOM 2 SCHOOL 1
SAMPLED SCHOOLS SAMPLED CLASSROOMS in those schools SAMPLED STUDENTS in those classrooms
Student 2
CLASS- ROOM 1
Student 3 Student 1
CLASS- ROOM 2 SCHOOL 1
Student 2
CLASS- ROOM 1
Student 3 Student 1
CLASS- ROOM 2 SCHOOL 1
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
Maintenance rehearsal Elaborative rehearsal
Note: not real data
l OLD ANOVA solution:
l Subjects analysis:
l Does the effect
generalize across subjects?
l Items analysis:
l Does the effect
generalize across items?
SUBJECT ANALYSIS ITEM ANALYSIS
Note: not real data
l OLD ANOVA solution:
l Subjects analysis l Items analysis
l Problem: We now have
l Possible to combine
SUBJECT ANALYSIS ITEM ANALYSIS
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l ANOVA assumes our response is continuous l But, we often want to look at categorical data
Does student graduate high school or not? Item recalled
What predicts diagnosis of ASD?
l Traditional solution:
l Maybe with some transformation
l Violates assumptions of
1
l Traditional solution:
l Violates assumptions of
1
l Traditional solution:
l Maybe with some transformation
l Violates assumptions of
l Can lead to:
l Spurious effects
l Missing real effects
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l Many interesting independent variables vary
l e.g., Word frequency
l Many interesting independent variables vary
l Or: Second language proficiency or reading skill
l ANOVAs require division into categories
l e.g., median split
l Many interesting independent variables vary
l Or: Second language proficiency or reading skill
l ANOVAs require division into categories
l e.g., median split l Or: extreme groups design
l Many interesting independent variables vary
l Or: Second language proficiency or reading skill
l ANOVAs require division into categories
l Problem: Can only ask “is there a difference?”, not
l Loss of statistical power (Cohen, 1983)
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
Power of subjects analysis! Power of items analysis!
l Biggest contribution of mixed-effects models
How does the effect of parental stress on screen time generalize across children and families? How does the effect of aphasia on sentence processing generalize across subjects and sentences?
l Model outcome using regression-like approach
l For many experimental designs, this means a
l ANOVA: Unit of analysis is cell mean l Mixed effects models: Unit of analysis is
l Model outcome using regression-like approach l Look at individual trials/observations (not
l In a regression, easy to include
l Link functions allow us to relate model
l Link functions allow us to relate model
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l “Mixed effects models” is not the most
l Technically, any model that includes subjects,
l Models we’ll be talking about are
l But “mixed effects models” has caught on
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l How do we run mixed effects models?
l Multiple software packages could be used to fit
l Most popular solution: R with lme4
l Free! l Runs on any
l Lots of add-ons—
l Gaining popularity l Makes analyses
l Documentation /
l Other online
l Requires some
l Regular R < www.r-project.org > l RStudio
l Different interface
l Some additional windows/tools to help you keep
l Same commands, same results l Also available for just about any platform l Recommended (but not required) l Requires you to download regular R first
l Also R Commander with buttons, menus
l No experience with this, not sure if it works
l Course goals & requirements l Motivation for mixed effects models
l Big picture view of mixed effects models l Terminology l R
l Mixed effects models solve three
l Multiple random effects (subjects, items,
l Categorical outcomes l Continuous predictors
l For next week: Download R!
l Next class, we’ll get started using R
l If sitting in, e-mail me (sfraundo@pitt.edu)
l CourseWeb survey about your research &