SlideShare a Scribd company logo
1 of 62
Download to read offline
Course Business
! Lab materials on Canvas
! Final project information will be posted on
Canvas at 4:00 PM today
• Final project: Analyze your own data
• I can supply simulated data if needed—send me an intro
& methods section for the data you’d like to analyze
• In-class presentation: Last 2.5 weeks of class,
beginning Nov. 9th
• Sign up on Canvas for a time slot – first come, first
served!
• Final paper: Due on Canvas last day of class
• Canvas will have more info. on requirements
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
Longitudinal Designs
Time
Longitudinal Designs
• There are many methods available for
analyzing longitudinal data
• Aidan Wright’s class on Applied Longitudinal Data
Analysis
• Mixed-effects models are one effective
solution
• Hierarchical models naturally account for
longitudinal data
• Include all of the other features we’ve looked at
(multiple random effects, mix of categorical &
continuous variables, non-normal DVs, etc.)
School
1
School
2
Student
2
Student
1
Student
3
Student
4
Sampled SCHOOLS
Sampled STUDENTS
LEVEL 2
LEVEL 1
• What kind of random-effects structure is this?
Longitudinal Data as Hierarchical Data
School
1
School
2
Student
2
Student
1
Student
3
Student
4
Sampled SCHOOLS
Sampled STUDENTS
LEVEL 2
LEVEL 1
• What kind of random-effects structure is this?
• Two levels of nesting – sample schools, then
sample students inside each school
Longitudinal Data as Hierarchical Data
Student
1
Exam 1
Student
2
Exam 2
Student
3
Exam 1
Student
3
Exam 2
• Now imagine we observed each student several
different times
• e.g., midterm & final exam
School
1
School
2
Student
2
Student
1
Student
3
Student
4
Sampled SCHOOLS
Sampled STUDENTS
LEVEL 2
LEVEL 1
Longitudinal Data as Hierarchical Data
Student
1
Exam 1
Student
2
Exam 2
Student
3
Exam 1
Student
3
Exam 2
School
1
School
2
Student
2
Student
1
Student
3
Student
4
Sampled SCHOOLS
Sampled STUDENTS
LEVEL 3
LEVEL 2
• This is just another level of nesting
• Sample schools
• Sample student within each school
• Sample time points within each student
Longitudinal Data as Hierarchical Data
Sampled
TIME POINTS
LEVEL 1
Longitudinal Designs
• Two big questions mixed-effects models can
help us answer about longitudinal data:
1) What is the overall trajectory of change
across time?
" Today
2) How does an observation at one time point
relate to the next time point?
" Wednesday
vocab.csv
! Role of language input in early
vocab acquisition
! 200 kids from lower SES families:
! 100 families given books to read
to their kids
! 100 waitlisted controls
! Vocab assessed every 2 months
from 20 mos. to 28 mos.
! Research questions:
! What is the general trajectory of
vocabulary acquisition in these ages?
! How is this altered by our intervention?
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
Long vs. Wide Format
! For lmer(), each observation
needs its own row
! “long” format
Time 1 row
Time 2 gets a separate row
One trial
Another trial
Long vs. Wide Format
! For lmer(), each observation
needs its own row
! “long” format
! Sometimes data comes to
us in “wide” format
! Each repeated measure
is a different column
in the same row
! e.g., what
SPSS uses
! vocab.csv is
in this format
Time 1 and Time 2 are considered
separate variables
Time 1 row
Time 2 gets a separate row
Long vs. Wide Format
! Tidyverse contains very easy functions for
pivoting data between formats
! pivot_longer(): To turn data into long format
! pivot_wider(): To turn data into wide format
pivot_longer()
! Here is a look at our dataframe…
We want to turn into
each of these
columns into a
separate row
pivot_longer()
! vocab %>%
pivot_longer(cols=c('Month0','Month2','Month4’,
'Month6','Month8')) -> vocab.p
! Now we have five rows per child
We want to turn into
each of these
columns into a
separate row
pivot_longer()
! By default, R saves the original column name in a
variable called “name”, and the DV in a variable called
“value”
! Not very informative
! We can specify better names :
! vocab %>%
pivot_longer(cols=c('Month0','Month2','Month4’,
'Month6','Month8’), names_to='MonthsInStudy’,
values_to='VocabWords') -> vocab.p
pivot_longer()
! By default, R saves the original column name in a
variable called “name”, and the DV in a variable called
“value”
! Not very informative
! We can specify better names :
! vocab %>%
pivot_longer(cols=c('Month0','Month2','Month4’,
'Month6','Month8’), names_to='MonthsInStudy’,
values_to='VocabWords') -> vocab.p
pivot_longer()
! What we’d really like is to turn MonthsIntoStudy into a
numeric variable
! Currently, the values are “Month0,” “Month2,” etc., because
those were the original column names
! Since these all start with the same prefix (Month), tidyverse
can automatically strip that out for us
! vocab %>%
pivot_longer(cols=c('Month0','Month2','Month4','
Month6','Month8’), names_to='MonthsInStudy',
names_prefix='Month', values_to='VocabWords')->
vocab.p
pivot_longer()
! What we’d really like is to turn MonthsIntoStudy into a
numeric variable
! Currently, the values are “Month0,” “Month2,” etc., because
those were the original column names
! Since these all start with the same prefix (Month), tidyverse
can automatically strip that out for us
! vocab %>%
pivot_longer(cols=c('Month0','Month2','Month4','
Month6','Month8’), names_to='MonthsInStudy',
names_prefix='Month', values_to='VocabWords')->
vocab.p
pivot_longer()
! Now, we can use as.numeric() on this variable
! vocab.p %>%
mutate(MonthsInStudy=as.numeric(MonthsInStudy))
-> vocab.p
pivot_longer()
! Now, we can use as.numeric() on this variable
! vocab.p %>%
mutate(MonthsInStudy=as.numeric(MonthsInStudy))
-> vocab.p
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
vocab.csv
! Role of language input in early
vocab acquisition
! 200 kids from lower SES families:
! 100 families given books to read
to their kids
! 100 waitlisted controls
! Vocab assessed every 2 months
from 20 mos. to 28 mos.
! Research questions:
! What is the general trajectory of
vocabulary acquisition in these ages?
! How is this altered by our intervention?
Longitudinal Designs
• Two big questions mixed-effects models can
help us answer about longitudinal data:
1) What is the overall trajectory of change
across time?
" Today: Growth curve analysis
2) How does an observation at one time point
relate to the next time point?
" Wednesday
Time as a Predictor Variable
• How does vocabulary change over time?
• The simple way to answer this question: Add
time as a variable in our model
• Nothing “special” about time as a predictor
Time as a Predictor Variable
• Let’s add the effect of time to our model
• Here: MonthsInStudy (starting at 0)
• Fixed effect because we’re interested in time effects
• model1 <- lmer(VocabWords ~ 1 + MonthsInStudy +
(1|Child), data=vocab)
• How would you interpret the two estimates?
• Intercept:
• Slope:
Time as a Predictor Variable
• Let’s add the effect of time to our model
• Here: MonthsInStudy (starting at 0)
• Fixed effect because we’re interested in time effects
• model1 <- lmer(VocabWords ~ 1 + MonthsInStudy +
(1|Child), data=vocab)
• How would you interpret the two estimates?
• Intercept: Average vocab ~51 words at start of study
• Slope: Gain of about ~35 words per month
Time as a Predictor Variable
• Not necessary to have every time point
represented
• Don’t even have to be
the same set of time
points across
participants
• Time units also don’t matter as long as they’re
consistent
• Could be hours, days, years …
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
Quadratic & Higher Degrees
Quadratic & Higher Degrees
• We’ve been assuming a linear effect of time
Quadratic & Higher Degrees
• But, it looks like vocab growth may accelerate
• Growth between 0 mo. and 2 mo. is much smaller
than growth between 6 mo. and 8 mo.
• Suggests a curve / quadratic equation
Quadratic & Higher Degrees
• Add quadratic effect (MonthsInStudy2):
• model.poly <- lmer(VocabWords ~ 1 +
poly(MonthsInStudy,degree=2,raw=TRUE) +
(1|Child), data=vocab.p)
• degree=2 because we want MonthsInStudy2
• poly() automatically adds lower-order terms as
well
• i.e., the linear term (MonthsInStudy1)
• raw=TRUE to keep the original scale of the
variables (time measured in months)
Quadratic & Higher Degrees
• Results:
• Implied equation (approximate):
• VocabWords = 75 + 11*Months + 3*Months2
• What are predicted values if…
• Month=0?
• Month=1?
• Month=2?
Intercept
Linear term
Quadratic term
Quadratic & Higher Degrees
• Results:
• Implied equation (approximate):
• VocabWords = 75 + 11*Months + 3*Months2
• What are predicted values if…
• Month=0?
• Month=1?
• Month=2?
• Vocab growth is accelerating (larger change from
month 1 to month 2 than from month 0 to month 1)
Intercept
Linear term
Quadratic term
VocabWords=75+(11*0)+(3*02) = 75
VocabWords=75+(11*1)+(3*12) = 89
VocabWords=75+(11*2)+(3*22) = 109 +20
+14
POSITIVE
QUADRATIC TREND
& NO LINEAR
TREND
NEGATIVE
QUADRATIC TREND
& NO LINEAR
TREND
POSITIVE
QUADRATIC TREND
& POSITIVE LINEAR
TREND
NEGATIVE
QUADRATIC TREND
& POSITIVE LINEAR
TREND
Different patterns of quadratic & linear effects in
a GCA describe different curves
POSITIVE
QUADRATIC TREND
& NO LINEAR
TREND
NEGATIVE
QUADRATIC TREND
& NO LINEAR
TREND
POSITIVE
QUADRATIC TREND
& POSITIVE LINEAR
TREND
NEGATIVE
QUADRATIC TREND
& POSITIVE LINEAR
TREND
• Linear trend: Is there an overall increase over time (+),
decrease (-), or no change?
• Quadratic trend: Is the line curved up (+), down (-), or straight?
Quadratic & Higher Degrees
• The Yerkes-Dodson law (Yerkes & Dodson, 1908)
describes the optimal level of physiological arousal to
perform a task: Low arousal results in poor
performance because you are not alert enough,
medium arousal results in strong performance, and
high arousal results in poor performance because
you are too anxious.
Linear trend:
Quadratic trend:
Quadratic & Higher Degrees
• The Yerkes-Dodson law (Yerkes & Dodson, 1908)
describes the optimal level of physiological arousal to
perform a task: Low arousal results in poor
performance because you are not alert enough,
medium arousal results in strong performance, and
high arousal results in poor performance because
you are too anxious.
Linear trend:
Quadratic trend:
NONE
NEGATIVE
Quadratic & Higher Degrees
• In adulthood, working memory declines the
older you get (Park et al., 2002).
Linear trend:
Quadratic trend:
Quadratic & Higher Degrees
• In adulthood, working memory declines the
older you get (Park et al., 2002).
Linear trend:
Quadratic trend: NONE
NEGATIVE
Quadratic & Higher Degrees
• Aphasia is a neuropsychological disorder that
disrupts speech, often resulting from a stroke. After
initially acquiring aphasia, patients often experience
rapid recovery in much of their language
performance (dependent variable) as time
(independent variable) increases. But, this recovery
eventually slows down, and language performance
doesn’t get much better no matter how much more
time increases (e.g., Demeurisse et al., 1980).
Linear trend:
Quadratic trend:
Quadratic & Higher Degrees
• Aphasia is a neuropsychological disorder that
disrupts speech, often resulting from a stroke. After
initially acquiring aphasia, patients often experience
rapid recovery in much of their language
performance (dependent variable) as time
(independent variable) increases. But, this recovery
eventually slows down, and language performance
doesn’t get much better no matter how much more
time increases (e.g., Demeurisse et al., 1980).
Linear trend:
Quadratic trend:
POSITIVE
NEGATIVE
Quadratic & Higher Degrees
• Studies of practice and expertise (e.g., Logan, 1988)
show that people learning to do a task—such as
arithmetic—initially show a quick decrease in
response time (dependent variable) as the amount of
practice increases. However, eventually they hit the
point where the task can’t possibly be done any
faster, and response time reaches an asymptote and
stops decreasing.
Linear trend:
Quadratic trend:
Quadratic & Higher Degrees
• Studies of practice and expertise (e.g., Logan, 1988)
show that people learning to do a task—such as
arithmetic—initially show a quick decrease in
response time (dependent variable) as the amount of
practice increases. However, eventually they hit the
point where the task can’t possibly be done any
faster, and response time reaches an asymptote and
stops decreasing.
Linear trend:
Quadratic trend:
NEGATIVE
POSITIVE
Quadratic & Higher Degrees
• Could go up to even higher degrees (Time3,
Time4…)
• degree=3 if highest exponent is 3
• Degree minus 1 = Number of bends in the
curve
-100 -50 0 50 100
x^3
0 20 40 60 80 100
x^1
0 20 40 60 80 100
x^2
0 bends
1 bend
2 bends
Quadratic & Higher Degrees
• Maximum degree of polynomial: # of
time points minus 1
• Example: 2 time points perfectly fit by
a line (degree 1). Nothing left for
a quadratic term to explain.
• But, don’t want to overfit
• Probably not the case that the real underlying
(population) trajectory has 6 bends in it
• What degree should we include?
• Theoretical considerations
• If comparing conditions, look at mean
trajectory across conditions (Mirman et al., 2008)
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
Child
2
Child
1
Child
3
Child
4
Child 1
Assess-
ment 1
Child 2
Assess-
ment 2
Child 3
Assess-
ment 1
Child 3
Assess-
ment 2
Sampled CHILDREN
Sampled TIME
POINTS
LEVEL 2
LEVEL 1
• So far, we assume the same growth rate for all kids
• Almost certainly not true!
• At level 2, we’re sampling kids both with different
starting points (intercepts) and growth rates
(slopes)
Longitudinal Data: Random Slopes
Growth
Rate 1 Growth
Rate 2
Longitudinal Data: Random Slopes
RANDOM INTERCEPTS MODEL
Kids vary in starting point, but all
acquire vocabulary at the same rate
over this period
WITH RANDOM SLOPES
Allows rate of vocab acquisition to vary
across kids (as well as intercept)
• Let’s allow the MonthsInStudy effect to be different for
each Child
• model.Slope <- lmer(VocabWords ~ 1 +
poly(MonthsInStudy,degree=2,raw=TRUE) +
(1 + poly(MonthsInStudy,degree=2,raw=TRUE)|Child),
data=vocab.p)
Longitudinal Data: Random Slopes
Child
2
Child
1
Child
3
Child
4
Child 1
Assess-
ment 1
Child 2
Assess-
ment 2
Child 3
Assess-
ment 1
Child 3
Assess-
ment 2
Sampled CHILDREN
Sampled TIME
POINTS
LEVEL 2
LEVEL 1
Growth
Rate 1 Growth
Rate 2
Longitudinal Data: Random Slopes
Substantial variability in the MonthsInStudy slope
SD of the slope across children is ~5 words
Mean slope is 11 words/mo, but some kids might have a slope
of 6 or 16
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
Time-Variant & -Invariant Variables
• We may want to include other
(experimental or observational)
variables in a GCA model:
• e.g., our reading intervention
• MonthsInStudy + Reading
• Effect of Reading invariant across time
• Can only affect the intercept
(parallel lines)
• MonthsInStudy * Reading
• Effect of Reading varies with time
• Can affect intercept & slope
Time-Variant & -Invariant Variables
• Fixed-effect results with the interaction:
e.g., Huttenlocher et al., 1991
Also results in faster vocab growth (amplifies + Time effect)
Linear growth rate for “No” group:
8.4 words / month
Linear growth rate for “Yes” group:
8.4 + 4.7 = 13.1 words / month
Effect of reading at time 0 (intercept): ~6 words
No effect on curvature (quadratic term)
Time-Variant & -Invariant Variables
• Can be either:
• Time-Invariant Predictor:
Same across all time points
within a subject
• e.g., our intervention, race/ethnicity
• Level 2 variables
• Time-Varying Predictor: Varies
even within a subject, from one
time point to another
• e.g., hours of sleep, mood
• Level-1 variable
Child
2
Child
1
Child 1
Assess-
ment 1
Child 2
Assess-
ment 2
Sampled CHILDREN
Sampled TIME
POINTS
LEVEL 2
LEVEL 1
• Since R automatically figures out what’s a level-1
vs. level-2 variable, we don’t have to do anything
special for either kind of variable
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab
! Another possibility (in general) is a qualitative
change in the trajectory at some point in the
range of time observed
! e.g., age of majority, public policy changes, etc.
! Include a breakpoint—a categorical variable
that represents whether or not you’re above
the point at which the change happens
! mydata %>%
mutate(Year2015OrLater=
ifelse(Year >= 2015, 1, 0))-> mydata
! New variable is:
! 0 before 2015
! 1 for 2015 onwards
Breakpoints
! Another possibility (in general) is a qualitative
change in the trajectory at some point in the
range of time observed
! e.g., age of majority, public policy changes, etc.
! Include a breakpoint—a categorical variable
that represents whether or not you’re above
the point at which the change happens
Breakpoints
Main effect of breakpoint only – single shift
downward (or upward) but same slope
Main effect of breakpoint & an
interaction – slope also changes
! Can apply this technique to any continuous
variables, not just time
! e.g., above/below the poverty line
! As with higher-order polynomials, be wary of
overfitting the data
! Most effective if we have an a priori reason to
expect a breakpoint somewhere
! Or, use cross-validation to support a more
exploratory analysis
Breakpoints
Week 11.1: Growth Curve Analysis
! Overview
! Reshaping Data
! Growth Curve Analysis
! Time as a Predictor Variable
! Quadratic & Higher Degrees
! Random Slopes
! Time-Variant & -Invariant Variables
! Breakpoints
! Lab

More Related Content

What's hot

What is an independent samples-t test?
What is an independent samples-t test?What is an independent samples-t test?
What is an independent samples-t test?Ken Plummer
 
Single linear regression
Single linear regressionSingle linear regression
Single linear regressionKen Plummer
 
Measures of relationships
Measures of relationshipsMeasures of relationships
Measures of relationshipsyogesh ingle
 
Life Tables & Kaplan-Meier Method.pptx
 Life Tables & Kaplan-Meier Method.pptx Life Tables & Kaplan-Meier Method.pptx
Life Tables & Kaplan-Meier Method.pptxPravin Kolekar
 
Logistic regression
Logistic regressionLogistic regression
Logistic regressionDrZahid Khan
 
Introduction to ANOVAs
Introduction to ANOVAsIntroduction to ANOVAs
Introduction to ANOVAsflorentinoz
 
Point biserial correlation
Point biserial correlationPoint biserial correlation
Point biserial correlationKen Plummer
 
Scatter plots
Scatter plotsScatter plots
Scatter plotsswartzje
 
Logistic Ordinal Regression
Logistic Ordinal RegressionLogistic Ordinal Regression
Logistic Ordinal RegressionSri Ambati
 
Bar Graphs And Histograms
Bar Graphs And HistogramsBar Graphs And Histograms
Bar Graphs And Histogramsmmeddin
 
Topic 15 correlation spss
Topic 15 correlation spssTopic 15 correlation spss
Topic 15 correlation spssSizwan Ahammed
 
What is a Point Biserial Correlation?
What is a Point Biserial Correlation?What is a Point Biserial Correlation?
What is a Point Biserial Correlation?Ken Plummer
 
Reporting Phi Coefficient test in APA
Reporting Phi Coefficient test in APAReporting Phi Coefficient test in APA
Reporting Phi Coefficient test in APAKen Plummer
 
Introduction of mixed effect model
Introduction of mixed effect modelIntroduction of mixed effect model
Introduction of mixed effect modelVivian S. Zhang
 
Reporting pearson correlation in apa
Reporting pearson correlation in apa Reporting pearson correlation in apa
Reporting pearson correlation in apa Amit Sharma
 
Potential Solutions to the Fundamental Problem of Causal Inference: An Overview
Potential Solutions to the Fundamental Problem of Causal Inference: An OverviewPotential Solutions to the Fundamental Problem of Causal Inference: An Overview
Potential Solutions to the Fundamental Problem of Causal Inference: An OverviewEconomic Research Forum
 

What's hot (20)

What is an independent samples-t test?
What is an independent samples-t test?What is an independent samples-t test?
What is an independent samples-t test?
 
Single linear regression
Single linear regressionSingle linear regression
Single linear regression
 
Review of Statistics
Review of StatisticsReview of Statistics
Review of Statistics
 
Measures of relationships
Measures of relationshipsMeasures of relationships
Measures of relationships
 
Life Tables & Kaplan-Meier Method.pptx
 Life Tables & Kaplan-Meier Method.pptx Life Tables & Kaplan-Meier Method.pptx
Life Tables & Kaplan-Meier Method.pptx
 
Poisson regression models for count data
Poisson regression models for count dataPoisson regression models for count data
Poisson regression models for count data
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Introduction to ANOVAs
Introduction to ANOVAsIntroduction to ANOVAs
Introduction to ANOVAs
 
Point biserial correlation
Point biserial correlationPoint biserial correlation
Point biserial correlation
 
Scatter plots
Scatter plotsScatter plots
Scatter plots
 
Logistic Ordinal Regression
Logistic Ordinal RegressionLogistic Ordinal Regression
Logistic Ordinal Regression
 
Bar Graphs And Histograms
Bar Graphs And HistogramsBar Graphs And Histograms
Bar Graphs And Histograms
 
Logistic regression
Logistic regressionLogistic regression
Logistic regression
 
Topic 15 correlation spss
Topic 15 correlation spssTopic 15 correlation spss
Topic 15 correlation spss
 
What is a Point Biserial Correlation?
What is a Point Biserial Correlation?What is a Point Biserial Correlation?
What is a Point Biserial Correlation?
 
Reporting Phi Coefficient test in APA
Reporting Phi Coefficient test in APAReporting Phi Coefficient test in APA
Reporting Phi Coefficient test in APA
 
Linear regression
Linear regressionLinear regression
Linear regression
 
Introduction of mixed effect model
Introduction of mixed effect modelIntroduction of mixed effect model
Introduction of mixed effect model
 
Reporting pearson correlation in apa
Reporting pearson correlation in apa Reporting pearson correlation in apa
Reporting pearson correlation in apa
 
Potential Solutions to the Fundamental Problem of Causal Inference: An Overview
Potential Solutions to the Fundamental Problem of Causal Inference: An OverviewPotential Solutions to the Fundamental Problem of Causal Inference: An Overview
Potential Solutions to the Fundamental Problem of Causal Inference: An Overview
 

Similar to Mixed Effects Models - Growth Curve Analysis

Trends over time
Trends over timeTrends over time
Trends over timedjleach
 
Unit 01 intro to statistics - 1 per page
Unit 01    intro to statistics - 1 per pageUnit 01    intro to statistics - 1 per page
Unit 01 intro to statistics - 1 per pageMAKABANSA
 
Reflection on LearningWrite a brief 1–2 paragraph weekly r
Reflection on LearningWrite a brief 1–2 paragraph weekly rReflection on LearningWrite a brief 1–2 paragraph weekly r
Reflection on LearningWrite a brief 1–2 paragraph weekly rfelipaser7p
 
Addictive links, Keynote talk at WWW 2014 workshop
Addictive links, Keynote talk at WWW 2014 workshopAddictive links, Keynote talk at WWW 2014 workshop
Addictive links, Keynote talk at WWW 2014 workshopPeter Brusilovsky
 
Audio Lesson Plan 1
Audio Lesson Plan 1Audio Lesson Plan 1
Audio Lesson Plan 1cprue22
 
Deming and Education
Deming and EducationDeming and Education
Deming and Educationaghersi
 
Que Sera Sera sdec15
Que Sera Sera sdec15Que Sera Sera sdec15
Que Sera Sera sdec15Andrew Annett
 
Sequencingr middleschool
Sequencingr middleschoolSequencingr middleschool
Sequencingr middleschoolKelly Kellogg
 
New York Survey DataInstructionsA consulting firm was hired to.docx
New York Survey DataInstructionsA consulting firm was hired to.docxNew York Survey DataInstructionsA consulting firm was hired to.docx
New York Survey DataInstructionsA consulting firm was hired to.docxcurwenmichaela
 
CR Bio elc mtg 11/18
CR Bio elc mtg 11/18CR Bio elc mtg 11/18
CR Bio elc mtg 11/18jsilver
 
Sequencingr highschool
Sequencingr highschoolSequencingr highschool
Sequencingr highschoolKelly Kellogg
 
The Realization ConceptAuthor(s) 1964 Concepts and Sta.docx
The Realization ConceptAuthor(s) 1964 Concepts and Sta.docxThe Realization ConceptAuthor(s) 1964 Concepts and Sta.docx
The Realization ConceptAuthor(s) 1964 Concepts and Sta.docxdurantheseldine
 
Simmons curriculum design.ppt
Simmons curriculum design.pptSimmons curriculum design.ppt
Simmons curriculum design.pptMinBulay
 
Transitioning to Common Core: What it means, What to look for
Transitioning to Common Core: What it means, What to look forTransitioning to Common Core: What it means, What to look for
Transitioning to Common Core: What it means, What to look forCurriculum Associates
 
Fostering Curriculum Development Through Artesol 2010
Fostering Curriculum Development Through Artesol 2010Fostering Curriculum Development Through Artesol 2010
Fostering Curriculum Development Through Artesol 2010shierl
 

Similar to Mixed Effects Models - Growth Curve Analysis (20)

Basic Terms in Statistics
Basic Terms in StatisticsBasic Terms in Statistics
Basic Terms in Statistics
 
Trends over time
Trends over timeTrends over time
Trends over time
 
Unit 01 intro to statistics - 1 per page
Unit 01    intro to statistics - 1 per pageUnit 01    intro to statistics - 1 per page
Unit 01 intro to statistics - 1 per page
 
Reflection on LearningWrite a brief 1–2 paragraph weekly r
Reflection on LearningWrite a brief 1–2 paragraph weekly rReflection on LearningWrite a brief 1–2 paragraph weekly r
Reflection on LearningWrite a brief 1–2 paragraph weekly r
 
Addictive links, Keynote talk at WWW 2014 workshop
Addictive links, Keynote talk at WWW 2014 workshopAddictive links, Keynote talk at WWW 2014 workshop
Addictive links, Keynote talk at WWW 2014 workshop
 
Spss
SpssSpss
Spss
 
Audio Lesson Plan 1
Audio Lesson Plan 1Audio Lesson Plan 1
Audio Lesson Plan 1
 
Bc week 9
Bc week 9Bc week 9
Bc week 9
 
Deming and Education
Deming and EducationDeming and Education
Deming and Education
 
Que Sera Sera sdec15
Que Sera Sera sdec15Que Sera Sera sdec15
Que Sera Sera sdec15
 
Sequencingr middleschool
Sequencingr middleschoolSequencingr middleschool
Sequencingr middleschool
 
New York Survey DataInstructionsA consulting firm was hired to.docx
New York Survey DataInstructionsA consulting firm was hired to.docxNew York Survey DataInstructionsA consulting firm was hired to.docx
New York Survey DataInstructionsA consulting firm was hired to.docx
 
CR Bio elc mtg 11/18
CR Bio elc mtg 11/18CR Bio elc mtg 11/18
CR Bio elc mtg 11/18
 
Sequencingr highschool
Sequencingr highschoolSequencingr highschool
Sequencingr highschool
 
The Realization ConceptAuthor(s) 1964 Concepts and Sta.docx
The Realization ConceptAuthor(s) 1964 Concepts and Sta.docxThe Realization ConceptAuthor(s) 1964 Concepts and Sta.docx
The Realization ConceptAuthor(s) 1964 Concepts and Sta.docx
 
New teacher session
New teacher sessionNew teacher session
New teacher session
 
Simmons curriculum design.ppt
Simmons curriculum design.pptSimmons curriculum design.ppt
Simmons curriculum design.ppt
 
Transitioning to Common Core: What it means, What to look for
Transitioning to Common Core: What it means, What to look forTransitioning to Common Core: What it means, What to look for
Transitioning to Common Core: What it means, What to look for
 
Fostering Curriculum Development Through Artesol 2010
Fostering Curriculum Development Through Artesol 2010Fostering Curriculum Development Through Artesol 2010
Fostering Curriculum Development Through Artesol 2010
 
Linking the Learning
Linking the LearningLinking the Learning
Linking the Learning
 

More from Scott Fraundorf

Mixed Effects Models - Signal Detection Theory
Mixed Effects Models - Signal Detection TheoryMixed Effects Models - Signal Detection Theory
Mixed Effects Models - Signal Detection TheoryScott Fraundorf
 
Mixed Effects Models - Power
Mixed Effects Models - PowerMixed Effects Models - Power
Mixed Effects Models - PowerScott Fraundorf
 
Mixed Effects Models - Effect Size
Mixed Effects Models - Effect SizeMixed Effects Models - Effect Size
Mixed Effects Models - Effect SizeScott Fraundorf
 
Mixed Effects Models - Missing Data
Mixed Effects Models - Missing DataMixed Effects Models - Missing Data
Mixed Effects Models - Missing DataScott Fraundorf
 
Mixed Effects Models - Empirical Logit
Mixed Effects Models - Empirical LogitMixed Effects Models - Empirical Logit
Mixed Effects Models - Empirical LogitScott Fraundorf
 
Mixed Effects Models - Logit Models
Mixed Effects Models - Logit ModelsMixed Effects Models - Logit Models
Mixed Effects Models - Logit ModelsScott Fraundorf
 
Mixed Effects Models - Orthogonal Contrasts
Mixed Effects Models - Orthogonal ContrastsMixed Effects Models - Orthogonal Contrasts
Mixed Effects Models - Orthogonal ContrastsScott Fraundorf
 
Mixed Effects Models - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc ComparisonsMixed Effects Models - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc ComparisonsScott Fraundorf
 
Mixed Effects Models - Simple and Main Effects
Mixed Effects Models - Simple and Main EffectsMixed Effects Models - Simple and Main Effects
Mixed Effects Models - Simple and Main EffectsScott Fraundorf
 
Mixed Effects Models - Centering and Transformations
Mixed Effects Models - Centering and TransformationsMixed Effects Models - Centering and Transformations
Mixed Effects Models - Centering and TransformationsScott Fraundorf
 
Mixed Effects Models - Level-2 Variables
Mixed Effects Models - Level-2 VariablesMixed Effects Models - Level-2 Variables
Mixed Effects Models - Level-2 VariablesScott Fraundorf
 
Mixed Effects Models - Fixed Effect Interactions
Mixed Effects Models - Fixed Effect InteractionsMixed Effects Models - Fixed Effect Interactions
Mixed Effects Models - Fixed Effect InteractionsScott Fraundorf
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsScott Fraundorf
 

More from Scott Fraundorf (14)

Mixed Effects Models - Signal Detection Theory
Mixed Effects Models - Signal Detection TheoryMixed Effects Models - Signal Detection Theory
Mixed Effects Models - Signal Detection Theory
 
Mixed Effects Models - Power
Mixed Effects Models - PowerMixed Effects Models - Power
Mixed Effects Models - Power
 
Mixed Effects Models - Effect Size
Mixed Effects Models - Effect SizeMixed Effects Models - Effect Size
Mixed Effects Models - Effect Size
 
Mixed Effects Models - Missing Data
Mixed Effects Models - Missing DataMixed Effects Models - Missing Data
Mixed Effects Models - Missing Data
 
Mixed Effects Models - Empirical Logit
Mixed Effects Models - Empirical LogitMixed Effects Models - Empirical Logit
Mixed Effects Models - Empirical Logit
 
Mixed Effects Models - Logit Models
Mixed Effects Models - Logit ModelsMixed Effects Models - Logit Models
Mixed Effects Models - Logit Models
 
Mixed Effects Models - Orthogonal Contrasts
Mixed Effects Models - Orthogonal ContrastsMixed Effects Models - Orthogonal Contrasts
Mixed Effects Models - Orthogonal Contrasts
 
Mixed Effects Models - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc ComparisonsMixed Effects Models - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc Comparisons
 
Mixed Effects Models - Simple and Main Effects
Mixed Effects Models - Simple and Main EffectsMixed Effects Models - Simple and Main Effects
Mixed Effects Models - Simple and Main Effects
 
Mixed Effects Models - Centering and Transformations
Mixed Effects Models - Centering and TransformationsMixed Effects Models - Centering and Transformations
Mixed Effects Models - Centering and Transformations
 
Mixed Effects Models - Level-2 Variables
Mixed Effects Models - Level-2 VariablesMixed Effects Models - Level-2 Variables
Mixed Effects Models - Level-2 Variables
 
Mixed Effects Models - Fixed Effect Interactions
Mixed Effects Models - Fixed Effect InteractionsMixed Effects Models - Fixed Effect Interactions
Mixed Effects Models - Fixed Effect Interactions
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive Statistics
 
Scott_Fraundorf_Resume
Scott_Fraundorf_ResumeScott_Fraundorf_Resume
Scott_Fraundorf_Resume
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 

Mixed Effects Models - Growth Curve Analysis

  • 1. Course Business ! Lab materials on Canvas ! Final project information will be posted on Canvas at 4:00 PM today • Final project: Analyze your own data • I can supply simulated data if needed—send me an intro & methods section for the data you’d like to analyze • In-class presentation: Last 2.5 weeks of class, beginning Nov. 9th • Sign up on Canvas for a time slot – first come, first served! • Final paper: Due on Canvas last day of class • Canvas will have more info. on requirements
  • 2. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 4. Longitudinal Designs • There are many methods available for analyzing longitudinal data • Aidan Wright’s class on Applied Longitudinal Data Analysis • Mixed-effects models are one effective solution • Hierarchical models naturally account for longitudinal data • Include all of the other features we’ve looked at (multiple random effects, mix of categorical & continuous variables, non-normal DVs, etc.)
  • 5. School 1 School 2 Student 2 Student 1 Student 3 Student 4 Sampled SCHOOLS Sampled STUDENTS LEVEL 2 LEVEL 1 • What kind of random-effects structure is this? Longitudinal Data as Hierarchical Data
  • 6. School 1 School 2 Student 2 Student 1 Student 3 Student 4 Sampled SCHOOLS Sampled STUDENTS LEVEL 2 LEVEL 1 • What kind of random-effects structure is this? • Two levels of nesting – sample schools, then sample students inside each school Longitudinal Data as Hierarchical Data
  • 7. Student 1 Exam 1 Student 2 Exam 2 Student 3 Exam 1 Student 3 Exam 2 • Now imagine we observed each student several different times • e.g., midterm & final exam School 1 School 2 Student 2 Student 1 Student 3 Student 4 Sampled SCHOOLS Sampled STUDENTS LEVEL 2 LEVEL 1 Longitudinal Data as Hierarchical Data
  • 8. Student 1 Exam 1 Student 2 Exam 2 Student 3 Exam 1 Student 3 Exam 2 School 1 School 2 Student 2 Student 1 Student 3 Student 4 Sampled SCHOOLS Sampled STUDENTS LEVEL 3 LEVEL 2 • This is just another level of nesting • Sample schools • Sample student within each school • Sample time points within each student Longitudinal Data as Hierarchical Data Sampled TIME POINTS LEVEL 1
  • 9. Longitudinal Designs • Two big questions mixed-effects models can help us answer about longitudinal data: 1) What is the overall trajectory of change across time? " Today 2) How does an observation at one time point relate to the next time point? " Wednesday
  • 10. vocab.csv ! Role of language input in early vocab acquisition ! 200 kids from lower SES families: ! 100 families given books to read to their kids ! 100 waitlisted controls ! Vocab assessed every 2 months from 20 mos. to 28 mos. ! Research questions: ! What is the general trajectory of vocabulary acquisition in these ages? ! How is this altered by our intervention?
  • 11. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 12. Long vs. Wide Format ! For lmer(), each observation needs its own row ! “long” format Time 1 row Time 2 gets a separate row One trial Another trial
  • 13. Long vs. Wide Format ! For lmer(), each observation needs its own row ! “long” format ! Sometimes data comes to us in “wide” format ! Each repeated measure is a different column in the same row ! e.g., what SPSS uses ! vocab.csv is in this format Time 1 and Time 2 are considered separate variables Time 1 row Time 2 gets a separate row
  • 14. Long vs. Wide Format ! Tidyverse contains very easy functions for pivoting data between formats ! pivot_longer(): To turn data into long format ! pivot_wider(): To turn data into wide format
  • 15. pivot_longer() ! Here is a look at our dataframe… We want to turn into each of these columns into a separate row
  • 16. pivot_longer() ! vocab %>% pivot_longer(cols=c('Month0','Month2','Month4’, 'Month6','Month8')) -> vocab.p ! Now we have five rows per child We want to turn into each of these columns into a separate row
  • 17. pivot_longer() ! By default, R saves the original column name in a variable called “name”, and the DV in a variable called “value” ! Not very informative ! We can specify better names : ! vocab %>% pivot_longer(cols=c('Month0','Month2','Month4’, 'Month6','Month8’), names_to='MonthsInStudy’, values_to='VocabWords') -> vocab.p
  • 18. pivot_longer() ! By default, R saves the original column name in a variable called “name”, and the DV in a variable called “value” ! Not very informative ! We can specify better names : ! vocab %>% pivot_longer(cols=c('Month0','Month2','Month4’, 'Month6','Month8’), names_to='MonthsInStudy’, values_to='VocabWords') -> vocab.p
  • 19. pivot_longer() ! What we’d really like is to turn MonthsIntoStudy into a numeric variable ! Currently, the values are “Month0,” “Month2,” etc., because those were the original column names ! Since these all start with the same prefix (Month), tidyverse can automatically strip that out for us ! vocab %>% pivot_longer(cols=c('Month0','Month2','Month4',' Month6','Month8’), names_to='MonthsInStudy', names_prefix='Month', values_to='VocabWords')-> vocab.p
  • 20. pivot_longer() ! What we’d really like is to turn MonthsIntoStudy into a numeric variable ! Currently, the values are “Month0,” “Month2,” etc., because those were the original column names ! Since these all start with the same prefix (Month), tidyverse can automatically strip that out for us ! vocab %>% pivot_longer(cols=c('Month0','Month2','Month4',' Month6','Month8’), names_to='MonthsInStudy', names_prefix='Month', values_to='VocabWords')-> vocab.p
  • 21. pivot_longer() ! Now, we can use as.numeric() on this variable ! vocab.p %>% mutate(MonthsInStudy=as.numeric(MonthsInStudy)) -> vocab.p
  • 22. pivot_longer() ! Now, we can use as.numeric() on this variable ! vocab.p %>% mutate(MonthsInStudy=as.numeric(MonthsInStudy)) -> vocab.p
  • 23. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 24. vocab.csv ! Role of language input in early vocab acquisition ! 200 kids from lower SES families: ! 100 families given books to read to their kids ! 100 waitlisted controls ! Vocab assessed every 2 months from 20 mos. to 28 mos. ! Research questions: ! What is the general trajectory of vocabulary acquisition in these ages? ! How is this altered by our intervention?
  • 25. Longitudinal Designs • Two big questions mixed-effects models can help us answer about longitudinal data: 1) What is the overall trajectory of change across time? " Today: Growth curve analysis 2) How does an observation at one time point relate to the next time point? " Wednesday
  • 26. Time as a Predictor Variable • How does vocabulary change over time? • The simple way to answer this question: Add time as a variable in our model • Nothing “special” about time as a predictor
  • 27. Time as a Predictor Variable • Let’s add the effect of time to our model • Here: MonthsInStudy (starting at 0) • Fixed effect because we’re interested in time effects • model1 <- lmer(VocabWords ~ 1 + MonthsInStudy + (1|Child), data=vocab) • How would you interpret the two estimates? • Intercept: • Slope:
  • 28. Time as a Predictor Variable • Let’s add the effect of time to our model • Here: MonthsInStudy (starting at 0) • Fixed effect because we’re interested in time effects • model1 <- lmer(VocabWords ~ 1 + MonthsInStudy + (1|Child), data=vocab) • How would you interpret the two estimates? • Intercept: Average vocab ~51 words at start of study • Slope: Gain of about ~35 words per month
  • 29. Time as a Predictor Variable • Not necessary to have every time point represented • Don’t even have to be the same set of time points across participants • Time units also don’t matter as long as they’re consistent • Could be hours, days, years …
  • 30. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 32. Quadratic & Higher Degrees • We’ve been assuming a linear effect of time
  • 33. Quadratic & Higher Degrees • But, it looks like vocab growth may accelerate • Growth between 0 mo. and 2 mo. is much smaller than growth between 6 mo. and 8 mo. • Suggests a curve / quadratic equation
  • 34. Quadratic & Higher Degrees • Add quadratic effect (MonthsInStudy2): • model.poly <- lmer(VocabWords ~ 1 + poly(MonthsInStudy,degree=2,raw=TRUE) + (1|Child), data=vocab.p) • degree=2 because we want MonthsInStudy2 • poly() automatically adds lower-order terms as well • i.e., the linear term (MonthsInStudy1) • raw=TRUE to keep the original scale of the variables (time measured in months)
  • 35. Quadratic & Higher Degrees • Results: • Implied equation (approximate): • VocabWords = 75 + 11*Months + 3*Months2 • What are predicted values if… • Month=0? • Month=1? • Month=2? Intercept Linear term Quadratic term
  • 36. Quadratic & Higher Degrees • Results: • Implied equation (approximate): • VocabWords = 75 + 11*Months + 3*Months2 • What are predicted values if… • Month=0? • Month=1? • Month=2? • Vocab growth is accelerating (larger change from month 1 to month 2 than from month 0 to month 1) Intercept Linear term Quadratic term VocabWords=75+(11*0)+(3*02) = 75 VocabWords=75+(11*1)+(3*12) = 89 VocabWords=75+(11*2)+(3*22) = 109 +20 +14
  • 37. POSITIVE QUADRATIC TREND & NO LINEAR TREND NEGATIVE QUADRATIC TREND & NO LINEAR TREND POSITIVE QUADRATIC TREND & POSITIVE LINEAR TREND NEGATIVE QUADRATIC TREND & POSITIVE LINEAR TREND Different patterns of quadratic & linear effects in a GCA describe different curves
  • 38. POSITIVE QUADRATIC TREND & NO LINEAR TREND NEGATIVE QUADRATIC TREND & NO LINEAR TREND POSITIVE QUADRATIC TREND & POSITIVE LINEAR TREND NEGATIVE QUADRATIC TREND & POSITIVE LINEAR TREND • Linear trend: Is there an overall increase over time (+), decrease (-), or no change? • Quadratic trend: Is the line curved up (+), down (-), or straight?
  • 39. Quadratic & Higher Degrees • The Yerkes-Dodson law (Yerkes & Dodson, 1908) describes the optimal level of physiological arousal to perform a task: Low arousal results in poor performance because you are not alert enough, medium arousal results in strong performance, and high arousal results in poor performance because you are too anxious. Linear trend: Quadratic trend:
  • 40. Quadratic & Higher Degrees • The Yerkes-Dodson law (Yerkes & Dodson, 1908) describes the optimal level of physiological arousal to perform a task: Low arousal results in poor performance because you are not alert enough, medium arousal results in strong performance, and high arousal results in poor performance because you are too anxious. Linear trend: Quadratic trend: NONE NEGATIVE
  • 41. Quadratic & Higher Degrees • In adulthood, working memory declines the older you get (Park et al., 2002). Linear trend: Quadratic trend:
  • 42. Quadratic & Higher Degrees • In adulthood, working memory declines the older you get (Park et al., 2002). Linear trend: Quadratic trend: NONE NEGATIVE
  • 43. Quadratic & Higher Degrees • Aphasia is a neuropsychological disorder that disrupts speech, often resulting from a stroke. After initially acquiring aphasia, patients often experience rapid recovery in much of their language performance (dependent variable) as time (independent variable) increases. But, this recovery eventually slows down, and language performance doesn’t get much better no matter how much more time increases (e.g., Demeurisse et al., 1980). Linear trend: Quadratic trend:
  • 44. Quadratic & Higher Degrees • Aphasia is a neuropsychological disorder that disrupts speech, often resulting from a stroke. After initially acquiring aphasia, patients often experience rapid recovery in much of their language performance (dependent variable) as time (independent variable) increases. But, this recovery eventually slows down, and language performance doesn’t get much better no matter how much more time increases (e.g., Demeurisse et al., 1980). Linear trend: Quadratic trend: POSITIVE NEGATIVE
  • 45. Quadratic & Higher Degrees • Studies of practice and expertise (e.g., Logan, 1988) show that people learning to do a task—such as arithmetic—initially show a quick decrease in response time (dependent variable) as the amount of practice increases. However, eventually they hit the point where the task can’t possibly be done any faster, and response time reaches an asymptote and stops decreasing. Linear trend: Quadratic trend:
  • 46. Quadratic & Higher Degrees • Studies of practice and expertise (e.g., Logan, 1988) show that people learning to do a task—such as arithmetic—initially show a quick decrease in response time (dependent variable) as the amount of practice increases. However, eventually they hit the point where the task can’t possibly be done any faster, and response time reaches an asymptote and stops decreasing. Linear trend: Quadratic trend: NEGATIVE POSITIVE
  • 47. Quadratic & Higher Degrees • Could go up to even higher degrees (Time3, Time4…) • degree=3 if highest exponent is 3 • Degree minus 1 = Number of bends in the curve -100 -50 0 50 100 x^3 0 20 40 60 80 100 x^1 0 20 40 60 80 100 x^2 0 bends 1 bend 2 bends
  • 48. Quadratic & Higher Degrees • Maximum degree of polynomial: # of time points minus 1 • Example: 2 time points perfectly fit by a line (degree 1). Nothing left for a quadratic term to explain. • But, don’t want to overfit • Probably not the case that the real underlying (population) trajectory has 6 bends in it • What degree should we include? • Theoretical considerations • If comparing conditions, look at mean trajectory across conditions (Mirman et al., 2008)
  • 49. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 50. Child 2 Child 1 Child 3 Child 4 Child 1 Assess- ment 1 Child 2 Assess- ment 2 Child 3 Assess- ment 1 Child 3 Assess- ment 2 Sampled CHILDREN Sampled TIME POINTS LEVEL 2 LEVEL 1 • So far, we assume the same growth rate for all kids • Almost certainly not true! • At level 2, we’re sampling kids both with different starting points (intercepts) and growth rates (slopes) Longitudinal Data: Random Slopes Growth Rate 1 Growth Rate 2
  • 51. Longitudinal Data: Random Slopes RANDOM INTERCEPTS MODEL Kids vary in starting point, but all acquire vocabulary at the same rate over this period WITH RANDOM SLOPES Allows rate of vocab acquisition to vary across kids (as well as intercept)
  • 52. • Let’s allow the MonthsInStudy effect to be different for each Child • model.Slope <- lmer(VocabWords ~ 1 + poly(MonthsInStudy,degree=2,raw=TRUE) + (1 + poly(MonthsInStudy,degree=2,raw=TRUE)|Child), data=vocab.p) Longitudinal Data: Random Slopes Child 2 Child 1 Child 3 Child 4 Child 1 Assess- ment 1 Child 2 Assess- ment 2 Child 3 Assess- ment 1 Child 3 Assess- ment 2 Sampled CHILDREN Sampled TIME POINTS LEVEL 2 LEVEL 1 Growth Rate 1 Growth Rate 2
  • 53. Longitudinal Data: Random Slopes Substantial variability in the MonthsInStudy slope SD of the slope across children is ~5 words Mean slope is 11 words/mo, but some kids might have a slope of 6 or 16
  • 54. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 55. Time-Variant & -Invariant Variables • We may want to include other (experimental or observational) variables in a GCA model: • e.g., our reading intervention • MonthsInStudy + Reading • Effect of Reading invariant across time • Can only affect the intercept (parallel lines) • MonthsInStudy * Reading • Effect of Reading varies with time • Can affect intercept & slope
  • 56. Time-Variant & -Invariant Variables • Fixed-effect results with the interaction: e.g., Huttenlocher et al., 1991 Also results in faster vocab growth (amplifies + Time effect) Linear growth rate for “No” group: 8.4 words / month Linear growth rate for “Yes” group: 8.4 + 4.7 = 13.1 words / month Effect of reading at time 0 (intercept): ~6 words No effect on curvature (quadratic term)
  • 57. Time-Variant & -Invariant Variables • Can be either: • Time-Invariant Predictor: Same across all time points within a subject • e.g., our intervention, race/ethnicity • Level 2 variables • Time-Varying Predictor: Varies even within a subject, from one time point to another • e.g., hours of sleep, mood • Level-1 variable Child 2 Child 1 Child 1 Assess- ment 1 Child 2 Assess- ment 2 Sampled CHILDREN Sampled TIME POINTS LEVEL 2 LEVEL 1 • Since R automatically figures out what’s a level-1 vs. level-2 variable, we don’t have to do anything special for either kind of variable
  • 58. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab
  • 59. ! Another possibility (in general) is a qualitative change in the trajectory at some point in the range of time observed ! e.g., age of majority, public policy changes, etc. ! Include a breakpoint—a categorical variable that represents whether or not you’re above the point at which the change happens ! mydata %>% mutate(Year2015OrLater= ifelse(Year >= 2015, 1, 0))-> mydata ! New variable is: ! 0 before 2015 ! 1 for 2015 onwards Breakpoints
  • 60. ! Another possibility (in general) is a qualitative change in the trajectory at some point in the range of time observed ! e.g., age of majority, public policy changes, etc. ! Include a breakpoint—a categorical variable that represents whether or not you’re above the point at which the change happens Breakpoints Main effect of breakpoint only – single shift downward (or upward) but same slope Main effect of breakpoint & an interaction – slope also changes
  • 61. ! Can apply this technique to any continuous variables, not just time ! e.g., above/below the poverty line ! As with higher-order polynomials, be wary of overfitting the data ! Most effective if we have an a priori reason to expect a breakpoint somewhere ! Or, use cross-validation to support a more exploratory analysis Breakpoints
  • 62. Week 11.1: Growth Curve Analysis ! Overview ! Reshaping Data ! Growth Curve Analysis ! Time as a Predictor Variable ! Quadratic & Higher Degrees ! Random Slopes ! Time-Variant & -Invariant Variables ! Breakpoints ! Lab