SlideShare a Scribd company logo

Mixed Effects Models - Fixed Effect Interactions

This document provides information about a business course, including that there will be class on Labor Day and lab materials are available on Canvas. It discusses fixed effects in models and how to include them in R scripts. Predicted values from models are covered, along with using residuals to detect outliers and interpreting interactions between variables in models. The document provides examples of adding interaction terms to model formulas and interpreting the results.

1 of 29
Download to read offline
Course Business
! We will have class this coming Monday (Labor
Day)
! Lab materials on Canvas
! Follow-up on fixed effects – experimental vs.
observational variables
! No difference in how we include them in R script
! Difference is just in conclusions we can draw
Week 3.2: Fixed Effect Interactions
! Residuals
! Predicted Values & Residuals
! Using Residuals to Detect Outliers
! Interactions
! In the Model Formula
! Interpretation
! Lab
Predicted Values
• Last time, we focused on testing the
significance of effects
• But, model implies an predicted or fitted value
for each observation
=
Minutes
taken to
assemble
phone
Newcomers
+
Years of
Experience
Baseline
γ00
γ10x1i(j) γ20x2i(j)
E(Yi(j)) +
Predicted Values
• Last time, we focused on testing the
significance of effects
• But, model implies an predicted or fitted value
for each observation (“y hat”):
=
Minutes
taken to
assemble
phone
Newcomers
+
Years of
Experience
Baseline
γ00
γ10x1i(j) γ20x2i(j)
!
𝑌#(%) +
Predicted Values
• Last time, we focused on testing the
significance of effects
• But, model implies an predicted or fitted value
for each observation (“y hat”):
• What do we predict for a team with 1 newcomer
(x1=1) and 2 years experience (x2=2)?
=
Minutes
taken to
assemble
phone
Newcomers
+
Years of
Experience
Baseline
38.25 2.16x1i(j)
-0.10x2i(j)
+
!
𝑌#(%)
Predicted Values
• Last time, we focused on testing the
significance of effects
• But, model implies an predicted or fitted value
for each observation (“y hat”):
• What do we predict for a team with 1 newcomer
(x1=1) and 2 years experience (x2=2)?
=
Minutes
taken to
assemble
phone
Newcomers
+
Years of
Experience
Baseline
38.25 2.16 -0.20
+
!
𝑌#(%)

Recommended

Mixed Effects Models - Model Comparison
Mixed Effects Models - Model ComparisonMixed Effects Models - Model Comparison
Mixed Effects Models - Model ComparisonScott Fraundorf
 
Mixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsMixed Effects Models - Descriptive Statistics
Mixed Effects Models - Descriptive StatisticsScott Fraundorf
 
Mixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed EffectsMixed Effects Models - Fixed Effects
Mixed Effects Models - Fixed 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 - 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
 
Mixed Effects Models - Orthogonal Contrasts
Mixed Effects Models - Orthogonal ContrastsMixed Effects Models - Orthogonal Contrasts
Mixed Effects Models - Orthogonal ContrastsScott 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
 

More Related Content

What's hot

Mixed Effects Models - Random Slopes
Mixed Effects Models - Random SlopesMixed Effects Models - Random Slopes
Mixed Effects Models - Random SlopesScott 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 - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc ComparisonsMixed Effects Models - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc ComparisonsScott 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 - Growth Curve Analysis
Mixed Effects Models - Growth Curve AnalysisMixed Effects Models - Growth Curve Analysis
Mixed Effects Models - Growth Curve AnalysisScott 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 - Signal Detection Theory
Mixed Effects Models - Signal Detection TheoryMixed Effects Models - Signal Detection Theory
Mixed Effects Models - Signal Detection TheoryScott Fraundorf
 
GPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask LearnersGPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask LearnersYoung Seok Kim
 
Lecture 3: Semantic Role Labelling
Lecture 3: Semantic Role LabellingLecture 3: Semantic Role Labelling
Lecture 3: Semantic Role LabellingMarina Santini
 
Introduction to Transformers for NLP - Olga Petrova
Introduction to Transformers for NLP - Olga PetrovaIntroduction to Transformers for NLP - Olga Petrova
Introduction to Transformers for NLP - Olga PetrovaAlexey Grigorev
 
Software Testing and Quality Assurance (Error, Bug, Fault)
Software Testing and Quality Assurance (Error, Bug, Fault)Software Testing and Quality Assurance (Error, Bug, Fault)
Software Testing and Quality Assurance (Error, Bug, Fault)Yogesh Late
 
Attention is All You Need (Transformer)
Attention is All You Need (Transformer)Attention is All You Need (Transformer)
Attention is All You Need (Transformer)Jeong-Gwan Lee
 
Accessibility for hybrid mobile
Accessibility for hybrid mobileAccessibility for hybrid mobile
Accessibility for hybrid mobileBobby Bristol
 
NLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelNLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelHemantha Kulathilake
 
Topic 19 inequality stata
Topic 19 inequality stataTopic 19 inequality stata
Topic 19 inequality stataSizwan Ahammed
 
[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You Need[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You NeedDaiki Tanaka
 
Rでベイズをやってみよう!(コワい本1章)@BCM勉強会
Rでベイズをやってみよう!(コワい本1章)@BCM勉強会Rでベイズをやってみよう!(コワい本1章)@BCM勉強会
Rでベイズをやってみよう!(コワい本1章)@BCM勉強会Shushi Namba
 

What's hot (20)

Mixed Effects Models - Random Slopes
Mixed Effects Models - Random SlopesMixed Effects Models - Random Slopes
Mixed Effects Models - Random Slopes
 
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 - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc ComparisonsMixed Effects Models - Post-Hoc Comparisons
Mixed Effects Models - Post-Hoc Comparisons
 
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 - Growth Curve Analysis
Mixed Effects Models - Growth Curve AnalysisMixed Effects Models - Growth Curve Analysis
Mixed Effects Models - Growth Curve Analysis
 
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 - Signal Detection Theory
Mixed Effects Models - Signal Detection TheoryMixed Effects Models - Signal Detection Theory
Mixed Effects Models - Signal Detection Theory
 
GPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask LearnersGPT-2: Language Models are Unsupervised Multitask Learners
GPT-2: Language Models are Unsupervised Multitask Learners
 
Word2 vec
Word2 vecWord2 vec
Word2 vec
 
Lecture 3: Semantic Role Labelling
Lecture 3: Semantic Role LabellingLecture 3: Semantic Role Labelling
Lecture 3: Semantic Role Labelling
 
Introduction to Transformers for NLP - Olga Petrova
Introduction to Transformers for NLP - Olga PetrovaIntroduction to Transformers for NLP - Olga Petrova
Introduction to Transformers for NLP - Olga Petrova
 
Tutorial on word2vec
Tutorial on word2vecTutorial on word2vec
Tutorial on word2vec
 
Software Testing and Quality Assurance (Error, Bug, Fault)
Software Testing and Quality Assurance (Error, Bug, Fault)Software Testing and Quality Assurance (Error, Bug, Fault)
Software Testing and Quality Assurance (Error, Bug, Fault)
 
Attention is All You Need (Transformer)
Attention is All You Need (Transformer)Attention is All You Need (Transformer)
Attention is All You Need (Transformer)
 
Accessibility for hybrid mobile
Accessibility for hybrid mobileAccessibility for hybrid mobile
Accessibility for hybrid mobile
 
NLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language ModelNLP_KASHK:Evaluating Language Model
NLP_KASHK:Evaluating Language Model
 
Topic 19 inequality stata
Topic 19 inequality stataTopic 19 inequality stata
Topic 19 inequality stata
 
[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You Need[Paper Reading] Attention is All You Need
[Paper Reading] Attention is All You Need
 
Rでベイズをやってみよう!(コワい本1章)@BCM勉強会
Rでベイズをやってみよう!(コワい本1章)@BCM勉強会Rでベイズをやってみよう!(コワい本1章)@BCM勉強会
Rでベイズをやってみよう!(コワい本1章)@BCM勉強会
 

Similar to Mixed Effects Models - Fixed Effect Interactions

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
 
Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...
Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...
Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...Sangwoo Mo
 
Building Continuous Learning Systems
Building Continuous Learning SystemsBuilding Continuous Learning Systems
Building Continuous Learning SystemsAnuj Gupta
 
Data Science Interview Questions | Data Science Interview Questions And Answe...
Data Science Interview Questions | Data Science Interview Questions And Answe...Data Science Interview Questions | Data Science Interview Questions And Answe...
Data Science Interview Questions | Data Science Interview Questions And Answe...Simplilearn
 
Tempest in teapot
Tempest in teapotTempest in teapot
Tempest in teapotGaetan Lion
 
FE3.ppt
FE3.pptFE3.ppt
FE3.pptasde13
 
m2_2_variation_z_scores.pptx
m2_2_variation_z_scores.pptxm2_2_variation_z_scores.pptx
m2_2_variation_z_scores.pptxMesfinMelese4
 
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)Sherri Gunder
 
Principles of design of experiments (doe)20 5-2014
Principles of  design of experiments (doe)20 5-2014Principles of  design of experiments (doe)20 5-2014
Principles of design of experiments (doe)20 5-2014Awad Albalwi
 
[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...
[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...
[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...Taiji Suzuki
 
Meta Analysis in Agriculture by Aman Vasisht
Meta Analysis in Agriculture by Aman VasishtMeta Analysis in Agriculture by Aman Vasisht
Meta Analysis in Agriculture by Aman VasishtAman Vasisht
 
Thermal Expansion Lab ProjectThe data listed in Table 1 be
Thermal Expansion Lab ProjectThe data listed in Table 1 beThermal Expansion Lab ProjectThe data listed in Table 1 be
Thermal Expansion Lab ProjectThe data listed in Table 1 beGrazynaBroyles24
 
ODSC East 2020 : Continuous_learning_systems
ODSC East 2020 : Continuous_learning_systemsODSC East 2020 : Continuous_learning_systems
ODSC East 2020 : Continuous_learning_systemsAnuj Gupta
 
Admission in India
Admission in IndiaAdmission in India
Admission in IndiaEdhole.com
 
Design of Experiments
Design of Experiments Design of Experiments
Design of Experiments Furk Kruf
 
Random forest sgv_ai_talk_oct_2_2018
Random forest sgv_ai_talk_oct_2_2018Random forest sgv_ai_talk_oct_2_2018
Random forest sgv_ai_talk_oct_2_2018digitalzombie
 

Similar to Mixed Effects Models - Fixed Effect Interactions (20)

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
 
1015 track2 abbott
1015 track2 abbott1015 track2 abbott
1015 track2 abbott
 
1030 track2 abbott
1030 track2 abbott1030 track2 abbott
1030 track2 abbott
 
Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...
Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...
Challenging Common Assumptions in the Unsupervised Learning of Disentangled R...
 
Building Continuous Learning Systems
Building Continuous Learning SystemsBuilding Continuous Learning Systems
Building Continuous Learning Systems
 
Panel Data Models
Panel Data ModelsPanel Data Models
Panel Data Models
 
Data Science Interview Questions | Data Science Interview Questions And Answe...
Data Science Interview Questions | Data Science Interview Questions And Answe...Data Science Interview Questions | Data Science Interview Questions And Answe...
Data Science Interview Questions | Data Science Interview Questions And Answe...
 
Tempest in teapot
Tempest in teapotTempest in teapot
Tempest in teapot
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
FE3.ppt
FE3.pptFE3.ppt
FE3.ppt
 
m2_2_variation_z_scores.pptx
m2_2_variation_z_scores.pptxm2_2_variation_z_scores.pptx
m2_2_variation_z_scores.pptx
 
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
Ch17 lab r_verdu103: Entry level statistics exercise (descriptives)
 
Principles of design of experiments (doe)20 5-2014
Principles of  design of experiments (doe)20 5-2014Principles of  design of experiments (doe)20 5-2014
Principles of design of experiments (doe)20 5-2014
 
[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...
[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...
[ICLR2021 (spotlight)] Benefit of deep learning with non-convex noisy gradien...
 
Meta Analysis in Agriculture by Aman Vasisht
Meta Analysis in Agriculture by Aman VasishtMeta Analysis in Agriculture by Aman Vasisht
Meta Analysis in Agriculture by Aman Vasisht
 
Thermal Expansion Lab ProjectThe data listed in Table 1 be
Thermal Expansion Lab ProjectThe data listed in Table 1 beThermal Expansion Lab ProjectThe data listed in Table 1 be
Thermal Expansion Lab ProjectThe data listed in Table 1 be
 
ODSC East 2020 : Continuous_learning_systems
ODSC East 2020 : Continuous_learning_systemsODSC East 2020 : Continuous_learning_systems
ODSC East 2020 : Continuous_learning_systems
 
Admission in India
Admission in IndiaAdmission in India
Admission in India
 
Design of Experiments
Design of Experiments Design of Experiments
Design of Experiments
 
Random forest sgv_ai_talk_oct_2_2018
Random forest sgv_ai_talk_oct_2_2018Random forest sgv_ai_talk_oct_2_2018
Random forest sgv_ai_talk_oct_2_2018
 

More from Scott Fraundorf

Mixed Effects Models - Power
Mixed Effects Models - PowerMixed Effects Models - Power
Mixed Effects Models - PowerScott 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 - Level-2 Variables
Mixed Effects Models - Level-2 VariablesMixed Effects Models - Level-2 Variables
Mixed Effects Models - Level-2 VariablesScott Fraundorf
 

More from Scott Fraundorf (6)

Mixed Effects Models - Power
Mixed Effects Models - PowerMixed Effects Models - Power
Mixed Effects Models - Power
 
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 - Level-2 Variables
Mixed Effects Models - Level-2 VariablesMixed Effects Models - Level-2 Variables
Mixed Effects Models - Level-2 Variables
 
Scott_Fraundorf_Resume
Scott_Fraundorf_ResumeScott_Fraundorf_Resume
Scott_Fraundorf_Resume
 

Recently uploaded

Understanding the New PCHF Analysis Guidance
Understanding the New PCHF Analysis GuidanceUnderstanding the New PCHF Analysis Guidance
Understanding the New PCHF Analysis GuidanceSafetyChain Software
 
11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdfAynouraHamidova
 
ACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docxACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docxMaria Lucia Céspedes
 
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Aggregage
 
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
 
11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdfAynouraHamidova
 
BBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptx
BBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptxBBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptx
BBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptxProf. Kanchan Kumari
 
Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...
Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...
Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...AKSHAYMAGAR17
 
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.Florence Dayana
 
Biology 152 - Topic Statement - Boolean Search
Biology 152 - Topic Statement - Boolean SearchBiology 152 - Topic Statement - Boolean Search
Biology 152 - Topic Statement - Boolean SearchRobert Tomaszewski
 
spring_bee_bot_creations_erd primary.pdf
spring_bee_bot_creations_erd primary.pdfspring_bee_bot_creations_erd primary.pdf
spring_bee_bot_creations_erd primary.pdfKonstantina Koutsodimou
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...Nguyen Thanh Tu Collection
 
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...AKSHAYMAGAR17
 
Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)CaraSkikne1
 
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
 
Kartik Nair In Media Res Media Component
Kartik Nair In Media Res Media ComponentKartik Nair In Media Res Media Component
Kartik Nair In Media Res Media ComponentInMediaRes1
 
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...liera silvan
 

Recently uploaded (20)

CLUBE PERLINGUAS .
CLUBE PERLINGUAS                        .CLUBE PERLINGUAS                        .
CLUBE PERLINGUAS .
 
Understanding the New PCHF Analysis Guidance
Understanding the New PCHF Analysis GuidanceUnderstanding the New PCHF Analysis Guidance
Understanding the New PCHF Analysis Guidance
 
11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 10-2023-Aynura-Hamidova.pdf
 
ACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docxACTIVIDAD DE CLASE No 1 sopa de letras.docx
ACTIVIDAD DE CLASE No 1 sopa de letras.docx
 
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
Can Brain Science Actually Help Make Your Training & Teaching "Stick"?
 
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
 
11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf
11 CI SINIF SINAQLARI - 9-2023-Aynura-Hamidova.pdf
 
Advance Mobile Application Development class 04
Advance Mobile Application Development class 04Advance Mobile Application Development class 04
Advance Mobile Application Development class 04
 
BBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptx
BBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptxBBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptx
BBA 603 FUNDAMENTAL OF E- COMMERCE UNIT 1.pptx
 
Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...
Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...
Genetics, Heredity, Variation, history, its roles, Scope, Importance, and Bra...
 
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdfDr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
Dr.M.Florence Dayana-Cloud Computing-unit - 4.pdf
 
ThinkTech 2024 Prelims- U25 BizTech Quiz by Pragya
ThinkTech 2024 Prelims- U25 BizTech Quiz by PragyaThinkTech 2024 Prelims- U25 BizTech Quiz by Pragya
ThinkTech 2024 Prelims- U25 BizTech Quiz by Pragya
 
Biology 152 - Topic Statement - Boolean Search
Biology 152 - Topic Statement - Boolean SearchBiology 152 - Topic Statement - Boolean Search
Biology 152 - Topic Statement - Boolean Search
 
spring_bee_bot_creations_erd primary.pdf
spring_bee_bot_creations_erd primary.pdfspring_bee_bot_creations_erd primary.pdf
spring_bee_bot_creations_erd primary.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
BÀI TẬP BỔ TRỢ TIẾNG ANH 11 THEO ĐƠN VỊ BÀI HỌC - CẢ NĂM - CÓ FILE NGHE (GLOB...
 
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
Ideotype concept and climate resilient crop varieties for future- Wheat, Rice...
 
Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)Understanding Canada's international higher education landscape (2024)
Understanding Canada's international higher education landscape (2024)
 
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
 
Kartik Nair In Media Res Media Component
Kartik Nair In Media Res Media ComponentKartik Nair In Media Res Media Component
Kartik Nair In Media Res Media Component
 
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
EmpTech Lesson 7 - Online Creation Tools, Platforms, and Applications for ICT...
 

Mixed Effects Models - Fixed Effect Interactions

  • 1. Course Business ! We will have class this coming Monday (Labor Day) ! Lab materials on Canvas ! Follow-up on fixed effects – experimental vs. observational variables ! No difference in how we include them in R script ! Difference is just in conclusions we can draw
  • 2. Week 3.2: Fixed Effect Interactions ! Residuals ! Predicted Values & Residuals ! Using Residuals to Detect Outliers ! Interactions ! In the Model Formula ! Interpretation ! Lab
  • 3. Predicted Values • Last time, we focused on testing the significance of effects • But, model implies an predicted or fitted value for each observation = Minutes taken to assemble phone Newcomers + Years of Experience Baseline γ00 γ10x1i(j) γ20x2i(j) E(Yi(j)) +
  • 4. Predicted Values • Last time, we focused on testing the significance of effects • But, model implies an predicted or fitted value for each observation (“y hat”): = Minutes taken to assemble phone Newcomers + Years of Experience Baseline γ00 γ10x1i(j) γ20x2i(j) ! 𝑌#(%) +
  • 5. Predicted Values • Last time, we focused on testing the significance of effects • But, model implies an predicted or fitted value for each observation (“y hat”): • What do we predict for a team with 1 newcomer (x1=1) and 2 years experience (x2=2)? = Minutes taken to assemble phone Newcomers + Years of Experience Baseline 38.25 2.16x1i(j) -0.10x2i(j) + ! 𝑌#(%)
  • 6. Predicted Values • Last time, we focused on testing the significance of effects • But, model implies an predicted or fitted value for each observation (“y hat”): • What do we predict for a team with 1 newcomer (x1=1) and 2 years experience (x2=2)? = Minutes taken to assemble phone Newcomers + Years of Experience Baseline 38.25 2.16 -0.20 + ! 𝑌#(%)
  • 7. Predicted Values • Last time, we focused on testing the significance of effects • But, model implies an predicted or fitted value for each observation (“y hat”): • What do we predict for a team with 1 newcomer (x1=1) and 2 years experience (x2=2)? = Minutes taken to assemble phone 40.21 ! 𝑌#(%)
  • 8. Predicted Values • We can use our model to generate predictions for new data with the same variables • model1 %>% predict(newdataframe) • We can also find out what our model predicted for each of our current obesrvations • problemsolving %>% mutate(PredictedScore=fitted(model1)) -> problemsolving • Adds a PredictedScore column to the problemsolving dataframe Function that gets the fitted/predicted values from a model We need to specify a particular model here. These are the values predicted by a specific regression model.
  • 9. Predicted Values • We can use our model to generate predictions for new data with the same variables • model1 %>% predict(newdataframe) • We can also find out what our model predicted for each of our current observations This prediction was a little less accurate
  • 10. Residuals • How far off are our individual predictions? • Residuals: Difference between predicted & actual for a specific observation • “2% or 3% [market share] is what Apple might get.” – former Microsoft CEO Steve Ballmer on the iPhone • Actual iPhone market share (2014): 43% • Residual: 40 to 41 percentage points
  • 11. Residuals • How far off are our individual predictions? • Residuals: Difference between predicted & actual for a specific observation • + residual: Real observation was higher • - residual: Real observation was lower • problemsolving %>% mutate(Residual=resid(model1)) -> problemsolving Measured in original units (here, minutes)
  • 12. Week 3.2: Fixed Effect Interactions ! Residuals ! Predicted Values & Residuals ! Using Residuals to Detect Outliers ! Interactions ! In the Model Formula ! Interpretation ! Lab
  • 13. Outliers • One reason to be interested in residuals is that they can help us detect outliers • Concern that a few unusual observations may distort our results No outliers! Nice scatterplot with best-fitting regression line y = 3.00 + 0.5x (r = .82) Anscombe, 1973 Also best fit by: y = 3.00 + 0.5x (r = .82) But driven by one datapoint! Still best fit by: y = 3.00 + 0.5x (r = .82) But stronger relationship (r = 1.0!) is obscured by 1 outlier
  • 14. Residuals • Residuals can be one way to detect outlying observations • Outliers after accounting for all of the variables of interest • Multivariate outlier • Long RT might not be an outlier if slowest participant on slowest item
  • 15. Residuals • What threshold should we use? • Let’s put the residuals on a standard (z-scored) scale problemsolving %>% mutate(StdResidual=scale(resid(model1))) -> problemsolving
  • 16. Residuals • What threshold should we use? • Let’s put the residuals on a standard (z-scored) scale • problemsolving %>% mutate(StdResidual=scale(resid(model1))) -> problemsolving • “Number of standard deviations” we were off
  • 17. Residuals • What threshold should we use? • Now we can drop observations with too extreme a standardized residual • problemsolving %>% filter(abs(StdResidual) <= 3) -> problemsolving.NoOutliers • Keep only the observations with a standardized residual within ± 3 standard deviations • How many data points did we lose? • nrow(problemsolving) - nrow(problemsolving.NoOutliers) • Then, rerun your model
  • 18. How Should Outliers Change Interpretation? • Effect reliable with and without outliers? • Hooray! • Effect only seen with outliers included? • Suggests it’s driven by a few observations • Effect only seen if outliers removed? • Effect characterizes most of the data, but a few exceptions • No effect either way? • Weep softly at your desk
  • 19. Week 3.2: Fixed Effect Interactions ! Residuals ! Predicted Values & Residuals ! Using Residuals to Detect Outliers ! Interactions ! In the Model Formula ! Interpretation ! Lab
  • 20. Model Formulae: Interactions • A common question of interest is how two variables may interact or moderate each other • Does the effect of YearsExperience depend on how many Newcomers there are, or vice versa? • Let’s add an interaction to the model: • model2 <- lmer(MinutesTaken ~ 1 + Newcomers + YearsExperience + Newcomers:YearsExperience + (1|Company), data=problemsolving) • : means interaction
  • 21. Model Formulae: Interactions • A common question of interest is how two variables may interact or moderate each other • Does the effect of YearsExperience depend on how many Newcomers there are, or vice versa? • In this case, no significant interaction
  • 22. Model Formulae: Interactions • A shortcut! • 1 + Newcomers*YearsExperience • A * means the interaction plus all of the individual effects • For factorial experiments (where we include every combination of independent variables), usually what you want • Scales up to even more variables: Newcomers*YearsExperience*PositiveAffect • 3-way interaction, plus all 2-way interactions, plus all 1- way effects
  • 23. Model Formulae: Interactions • The interaction of A and B is defined as the special effect of combining A & B … over and above their individual effects • Thus, it does not make sense to discuss an interaction without including the individual effects • bad.model <- lmer(MinutesTaken ~ 1 + Newcomers:YearsExperience + (1|Company), data=problemsolving)
  • 24. Week 3.2: Fixed Effect Interactions ! Residuals ! Predicted Values & Residuals ! Using Residuals to Detect Outliers ! Interactions ! In the Model Formula ! Interpretation ! Lab
  • 25. Interpreting Interactions • In many cases, looking at a figure of the descriptive statistics will be most helpful for understanding • Good to do whenever you’re uncertain • Fixed effect estimates: • Test the statistical significance of interaction • Provide a numerical description
  • 26. Interpreting Interactions y =38 + 2.17*Newcomers -0.10*Experience + (-0.001*Newcomers*Experience) When would this decrease the DV the most? (most negative number) • When Newcomers is large • When YearsExperience is large Reduces the Newcomers effect (larger number = longer solve time) if team more experienced Increases the YearsExperience effect (larger number = longer solve time) if more newcomers
  • 27. Interpreting Interactions • Numerical interaction term tells us how the interaction works: • Strengthens individual effects with the same sign as the interaction • Weakens individual effects with a different sign as the interaction • Or, again, just look at the graph ☺
  • 28. Week 3.2: Fixed Effect Interactions ! Residuals ! Predicted Values & Residuals ! Using Residuals to Detect Outliers ! Interactions ! In the Model Formula ! Interpretation ! Lab
  • 29. Lab • Canvas: Modules # Week 3.2 • stroop.csv blue green yellow purple