SlideShare a Scribd company logo

Mixed Effects Models - Centering and Transformations

Lecture 11 from my mixed-effects modeling course: Centering and other transformations

1 of 45
Download to read offline
Course Business
• New R package to install: misty
• On Canvas for this week:
• New dataset we’ll cover in lecture: numerosity
• Lab materials
• Follow-up on last Wednesday
• Thanks for working with change in schedule
• Apologies for not having a larger lab available
Week 7.1: Centering & Transformations
! Centering
! Today’s Dataset
! Mean Centering
! Centering Around Other Values
! Logarithmic Transformation
! Grand-Mean vs. Cluster-Mean Centering
! Lab
Today’s Dataset
• Brain warmup – count the number of dots
5
10
12

Recommended

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 - 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 - 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 - Empirical Logit
Mixed Effects Models - Empirical LogitMixed Effects Models - Empirical Logit
Mixed Effects Models - Empirical LogitScott Fraundorf
 
Mixed Effects Models - Model Comparison
Mixed Effects Models - Model ComparisonMixed Effects Models - Model Comparison
Mixed Effects Models - Model ComparisonScott Fraundorf
 
Mixed Effects Models - Random Intercepts
Mixed Effects Models - Random InterceptsMixed Effects Models - Random Intercepts
Mixed Effects Models - Random InterceptsScott Fraundorf
 
Mixed Effects Models - Introduction
Mixed Effects Models - IntroductionMixed Effects Models - Introduction
Mixed Effects Models - IntroductionScott Fraundorf
 

More Related Content

What's hot

Mixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed EffectsMixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed EffectsScott Fraundorf
 
Mixed Effects Models - Random Slopes
Mixed Effects Models - Random SlopesMixed Effects Models - Random Slopes
Mixed Effects Models - Random SlopesScott Fraundorf
 
Mixed Effects Models - Growth Curve Analysis
Mixed Effects Models - Growth Curve AnalysisMixed Effects Models - Growth Curve Analysis
Mixed Effects Models - Growth Curve AnalysisScott Fraundorf
 
Mixed Effects Models - Crossed Random Effects
Mixed Effects Models - Crossed Random EffectsMixed Effects Models - Crossed Random Effects
Mixed Effects Models - Crossed Random EffectsScott Fraundorf
 
Mixed Effects Models - Data Processing
Mixed Effects Models - Data ProcessingMixed Effects Models - Data Processing
Mixed Effects Models - Data ProcessingScott 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 - Autocorrelation
Mixed Effects Models - AutocorrelationMixed Effects Models - Autocorrelation
Mixed Effects Models - AutocorrelationScott Fraundorf
 
Mixed Effects Models - Effect Size
Mixed Effects Models - Effect SizeMixed Effects Models - Effect Size
Mixed Effects Models - Effect SizeScott Fraundorf
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsScott Fraundorf
 
「操作変数法」の報告事例
「操作変数法」の報告事例「操作変数法」の報告事例
「操作変数法」の報告事例Yoshitake Takebayashi
 
ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)
ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)
ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)Dr. Hament Sharma
 
What is a one-way repeated measures ANOVA?
What is a one-way repeated measures ANOVA?What is a one-way repeated measures ANOVA?
What is a one-way repeated measures ANOVA?Ken Plummer
 
20161106予測指標の作り方セミナー事前学習
20161106予測指標の作り方セミナー事前学習20161106予測指標の作り方セミナー事前学習
20161106予測指標の作り方セミナー事前学習SR WS
 
Probability and Stochastic Processes - A Friendly Introduction for Electrical...
Probability and Stochastic Processes - A Friendly Introduction for Electrical...Probability and Stochastic Processes - A Friendly Introduction for Electrical...
Probability and Stochastic Processes - A Friendly Introduction for Electrical...CHIH-PEI WEN
 
RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05
RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05 RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05
RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05 Masaru Tokuoka
 
SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828
SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828
SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828Beckett Hsieh
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceAmit Sharma
 
One-way Repeated Measures MANOVA with SPSS
One-way Repeated Measures MANOVA with SPSSOne-way Repeated Measures MANOVA with SPSS
One-way Repeated Measures MANOVA with SPSSJ P Verma
 
The t Test for Two Independent Samples
The t Test for Two Independent SamplesThe t Test for Two Independent Samples
The t Test for Two Independent Samplesjasondroesch
 

What's hot (20)

Mixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed EffectsMixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed Effects
 
Mixed Effects Models - Random Slopes
Mixed Effects Models - Random SlopesMixed Effects Models - Random Slopes
Mixed Effects Models - Random Slopes
 
Mixed Effects Models - Growth Curve Analysis
Mixed Effects Models - Growth Curve AnalysisMixed Effects Models - Growth Curve Analysis
Mixed Effects Models - Growth Curve Analysis
 
Mixed Effects Models - Crossed Random Effects
Mixed Effects Models - Crossed Random EffectsMixed Effects Models - Crossed Random Effects
Mixed Effects Models - Crossed Random Effects
 
Mixed Effects Models - Data Processing
Mixed Effects Models - Data ProcessingMixed Effects Models - Data Processing
Mixed Effects Models - Data Processing
 
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 - Autocorrelation
Mixed Effects Models - AutocorrelationMixed Effects Models - Autocorrelation
Mixed Effects Models - Autocorrelation
 
Mixed Effects Models - Effect Size
Mixed Effects Models - Effect SizeMixed Effects Models - Effect Size
Mixed Effects Models - Effect Size
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive Statistics
 
「操作変数法」の報告事例
「操作変数法」の報告事例「操作変数法」の報告事例
「操作変数法」の報告事例
 
ANOVA II
ANOVA IIANOVA II
ANOVA II
 
ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)
ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)
ANOVA - BI FACTORIAL ANOVA (2- WAY ANOVA)
 
What is a one-way repeated measures ANOVA?
What is a one-way repeated measures ANOVA?What is a one-way repeated measures ANOVA?
What is a one-way repeated measures ANOVA?
 
20161106予測指標の作り方セミナー事前学習
20161106予測指標の作り方セミナー事前学習20161106予測指標の作り方セミナー事前学習
20161106予測指標の作り方セミナー事前学習
 
Probability and Stochastic Processes - A Friendly Introduction for Electrical...
Probability and Stochastic Processes - A Friendly Introduction for Electrical...Probability and Stochastic Processes - A Friendly Introduction for Electrical...
Probability and Stochastic Processes - A Friendly Introduction for Electrical...
 
RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05
RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05 RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05
RでMplusがもっと便利にーmplusAutomationパッケージー #Hiroshimar05
 
SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828
SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828
SEM(structural equation modeling)結構方程模型-潛在成長模型-三星統計張偉豪-20140828
 
Dowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inferenceDowhy: An end-to-end library for causal inference
Dowhy: An end-to-end library for causal inference
 
One-way Repeated Measures MANOVA with SPSS
One-way Repeated Measures MANOVA with SPSSOne-way Repeated Measures MANOVA with SPSS
One-way Repeated Measures MANOVA with SPSS
 
The t Test for Two Independent Samples
The t Test for Two Independent SamplesThe t Test for Two Independent Samples
The t Test for Two Independent Samples
 

Similar to Mixed Effects Models - Centering and Transformations

Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)Ryan Herzog
 
Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)Ryan Herzog
 
3. Statistical Analysis.pptx
3. Statistical Analysis.pptx3. Statistical Analysis.pptx
3. Statistical Analysis.pptxjeyanthisivakumar
 
probability.pptx
probability.pptxprobability.pptx
probability.pptxbisan3
 
Learning to Learn by Gradient Descent by Gradient Descent
Learning to Learn by Gradient Descent by Gradient DescentLearning to Learn by Gradient Descent by Gradient Descent
Learning to Learn by Gradient Descent by Gradient DescentKaty Lee
 
01 introduction stat
01 introduction stat01 introduction stat
01 introduction statantaraar2009
 
Measure of Variability Report.pptx
Measure of Variability Report.pptxMeasure of Variability Report.pptx
Measure of Variability Report.pptxCalvinAdorDionisio
 
Lect 3 background mathematics
Lect 3 background mathematicsLect 3 background mathematics
Lect 3 background mathematicshktripathy
 
Lect 3 background mathematics for Data Mining
Lect 3 background mathematics for Data MiningLect 3 background mathematics for Data Mining
Lect 3 background mathematics for Data Mininghktripathy
 
Foundations of Machine Learning - StampedeCon AI Summit 2017
Foundations of Machine Learning - StampedeCon AI Summit 2017Foundations of Machine Learning - StampedeCon AI Summit 2017
Foundations of Machine Learning - StampedeCon AI Summit 2017StampedeCon
 
Dataworkz odsc london 2018
Dataworkz odsc london 2018Dataworkz odsc london 2018
Dataworkz odsc london 2018Olaf de Leeuw
 

Similar to Mixed Effects Models - Centering and Transformations (20)

Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)
 
Topic 5 (multiple regression)
Topic 5 (multiple regression)Topic 5 (multiple regression)
Topic 5 (multiple regression)
 
3. Statistical Analysis.pptx
3. Statistical Analysis.pptx3. Statistical Analysis.pptx
3. Statistical Analysis.pptx
 
5954987.ppt
5954987.ppt5954987.ppt
5954987.ppt
 
Scaling and Normalization
Scaling and NormalizationScaling and Normalization
Scaling and Normalization
 
probability.pptx
probability.pptxprobability.pptx
probability.pptx
 
Learning to Learn by Gradient Descent by Gradient Descent
Learning to Learn by Gradient Descent by Gradient DescentLearning to Learn by Gradient Descent by Gradient Descent
Learning to Learn by Gradient Descent by Gradient Descent
 
Regression ppt
Regression pptRegression ppt
Regression ppt
 
PCA.pptx
PCA.pptxPCA.pptx
PCA.pptx
 
Unit 2 - Statistics
Unit 2 - StatisticsUnit 2 - Statistics
Unit 2 - Statistics
 
01 introduction stat
01 introduction stat01 introduction stat
01 introduction stat
 
1015 track2 abbott
1015 track2 abbott1015 track2 abbott
1015 track2 abbott
 
1030 track2 abbott
1030 track2 abbott1030 track2 abbott
1030 track2 abbott
 
Measure of Variability Report.pptx
Measure of Variability Report.pptxMeasure of Variability Report.pptx
Measure of Variability Report.pptx
 
SQLDay2013_MarcinSzeliga_DataInDataMining
SQLDay2013_MarcinSzeliga_DataInDataMiningSQLDay2013_MarcinSzeliga_DataInDataMining
SQLDay2013_MarcinSzeliga_DataInDataMining
 
15303589.ppt
15303589.ppt15303589.ppt
15303589.ppt
 
Lect 3 background mathematics
Lect 3 background mathematicsLect 3 background mathematics
Lect 3 background mathematics
 
Lect 3 background mathematics for Data Mining
Lect 3 background mathematics for Data MiningLect 3 background mathematics for Data Mining
Lect 3 background mathematics for Data Mining
 
Foundations of Machine Learning - StampedeCon AI Summit 2017
Foundations of Machine Learning - StampedeCon AI Summit 2017Foundations of Machine Learning - StampedeCon AI Summit 2017
Foundations of Machine Learning - StampedeCon AI Summit 2017
 
Dataworkz odsc london 2018
Dataworkz odsc london 2018Dataworkz odsc london 2018
Dataworkz odsc london 2018
 

Recently uploaded

Routes of Drug Administrations PPT..pptx
Routes of Drug Administrations PPT..pptxRoutes of Drug Administrations PPT..pptx
Routes of Drug Administrations PPT..pptxRenuka N Sunagad
 
2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptxMaryPotorti1
 
2.22.24 Black Nationalism and the Nation of Islam.pptx
2.22.24 Black Nationalism and the Nation of Islam.pptx2.22.24 Black Nationalism and the Nation of Islam.pptx
2.22.24 Black Nationalism and the Nation of Islam.pptxMaryPotorti1
 
SOCIAL JUSTICE LESSON ON CATCH UP FRIDAY
SOCIAL JUSTICE LESSON ON CATCH UP FRIDAYSOCIAL JUSTICE LESSON ON CATCH UP FRIDAY
SOCIAL JUSTICE LESSON ON CATCH UP FRIDAYGloriaRamos83
 
2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptx2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptxMaryPotorti1
 
IR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & TheoryIR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & Theorynivedithag131
 
DISCOURSE: TEXT AS CONNECTED DISCOURSE
DISCOURSE:   TEXT AS CONNECTED DISCOURSEDISCOURSE:   TEXT AS CONNECTED DISCOURSE
DISCOURSE: TEXT AS CONNECTED DISCOURSEMYDA ANGELICA SUAN
 
11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdfAynouraHamidova
 
Nzinga Kika - The story of the queen
Nzinga Kika    -  The story of the queenNzinga Kika    -  The story of the queen
Nzinga Kika - The story of the queenDeanAmory1
 
Creative, Technical, and Academic Writing
Creative, Technical, and Academic WritingCreative, Technical, and Academic Writing
Creative, Technical, and Academic WritingMYDA ANGELICA SUAN
 
UniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tourUniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tourUSC_Library
 
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTScatch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTSCarlaNicolas7
 
Diploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdf
Diploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdfDiploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdf
Diploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdfSUMIT TIWARI
 
Practical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptxPractical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptxKatherine Villaluna
 
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...EduSkills OECD
 
Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsIntuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsTushar Tank
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUSC_Library
 
Shapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley DiscussionShapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley DiscussionTushar Tank
 
New Features in the Odoo 17 Sales Module
New Features in  the Odoo 17 Sales ModuleNew Features in  the Odoo 17 Sales Module
New Features in the Odoo 17 Sales ModuleCeline George
 

Recently uploaded (20)

Routes of Drug Administrations PPT..pptx
Routes of Drug Administrations PPT..pptxRoutes of Drug Administrations PPT..pptx
Routes of Drug Administrations PPT..pptx
 
2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx2.20.24 The March on Washington for Jobs and Freedom.pptx
2.20.24 The March on Washington for Jobs and Freedom.pptx
 
2.22.24 Black Nationalism and the Nation of Islam.pptx
2.22.24 Black Nationalism and the Nation of Islam.pptx2.22.24 Black Nationalism and the Nation of Islam.pptx
2.22.24 Black Nationalism and the Nation of Islam.pptx
 
SOCIAL JUSTICE LESSON ON CATCH UP FRIDAY
SOCIAL JUSTICE LESSON ON CATCH UP FRIDAYSOCIAL JUSTICE LESSON ON CATCH UP FRIDAY
SOCIAL JUSTICE LESSON ON CATCH UP FRIDAY
 
2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptx2.20.24 Asian Americans and the Myth of the Model Minority.pptx
2.20.24 Asian Americans and the Myth of the Model Minority.pptx
 
IR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & TheoryIR introduction Introduction, Principle & Theory
IR introduction Introduction, Principle & Theory
 
DISCOURSE: TEXT AS CONNECTED DISCOURSE
DISCOURSE:   TEXT AS CONNECTED DISCOURSEDISCOURSE:   TEXT AS CONNECTED DISCOURSE
DISCOURSE: TEXT AS CONNECTED DISCOURSE
 
11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 5-2023-Aynura-Hamidova.pdf
 
Nzinga Kika - The story of the queen
Nzinga Kika    -  The story of the queenNzinga Kika    -  The story of the queen
Nzinga Kika - The story of the queen
 
Lipids as Biopolymer
Lipids as Biopolymer Lipids as Biopolymer
Lipids as Biopolymer
 
Creative, Technical, and Academic Writing
Creative, Technical, and Academic WritingCreative, Technical, and Academic Writing
Creative, Technical, and Academic Writing
 
UniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tourUniSC Moreton Bay Library self-guided tour
UniSC Moreton Bay Library self-guided tour
 
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTScatch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
catch-up-friday-ARALING PNLIPUNAN SOCIAL JUSTICE AND HUMAN RIGHTS
 
Diploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdf
Diploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdfDiploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdf
Diploma 2nd yr PHARMACOLOGY chapter 5 part 1.pdf
 
Practical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptxPractical Research 1: Nature of Inquiry and Research.pptx
Practical Research 1: Nature of Inquiry and Research.pptx
 
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
Andreas Schleicher - 20 Feb 2024 - How pop music, podcasts, and Tik Tok are i...
 
Intuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov ChainsIntuition behind Monte Carlo Markov Chains
Intuition behind Monte Carlo Markov Chains
 
UniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tourUniSC Fraser Coast library self-guided tour
UniSC Fraser Coast library self-guided tour
 
Shapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley DiscussionShapley Tech Talk - SHAP and Shapley Discussion
Shapley Tech Talk - SHAP and Shapley Discussion
 
New Features in the Odoo 17 Sales Module
New Features in  the Odoo 17 Sales ModuleNew Features in  the Odoo 17 Sales Module
New Features in the Odoo 17 Sales Module
 

Mixed Effects Models - Centering and Transformations

  • 1. Course Business • New R package to install: misty • On Canvas for this week: • New dataset we’ll cover in lecture: numerosity • Lab materials • Follow-up on last Wednesday • Thanks for working with change in schedule • Apologies for not having a larger lab available
  • 2. Week 7.1: Centering & Transformations ! Centering ! Today’s Dataset ! Mean Centering ! Centering Around Other Values ! Logarithmic Transformation ! Grand-Mean vs. Cluster-Mean Centering ! Lab
  • 3. Today’s Dataset • Brain warmup – count the number of dots
  • 4. 5
  • 5. 10
  • 6. 12
  • 7. 13
  • 8. Today’s Dataset • numerosity.csv: Looking at relation of math anxiety to basic number skills • Participants log in once a day on their smartphone to complete a dot-counting task • And, rate their math anxiety each time • 30 trials (one per day for a month) • Measures: • RT for each trial • NumDots in each display • Math Anxiety on a scale of 1 to 7
  • 9. Week 7.1: Centering & Transformations ! Centering ! Today’s Dataset ! Mean Centering ! Centering Around Other Values ! Logarithmic Transformation ! Grand-Mean vs. Cluster-Mean Centering ! Lab
  • 10. Interpreting Intercepts • Let’s start with examining the effect of numerosity (NumDots) on RT in the dot-counting task • At this stage, we don’t care about Anxiety • Common that spreadsheet contains extra, irrelevant columns • What would the maximal model for this be? • dotModel.Maximal <- lmer(RT ~ 1 + NumDots + (1 + NumDots|Subject) + data = numerosity) • Hint #1: NumDots is a within-subjects variable • Hint #2: Could there be a different effect of NumDots for each subject? SUBJECT RANDOM EFFECTS
  • 11. Interpreting Intercepts • Let’s start with examining the effect of numerosity (NumDots) on RT in the dot-counting task • At this stage, we don’t care about Anxiety • Common that spreadsheet contains extra, irrelevant columns • What would the maximal model for this be? • dotModel.Maximal <- lmer(RT ~ 1 + NumDots + (1 + NumDots|Subject) + data = numerosity) • Numerosity is manipulated within subjects (each subject sees several different display sizes) • Possible to calculate each subject’s personal NumDots effect (slope)—some subjects could count faster than othes • Include random slope
  • 12. Interpreting Intercepts • Let’s start with examining the effect of numerosity (NumDots) on RT in the dot-counting task • At this stage, we don’t care about Anxiety • Common that spreadsheet contains extra, irrelevant columns • Results: • Intercept: RT is 1690 ms when number of dots is 0 • NumDots effect: +9.4 ms for each dot • But, display size of 0 is impossible. Odd to talk about. y = 1690 + 9.4 * NumDots
  • 13. Interpreting Intercepts • Let’s change the model so that 0 means something Intercept: 1690 ms RT = 1690 ms + 8 * NumDots
  • 14. Mean Centering • Mean number of dots is ~67 • Imagine we subtracted this mean size from each display size • New zero represents mean display size • “Mean centering” ORIGINAL MEAN SUBTRACTED 102 67 58 35 0 -9
  • 15. Mean Centering • New zero represents mean display size • “Mean centering”
  • 16. Centering—How to Do It • First, create a new variable: • library(misty) • numerosity %>% mutate(NumDots.cen = center(NumDots)) -> numerosity • Then, use the new variable in your model • dotModel.cen.Maximal <- lmer(RT ~ 1 + NumDots.cen + (1 + NumDots.cen|Subject) + data = numerosity)
  • 17. • Old: New: • What hasn’t changed? • NumDots effect is still ~9.4 per dot • What has changed? • Intercept is 2323 ms at mean numerosity • Correlation of NumDots effect with intercept is now almost 0. Indicates that we centered correctly. • New model: y = 2323 + 9.4 * NumDots Centering—Results
  • 18. Centering—Results • Intercept: RT is 2094 ms at mean display size • NumDots effect: +8 ms for each additional dot Intercept: 2094 ms RT = 2094 ms + 8 * NumDots
  • 19. Which Do You Like Better? UNCENTERED CENTERED • Good if zero is meaningful • Years of study abroad, number of previous trials, number of missed classes… • Good if zero is not meaningful or not observed • Reduced correlation w/ intercept also helps with convergence (esp. in binomial models)
  • 20. Which Do You Like Better? • Both regression equations apply only to plausible number of dots • With raw number of dots, can’t have a numerosity of 0 or less • With centered number of dots, can’t have a value of -67 or less (0 minus the mean of 67)
  • 21. Week 7.1: Centering & Transformations ! Centering ! Today’s Dataset ! Mean Centering ! Centering Around Other Values ! Logarithmic Transformation ! Grand-Mean vs. Cluster-Mean Centering ! Lab
  • 22. Centering Around Other Values • We could also make 0 correspond to some other sensible/useful value • The smallest logically possible value • numerosity %>% mutate(NumDots2 = center(NumDots, value=1)) -> numerosity • The smallest observed value in our data • numerosity %>% mutate(NumDots3 = center(NumDots, value=min(NumDots)) -> numerosity
  • 23. Week 7.1: Centering & Transformations ! Centering ! Today’s Dataset ! Mean Centering ! Centering Around Other Values ! Logarithmic Transformation ! Grand-Mean vs. Cluster-Mean Centering ! Lab
  • 24. Logarithmic Transformations • Let’s look more closely at the relation between dots and RT… • Not totally linear…
  • 25. Logarithmic Transformations • Let’s look more closely at the relation between dots and RT… • Not totally linear… Most points below the line at small x values Most points above the line at larger x values
  • 26. Logarithmic Transformations • Let’s look more closely at the relation between dots and RT… • Not totally linear… • Effect “levels off” • Effect of adding 1 more dot is smaller when there are already a lot of dots • “Diminishing returns”
  • 28. Logarithmic Transformations • This type of non-linear relationship is well modeled by a logarithmic transformation • numerosity %>% mutate(NumDots.log = log(NumDots)) -> numerosity
  • 29. Logarithmic Transformations • This looks more linear • How can we compare the fit of these models? • Hint: We subtracted NumDots and added NumDots.log, so these are not nested models OLD NEW
  • 30. Logarithmic Transformations • This looks more linear • How can we compare the fit of these models? • Hint: We subtracted NumDots and added NumDots.log, so these are not nested models • anova(dotModel.Maximal, dotModel.log.Maximal) Model with log(NumDos) has lower (better) AIC and BIC
  • 31. Logarithmic Transformations • Logarithmic relationships pervasive • Many aspects of perception (Fechner and Weber laws) • Many aspects of experience • Dose-response • Income
  • 32. Logarithmic Transformations • Logarithmic relationships pervasive • Many aspects of perception (Fechner and Weber laws) • Many aspects of experience • Dose-response • Income • If you want to center, apply the log transform first, then center • Otherwise, the final variable will not be centered • Idea is that the “true” variable has a log scale, so we want to center around that mean
  • 33. Logarithmic Transformations • When to apply a transformation? • We have an a priori reason to expect a logarithmic (or other) relationship • e.g., some well-studied variable, like loudness or word frequency • Empirically based on the observed relationship to the DV • But beware of overfitting!
  • 34. Week 7.1: Centering & Transformations ! Centering ! Today’s Dataset ! Mean Centering ! Centering Around Other Values ! Logarithmic Transformation ! Grand-Mean vs. Cluster-Mean Centering ! Lab
  • 35. • Let’s turn to the effects of math anxiety • Remember that people provided a different Anxiety rating on each of the 30 days (trials) • Is this a level-1 or level-2 variable? Grand-Mean vs. Cluster-Mean Centering Day 1 Day 2 Day 3 Day 4 Subject 1 Subject 2 Subjects (Level-2) Trials (Level-1)
  • 36. • What mean to use to center a level-1 variable? • Grand mean?: 2.23 Grand-Mean vs. Cluster-Mean Centering
  • 37. • What mean to use to center a level-1 variable? • Grand mean?: 2.23 • But individual subject means differ a lot… • Subject 1: 1.97, Subject 11: 5.03, Subject 2: 4.03 Grand-Mean vs. Cluster-Mean Centering
  • 38. • Both sources of variation may be relevant • Grand-mean centering: Are you more or less math- anxious compared to the average person (2.23)? • Trait anxiety • Cluster-mean centering: Are you more or less math-anxious on this day compared to your average (for subject 2: 4.03)? • State anxiety Grand-Mean vs. Cluster-Mean Centering
  • 39. • Centering a level-1 variable “smushes” together these two sources of variance (Hoffman, 2015, 2019) • How the cluster differs from the grand mean • How the observation differs from the cluster mean • A better approach is to track these two influences separately • numerosity %>% mutate(TraitAnxiety = center(Anxiety, type='CGM', group=Subject)) -> numerosity • Center around the grand mean (a level-2 variable) • numerosity %>% mutate(StateAnxiety = center(Anxiety, type='CWC', group=Subject)) -> numerosity • Center around the cluster mean (a level-1 variable) Grand-Mean vs. Cluster-Mean Centering
  • 40. • Then, include both of these in the model • model.Anxiety <- lmer(RT ~ 1 + TraitAnxiety + StateAnxiety + (1|Subject), data=numerosity) • model.Anxiety %>% summary() • Can also include a random slope for the level-1 variable (StateAnxiety) Grand-Mean vs. Cluster-Mean Centering
  • 41. • Possible to have one effect, but not the other • Trait effect but not a state effect • Could reflect another individual difference (math skill?) Grand-Mean vs. Cluster-Mean Centering People with more trait anxiety have longer RTs Within a person, state anxiety does not predict RT
  • 42. • Possible to have one effect, but not the other • Trait effect but not a state effect • Could reflect another individual difference (math skill?) • State effect but not a trait effect • What matters is where you are relative to your norms Grand-Mean vs. Cluster-Mean Centering Location of the person mean does not matter Correlation within a person
  • 43. • Possible to have one effect, but not the other • Trait effect but not a state effect • Could reflect another individual difference (math skill?) • State effect but not a trait effect • What matters is where you are relative to your norms • Or both! Grand-Mean vs. Cluster-Mean Centering Correlation within a person People with more trait anxiety have longer RTs
  • 44. • Conclusions: • For level-1 variables, want to consider both between- and within- cluster ariation • This does not matter: • For level-2 variables (e.g., no within-person slope for IQ or math class GPA) • No within-cluster variance • Every cluster has the same mean (e.g., experimental manipulation like NumDots) • No between-cluster variance Grand-Mean vs. Cluster-Mean Centering
  • 45. Week 7.1: Centering & Transformations ! Centering ! Today’s Dataset ! Mean Centering ! Centering Around Other Values ! Logarithmic Transformation ! Grand-Mean vs. Cluster-Mean Centering ! Lab