SlideShare a Scribd company logo
1 of 104
Download to read offline
A moderated view of the
linear model
Linear mixed models
Part II
Marcello Gallucci
University of Milano-Bicocca
GLM
When the assumptions are NOT met because the data, and thus
the errors, have more complex structures, we generalize the GLM
to the Linear Mixed Model
Linear Mixed Model
Regressione
T-test
ANOVA
ANCOVA
Moderazione
Mediazione
Path Analysis
Regressione
Logistica
GLM
Regression
T-test
ANOVA
ANCOVA
Moderation
Mediation
Path Analysis
LMM
Random coefficients models
Random intercept regression models
One-way ANOVA with random effects
One-way ANCOVA with random effects
Intercepts-and-slopes-as-outcomes models
Multi-level models
The mixed model
Overall model
Random
coefficients
Fixed coefficient
A GLM which contains both fixed and
random effects is called a
Linear Mixed Model
We can now define a model with a regression for each cluster
and the mean values of coefficients
̂
yij=̄
a+ a' j+ ̄
b⋅xij+ b' j⋅xij
The mixed model
In practice, mixed models allow to estimate the kind of effects
we can estimate with the GLM, but they allow the effects to vary
across clusters.
Effects that vary across clusters are called random effects
Effects that do not vary (the ones that are the same across
clusters) are said to be fixed effects
Building a model
To build a model in a simple way, we need to answer very few
questions:
What is (are) the cluster variable(s)?
What are the fixed effects?
What are the random effects?
Software
SPSS R
Jamovi
www.jamovi.org
Repeated Measures Anova as
a linear mixed model
A repeated measures design
trial
1 2 3 4 5
Participants 1 Y11 Y21 Y31 Y41 Y51
2 Y12 Y22 Y32 Y42 Y52
3 Y13 Y23 Y33 Y43 Y53
N Y1n Y2n Y3n Y4n Y5n
….
Consider now a classical repeated measures design (within-
subjects) the levels of the WS IV (5 different trials) are
represented by different measures taken on the same person
Standard file format
As for many applications of the repeated-measure design, each
level of the WS-factor is represented by a column in the file
One participant,
one row
Long file format
For the mixed model we need to tabulate the data as if they
came from a between-subject design
One measure,
one row
Participant scores
Plot for 1
participant
Averages of the
sample (fixed effect)
Participant
scores
Participant
average trait
Where does the score come from?
Plot for 1
participant
Averages of the
sample (fixed effect)
Participant
average trait
Participant component
Plot for 1
participant
Averages of the
sample (fixed effect)
Participant
individual trait
fixed effect
individual
trait
random
error
Solution
Thus, we should consider an extra residual term which represents
participants individual characteristic. This term is the same within
each participant
Y11=a+ b1⋅T1+ u1+ e11
......
Each score,
one residual
Each score,
one error
Y 21=a+ b2⋅T2+ u1+ e21
Y 31=a+ b3⋅T 3+ u1+ e31
Y1j=a+ b1⋅T1+ u j+ e1j
Y 2j=a+ b2⋅T2+ u j+ e2j
Y 3j=a+ b3⋅T 3+ u j+ e3j
We assume the 5 trials are dummy coded
one participant
one trait
One participant
one trait
Average effects
of trials
Participant component
b5
u1
e51
Y 51=a+ b⋅T 5+ u1+ e51
Building the model
We translate this in the standard mixed model
yij=̄
a+aj+̄
b⋅xij+eij
Fixed effects? Intercept and trial effect
Random effects? Intercepts
Clusters? participants
Yij=a+b'⋅Ti+uj+eij
SPSS: General mixed models
Here we put the variable
which specifies to which
participant the measure
belongs to
Here we do not put
anything: repeated
measures are modelled
as random effects
SPSS: General mixed models
Independent and
dependent variables like
in GLM
SPSS: General mixed models
Here we say we want to
estimate the fixed effect
of trial (effects on the
means)
SPSS: General mixed models
Here we do not put any
variable, because there is
no variable with random
effects
We say that we want the
intercept to be random
We say that the cluster
variable is “id”
SPSS: General mixed models
The model is as intended
SPSS: General mixed models
Interpreting the effects
As in GLM (Anova). We interpret the main effect looking at the
means
Means of the 5
trials
Fixed effects
Dependency of scores
We can quantify the dependency of scores within clusters
(participants) by computing the intra-class correlation
σa
σ
ICR=
σa
σa+σ
Dependency of scores
We can quantify the dependency of scores within clusters
(participants) by computing the intra-class correlation
σa
σ
ICR=
.0078
.0078+.0302
=.205
GAMLj: mixed models
Variables
Options
GAMLj: mixed models
Categorical independent
variable
Clustering variable(s)
GAMLj: random coefficients
Random intercepts
All possible random
coefficients
GAMLj: fixed coefficients
Fixed effect
All possible fixed
coefficients
GAMLj: Results: model
R-squared
R-squared Marginal: How much
variance can the fixed effects
alone explain of the overall
variance
R-squared Conditional: How
much variance can the fixed and
random effects together explain
of the overall variance
GAMLj: Results: random
Variance of intercepts
As long as the variance is non-
zero, we are fine
GAMLj: Results: fixed
F-tests
Coefficients
Contrasts used to cast
the categorical IV
GAMLj: plot
Fixed effect to plot
Options
GAMLj: plot
GAMLj: post-hoc
As in GLM (Anova), sometimes we want to compares
conditions using post-hoc tests. GAMLj allows for Bonferroni
and Holm (more liberal) p-value adjustement
GAMLj: post-hoc
The interpretation follows as for any standard ANOVA
Between and Repeated Measures Anova
linear mixed model
Standard design
There are two groups - a Control group and a Treatment group,
measured at 4 times. These times are labeled as 1 (pretest), 2
(one month posttest), 3 (3 months follow-up), and 4 (6 months
follow-up).
The dependent variable is a depression score (e.g. Beck
Depression Inventory) and the treatment is drug versus no drug.
If the drug worked about as well for all subjects the slopes
would be comparable and negative across time. For the control
group we would expect some subjects to get better on their own
and some to stay depressed, which would lead to differences in
slope for that group (*)
*) https://www.uvm.edu/~dhowell/StatPages/More_Stuff/Mixed-Models-Repeated/Mixed-Models-for-Repeated-Measures1.html
Standard design
There are two groups - a Control group and a Treatment group,
measured at 4 times. These times are labeled as 1 (pretest), 2
(one month posttest), 3 (3 months follow-up), and 4 (6 months
follow-up).
*) https://www.uvm.edu/~dhowell/StatPages/More_Stuff/Mixed-Models-Repeated/Mixed-Models-for-Repeated-Measures1.html
96 observations
24 subjects
Standard design: data
Data are in the long format
One subject 4 rows
Mixed model
We can translate this in a standard mixed model
Fixed effects? Intercept and group,time, and interaction effect
Random effects? Intercepts
Clusters? subjects
Variables
Definition of the analysis
Clustering variable
Model
Definition of the analysis
Fixed effects
Random effects
Results
Interpretation of results
Model
Random effects
Results
Interpretation of results
Fixed F-tests
For the moment we ignore the coefficients of the parameter
estimates
Results: plot
Interpretation of results
Red is the control group
Probing the results
We can probe the interaction (and the pattern of means) in
different ways (all available in GAMLj):
Simple effects: Test if the effects of time is there (and how
strong it is) for different groups
Trend analysis: Checking the polynomial trend for time in
general and for different groups
Post-hoc test: not nice, but doable
Simple effect analysis
Simple Effects
Simple effects are effects of one variable evaluated at one level of
the other variable (like simple slopes for continuous variables)
A1 A2 A3 Totals
B1 E
B2 E
B3 E
Totals
Is the effect of B for A1 different from zero?
Is there an
effect here?
Simple Effects
Simple effects are effects of one variable evaluated at one level of
the other variable (like simple slopes for continuous variables)
Is the effect of B for A2 different from zero?
A1 A2 A3 Totals
B1 E
B2 E
B3 E
Totals
Is there an
effect here?
Simple Effects
Simple effects are effects of one variable evaluated at one level of
the other variable (like simple slopes for continuous variables)
A1 A2 A3 Totals
B1 E
B2 E
B3 E
Totals
Is the effect of B for A3 different from zero?
Is there an
effect here?
Simple effects
Interpretation of results Is there an
effect here?
Is there an
effect here?
Simple effects
We should declare which is the variable we want the effect for
and which is the moderator
Effects of time for
different groups
Simple effects
We can say that the treatment works for both groups, although
in a different way (recall the interaction)
In both groups there is an affect of time
Trend analysis
Polynomial Contrasts
Trend analysis is based on Polynomial contrasts: each
contrast features weights which follow well-known shapes
(polynomial functions)
-3
-2
-1
0
1
2
3
T1 T2 T3 T4
Linear
Quadratic
Cubic
L=−3 −1 1 3 
Q=−1 1 1 −1 
C=−1 2 −2 1 
Trend analysis
●
It is useful to test what kind of trend is present in the pattern of
means
●
It can be applied to any ordered categorical variables
●
It is often used (and SPSS gives it by default) in repeated
measures analysis
●
One can estimate K-1 trends (linear, quadratic, cubic etc),
where K is the number of means (conditions)
Trend analysis
●
Each trend (linear, quadratic, etc) tests a particular shape of the
mean pattern
Linear: on average means go down (or
up, not flat)
Trend analysis
●
Each trend (linear, quadratic, etc) tests a particular shape of the
mean pattern
Quadratic: on average means go down
and then up
Trend analysis
●
Each trend (linear, quadratic, etc) tests a particular shape of the
mean pattern
Cubic: on average means fluctuate
Trend analysis
●
Each significant trend justifying interpreting a particular
characteristic of the mean pattern
GAMLj:Trend analysis
●
First, we should code the categorical variable “time” as a
polynomial contrast
●
We can leave “group” as deviation (default) which means
“centered contrasts”
GAMLj:Trend analysis
●
Second, look at the parameter estimates
Contrast labels
Contrast average
effects
Contrast interaction with group
GAMLj:Trend analysis
●
Average effects of the contrasts
The pattern (on average) shows all
three trends:
1. it goes down (linear)
2. it tend to go down and then up
3. if fluctuates a bit
GAMLj:Trend analysis
●
Trend analysis by group
Those tell us if the trend is
different between the two groups:
Linear: no
Quadratic: yes
Cubib: no
Both groups decreases
Group 2 curve is stronger
They both fluctuates a bit
GAMLj:Trend analysis
●
Trend analysis by group
Those tell us if the trend is
different between the two groups:
Linear: no
Quadratic: yes
Cubic: mild
Both groups decreases
One group has a stronger curve
They both fluctuates a bit
GAMLj:Trend analysis
Those tell us if the trend is
different between the two groups:
Linear: no
Quadratic: yes
Cubic: mild
Both groups decreases
Group 2 curve is stronger
The fluctuation is similar
GAMLj:Trend analysis
●
Simple effects trend analysis: We can now look at the
parameters of the simple effects analysis
Time1: linear
Time2: quadratic
Time3: cubic
●
In group 1 there’s only a linear trend
●
In group 2 all three trend are there
GAMLj:Trend analysis
●
Simple effects trend analysis: We can now interpret the
parameters of the simple effects analysis
●
In group 1 there’s only a linear trend
●
In group 2 all three trends are there
Interactions between
continuous variables
Two continuous variables
In the multiple regression we have seen, lines are parallels, making a
flat surface
The effect of one IV is constant (the same) for each level of the other
IV
Interactions lines
Interaction: Lines are not parallel
The effect of one IV is different for each level of the other IV
Interactions line
The bigger the interaction, the less parallel the lines: Bigger difference
in the slopes
Interactions line
The bigger the interaction, the less parallel the lines: Bigger difference
in the slopes
Multiplicative effect
The interaction effect is captured in the regression by a multiplicative
term
̂
yi=a+ b1⋅x1+ b2⋅x2+ bint x1 x2
The product of the two
independent variables
̂
yi=a+(b1+ bint x2)⋅x1+ b2⋅x2
The coefficient of x1 is changing as x2 changes
The effect of one IV changes at different levels of
the other IV
Conditional effect
We say that the effect of one IV is conditional to the level of the other
IV
CITS
100
80
60
40
20
0
SALARY
80000
70000
60000
50000
40000
Women
Men
For Women (0) the
slope is different
…than for Men (1)
̂
yi=a+(b2+ bint0)⋅x2+ b1⋅0
̂
yi=a+(b2+ bint1)⋅x2+ b1⋅1
Conditional vs linear effect
A linear effect (when no interaction is present) tells you how much
change there is in the DV when you change the IV
An interaction effect (the B of the product term) tells you how much
change there is in the effect of one IV on the DV when you change the
other IV
Change in the DV
Change in the DV
Change in the effect
̂
yi=a+ b1⋅x1+ b2⋅x2+ bint x1 x2
̂
yi=a+(b1+ bint x2)⋅x1+ b2⋅x2
Terminology
When there is an interaction term in the equation, one refers to the
linear effect (the ones that are not interactions) as the first-order effect
First order effects
̂
yi=a+ b1⋅x1+ b2⋅x2+ bint x1 x2
First-order effects with interaction
When the interaction is in the regression, the first order effects become
the effect of the IV while keeping the other IV’s constant to zero
Effect of X2 for X1=0
Effect of X1 for X2=0
̂
yi=a+ b1⋅x1+ b2⋅0+ bint x10=a+ b1⋅x1
Making zero meaningful
We can always make zero a meaningful value by centering the variables
before computing the product term:
c=x1−̄
x1
For each participant, compute a
new variable as the old minus
the average
The new variable has mean=0
0 Mean=10 20
x1
Centering
The first-order effects computed on centered variables represent the
average effect (the one in the middle) of the IV, across all levels of the
other IV
Effect of x2 for x1=0
Effect of x1 for x2=0
Simple slope analysis
We can study the interaction by evaluating the effect of one
independent variables for low (-1 SD), average (Mean), and high (+1
SD) levels of the moderator
We pick three lines out of many in the regression plane, and plot them
Average effect
+1 SD
-1 SD
Simple slope analysis
We represent them in two dimensions
+1 SD X2
Ave. X2
-1 DS X2
+1 SD X2
-1 SD X2
Avera. X2
Example
50 different school classes were assessed
on students reading ability and self-
efficacy. In each class, the teacher was
assessed as well for her/his self-efficacy.
1182 subjects
50 school clasess
Example
Efficacy and reading ability
varies from participant to
participant, whereas teaching
efficacy varies from class to
class, but not within each class
Example
We want to use a mixed model to take into the account the school class
clustering effect
^
SE=a+b1 REA+b2 TE+b3TE⋅REA
We wish to estimate the effect of reading ability to participants self-
efficacy, the effect of teacher efficacy and the interaction between reading
ability and teacher efficacy
Mixed model
We can translate this in a standard mixed model
Fixed effects? Intercept and read ,teacher, and interaction
effect
Random effects? Intercepts read effect
Clusters? School class
^
SE=a+b1 REA+b2 TE+b3TE⋅REA
Example jamovi
First we define the variables in the model and their role
Example: fixed effects
We define the fixed effects in the model
Main effects and interactions
Example: random effects
We define the random effects in the model
Main that can be computed within each
school class
Results: model recap
R-squared measures
Results: model fixed effects
F-tests and p-values: we interpret them as any regression with interaction
Results: model fixed effects
B coefficients and p-values: To interpret the linear effects we should know the
meaning zero of the independent variable: jamovi centers the independent
variable by default
Linear effects are average effects
B coefficients
Centering IV
Jamovi by default centers the IVs to their means, but different options are
available
Centered: centered using total sample mean
Cluster-based centered: centered using each cluster mean
Standardized: using mean and standard deviation of the total sample
Cluster-based Standardized: using means and standard deviations of each
cluster
Simple slope analysis
Estimating the effect of one independent variable (read) at different levels of
the moderator (teachefficacy) and make a plot
Simple slope analysis
Estimating the effect of one independent variable (read) at different levels of
the moderator (teachefficacy) and make a plot
Simple slope analysis
One can add confidence bands: confidence intervals for continuous predicted
values
At the moment, the moderator is set to +1SD, mean, -1SD. More options will
be added in the future
Simple slope analysis
Estimating the effect of one independent variable (read) at different levels of
the moderator (teachefficacy) and test the effects
Simple slope analysis
Estimating the effect of one independent variable (read) at different levels of
the moderator (teachefficacy) and test the effects
At the moment, the moderator is set to +1SD, mean, -1SD. More options will
be added in the future
Simple slope analysis
Estimating the effect of one independent variable (read) at different levels of
the moderator (teachefficacy) and test the effects
At the moment, the moderator is set to +1SD, mean, -1SD. More options will
be added in the future
B coefficients
Questions
How many clusters, how many scores within cluster
Convergences
Multiple classifications
• Subjects by items design
The end

More Related Content

Similar to mix2.pdf

Whats New in SigmaXL Version 8
Whats New in SigmaXL Version 8Whats New in SigmaXL Version 8
Whats New in SigmaXL Version 8John Noguera
 
General Linear Model | Statistics
General Linear Model | StatisticsGeneral Linear Model | Statistics
General Linear Model | StatisticsTransweb Global Inc
 
Mixed Model Analysis for Overdispersion
Mixed Model Analysis for OverdispersionMixed Model Analysis for Overdispersion
Mixed Model Analysis for Overdispersiontheijes
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spssDr Nisha Arora
 
ANOVA Lec 1 (alternate).pptx
ANOVA Lec 1 (alternate).pptxANOVA Lec 1 (alternate).pptx
ANOVA Lec 1 (alternate).pptxMohsinIqbalQazi
 
SURE Model_Panel data.pptx
SURE Model_Panel data.pptxSURE Model_Panel data.pptx
SURE Model_Panel data.pptxGeetaShreeprabha
 
Probability distribution Function & Decision Trees in machine learning
Probability distribution Function  & Decision Trees in machine learningProbability distribution Function  & Decision Trees in machine learning
Probability distribution Function & Decision Trees in machine learningSadia Zafar
 
Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02Stephen Ong
 
Overview of Multivariate Statistical Methods
Overview of Multivariate Statistical MethodsOverview of Multivariate Statistical Methods
Overview of Multivariate Statistical MethodsThomasUttaro1
 
Logistic regression vs. logistic classifier. History of the confusion and the...
Logistic regression vs. logistic classifier. History of the confusion and the...Logistic regression vs. logistic classifier. History of the confusion and the...
Logistic regression vs. logistic classifier. History of the confusion and the...Adrian Olszewski
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis pptElkana Rorio
 
goodness of fit in ordinal regression.pdf
goodness of fit in ordinal regression.pdfgoodness of fit in ordinal regression.pdf
goodness of fit in ordinal regression.pdfHenokBuno
 
Statistics in research
Statistics in researchStatistics in research
Statistics in researchBalaji P
 

Similar to mix2.pdf (20)

Whats New in SigmaXL Version 8
Whats New in SigmaXL Version 8Whats New in SigmaXL Version 8
Whats New in SigmaXL Version 8
 
General Linear Model | Statistics
General Linear Model | StatisticsGeneral Linear Model | Statistics
General Linear Model | Statistics
 
Mixed Model Analysis for Overdispersion
Mixed Model Analysis for OverdispersionMixed Model Analysis for Overdispersion
Mixed Model Analysis for Overdispersion
 
7. logistics regression using spss
7. logistics regression using spss7. logistics regression using spss
7. logistics regression using spss
 
ANOVA Lec 1 (alternate).pptx
ANOVA Lec 1 (alternate).pptxANOVA Lec 1 (alternate).pptx
ANOVA Lec 1 (alternate).pptx
 
Arellano bond
Arellano bondArellano bond
Arellano bond
 
SURE Model_Panel data.pptx
SURE Model_Panel data.pptxSURE Model_Panel data.pptx
SURE Model_Panel data.pptx
 
Data analysis
Data analysisData analysis
Data analysis
 
Optimization
OptimizationOptimization
Optimization
 
Probability distribution Function & Decision Trees in machine learning
Probability distribution Function  & Decision Trees in machine learningProbability distribution Function  & Decision Trees in machine learning
Probability distribution Function & Decision Trees in machine learning
 
anova.ppt
anova.pptanova.ppt
anova.ppt
 
anova.ppt
anova.pptanova.ppt
anova.ppt
 
anova.ppt
anova.pptanova.ppt
anova.ppt
 
Factorial Experiments
Factorial ExperimentsFactorial Experiments
Factorial Experiments
 
Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02Mba2216 week 11 data analysis part 02
Mba2216 week 11 data analysis part 02
 
Overview of Multivariate Statistical Methods
Overview of Multivariate Statistical MethodsOverview of Multivariate Statistical Methods
Overview of Multivariate Statistical Methods
 
Logistic regression vs. logistic classifier. History of the confusion and the...
Logistic regression vs. logistic classifier. History of the confusion and the...Logistic regression vs. logistic classifier. History of the confusion and the...
Logistic regression vs. logistic classifier. History of the confusion and the...
 
Regression analysis ppt
Regression analysis pptRegression analysis ppt
Regression analysis ppt
 
goodness of fit in ordinal regression.pdf
goodness of fit in ordinal regression.pdfgoodness of fit in ordinal regression.pdf
goodness of fit in ordinal regression.pdf
 
Statistics in research
Statistics in researchStatistics in research
Statistics in research
 

More from dawitg2

bacterial plant pathogen jeyarajesh-190413122916.pptx
bacterial plant pathogen jeyarajesh-190413122916.pptxbacterial plant pathogen jeyarajesh-190413122916.pptx
bacterial plant pathogen jeyarajesh-190413122916.pptxdawitg2
 
unit1_practical-applications-of-biotechnology.ppt
unit1_practical-applications-of-biotechnology.pptunit1_practical-applications-of-biotechnology.ppt
unit1_practical-applications-of-biotechnology.pptdawitg2
 
Introduction-to-Plant-Cell-Culture-lec1.ppt
Introduction-to-Plant-Cell-Culture-lec1.pptIntroduction-to-Plant-Cell-Culture-lec1.ppt
Introduction-to-Plant-Cell-Culture-lec1.pptdawitg2
 
fertilizers-150111082613-conversion-gate01.pdf
fertilizers-150111082613-conversion-gate01.pdffertilizers-150111082613-conversion-gate01.pdf
fertilizers-150111082613-conversion-gate01.pdfdawitg2
 
sac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdf
sac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdfsac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdf
sac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdfdawitg2
 
davindergill 135021014 -170426133338.pdf
davindergill 135021014 -170426133338.pdfdavindergill 135021014 -170426133338.pdf
davindergill 135021014 -170426133338.pdfdawitg2
 
preparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdf
preparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdfpreparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdf
preparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdfdawitg2
 
pesticide stoeage storage ppwscript.ppt
pesticide stoeage storage  ppwscript.pptpesticide stoeage storage  ppwscript.ppt
pesticide stoeage storage ppwscript.pptdawitg2
 
-pre-cautions--on--seed-storage--1-.pptx
-pre-cautions--on--seed-storage--1-.pptx-pre-cautions--on--seed-storage--1-.pptx
-pre-cautions--on--seed-storage--1-.pptxdawitg2
 
Intgrated pest management 02 _ 06_05.pdf
Intgrated pest management 02 _ 06_05.pdfIntgrated pest management 02 _ 06_05.pdf
Intgrated pest management 02 _ 06_05.pdfdawitg2
 
major potato and tomato disease in ethiopia .pptx
major potato and tomato disease in ethiopia .pptxmajor potato and tomato disease in ethiopia .pptx
major potato and tomato disease in ethiopia .pptxdawitg2
 
pesticide formulation pp602lec1to2-211207073233.pdf
pesticide formulation pp602lec1to2-211207073233.pdfpesticide formulation pp602lec1to2-211207073233.pdf
pesticide formulation pp602lec1to2-211207073233.pdfdawitg2
 
diseasespests-2013-130708184617-phpapp02.pptx
diseasespests-2013-130708184617-phpapp02.pptxdiseasespests-2013-130708184617-phpapp02.pptx
diseasespests-2013-130708184617-phpapp02.pptxdawitg2
 
pesticide pp602lec1to2-211207073233.pptx
pesticide pp602lec1to2-211207073233.pptxpesticide pp602lec1to2-211207073233.pptx
pesticide pp602lec1to2-211207073233.pptxdawitg2
 
agricultaraly important agrochemicals.ppt
agricultaraly important agrochemicals.pptagricultaraly important agrochemicals.ppt
agricultaraly important agrochemicals.pptdawitg2
 
agri pesticide chemistry-180722174627.pdf
agri pesticide chemistry-180722174627.pdfagri pesticide chemistry-180722174627.pdf
agri pesticide chemistry-180722174627.pdfdawitg2
 
372922285 -important Fungal-Nutrition.ppt
372922285 -important Fungal-Nutrition.ppt372922285 -important Fungal-Nutrition.ppt
372922285 -important Fungal-Nutrition.pptdawitg2
 
disease development and pathogenesis-201118142432.pptx
disease development and pathogenesis-201118142432.pptxdisease development and pathogenesis-201118142432.pptx
disease development and pathogenesis-201118142432.pptxdawitg2
 
ppp211lecture8-221211055228-824cf9da.pptx
ppp211lecture8-221211055228-824cf9da.pptxppp211lecture8-221211055228-824cf9da.pptx
ppp211lecture8-221211055228-824cf9da.pptxdawitg2
 
defensemechanismsinplants-180308104711.pptx
defensemechanismsinplants-180308104711.pptxdefensemechanismsinplants-180308104711.pptx
defensemechanismsinplants-180308104711.pptxdawitg2
 

More from dawitg2 (20)

bacterial plant pathogen jeyarajesh-190413122916.pptx
bacterial plant pathogen jeyarajesh-190413122916.pptxbacterial plant pathogen jeyarajesh-190413122916.pptx
bacterial plant pathogen jeyarajesh-190413122916.pptx
 
unit1_practical-applications-of-biotechnology.ppt
unit1_practical-applications-of-biotechnology.pptunit1_practical-applications-of-biotechnology.ppt
unit1_practical-applications-of-biotechnology.ppt
 
Introduction-to-Plant-Cell-Culture-lec1.ppt
Introduction-to-Plant-Cell-Culture-lec1.pptIntroduction-to-Plant-Cell-Culture-lec1.ppt
Introduction-to-Plant-Cell-Culture-lec1.ppt
 
fertilizers-150111082613-conversion-gate01.pdf
fertilizers-150111082613-conversion-gate01.pdffertilizers-150111082613-conversion-gate01.pdf
fertilizers-150111082613-conversion-gate01.pdf
 
sac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdf
sac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdfsac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdf
sac-301-manuresfertilizersandsoilfertilitymanagement-210105122952.pdf
 
davindergill 135021014 -170426133338.pdf
davindergill 135021014 -170426133338.pdfdavindergill 135021014 -170426133338.pdf
davindergill 135021014 -170426133338.pdf
 
preparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdf
preparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdfpreparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdf
preparationofdifferentagro-chemicaldosesforfield-140203005533-phpapp02.pdf
 
pesticide stoeage storage ppwscript.ppt
pesticide stoeage storage  ppwscript.pptpesticide stoeage storage  ppwscript.ppt
pesticide stoeage storage ppwscript.ppt
 
-pre-cautions--on--seed-storage--1-.pptx
-pre-cautions--on--seed-storage--1-.pptx-pre-cautions--on--seed-storage--1-.pptx
-pre-cautions--on--seed-storage--1-.pptx
 
Intgrated pest management 02 _ 06_05.pdf
Intgrated pest management 02 _ 06_05.pdfIntgrated pest management 02 _ 06_05.pdf
Intgrated pest management 02 _ 06_05.pdf
 
major potato and tomato disease in ethiopia .pptx
major potato and tomato disease in ethiopia .pptxmajor potato and tomato disease in ethiopia .pptx
major potato and tomato disease in ethiopia .pptx
 
pesticide formulation pp602lec1to2-211207073233.pdf
pesticide formulation pp602lec1to2-211207073233.pdfpesticide formulation pp602lec1to2-211207073233.pdf
pesticide formulation pp602lec1to2-211207073233.pdf
 
diseasespests-2013-130708184617-phpapp02.pptx
diseasespests-2013-130708184617-phpapp02.pptxdiseasespests-2013-130708184617-phpapp02.pptx
diseasespests-2013-130708184617-phpapp02.pptx
 
pesticide pp602lec1to2-211207073233.pptx
pesticide pp602lec1to2-211207073233.pptxpesticide pp602lec1to2-211207073233.pptx
pesticide pp602lec1to2-211207073233.pptx
 
agricultaraly important agrochemicals.ppt
agricultaraly important agrochemicals.pptagricultaraly important agrochemicals.ppt
agricultaraly important agrochemicals.ppt
 
agri pesticide chemistry-180722174627.pdf
agri pesticide chemistry-180722174627.pdfagri pesticide chemistry-180722174627.pdf
agri pesticide chemistry-180722174627.pdf
 
372922285 -important Fungal-Nutrition.ppt
372922285 -important Fungal-Nutrition.ppt372922285 -important Fungal-Nutrition.ppt
372922285 -important Fungal-Nutrition.ppt
 
disease development and pathogenesis-201118142432.pptx
disease development and pathogenesis-201118142432.pptxdisease development and pathogenesis-201118142432.pptx
disease development and pathogenesis-201118142432.pptx
 
ppp211lecture8-221211055228-824cf9da.pptx
ppp211lecture8-221211055228-824cf9da.pptxppp211lecture8-221211055228-824cf9da.pptx
ppp211lecture8-221211055228-824cf9da.pptx
 
defensemechanismsinplants-180308104711.pptx
defensemechanismsinplants-180308104711.pptxdefensemechanismsinplants-180308104711.pptx
defensemechanismsinplants-180308104711.pptx
 

Recently uploaded

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

mix2.pdf

  • 1. A moderated view of the linear model Linear mixed models Part II Marcello Gallucci University of Milano-Bicocca
  • 2. GLM When the assumptions are NOT met because the data, and thus the errors, have more complex structures, we generalize the GLM to the Linear Mixed Model
  • 3. Linear Mixed Model Regressione T-test ANOVA ANCOVA Moderazione Mediazione Path Analysis Regressione Logistica GLM Regression T-test ANOVA ANCOVA Moderation Mediation Path Analysis LMM Random coefficients models Random intercept regression models One-way ANOVA with random effects One-way ANCOVA with random effects Intercepts-and-slopes-as-outcomes models Multi-level models
  • 4. The mixed model Overall model Random coefficients Fixed coefficient A GLM which contains both fixed and random effects is called a Linear Mixed Model We can now define a model with a regression for each cluster and the mean values of coefficients ̂ yij=̄ a+ a' j+ ̄ b⋅xij+ b' j⋅xij
  • 5. The mixed model In practice, mixed models allow to estimate the kind of effects we can estimate with the GLM, but they allow the effects to vary across clusters. Effects that vary across clusters are called random effects Effects that do not vary (the ones that are the same across clusters) are said to be fixed effects
  • 6. Building a model To build a model in a simple way, we need to answer very few questions: What is (are) the cluster variable(s)? What are the fixed effects? What are the random effects?
  • 9. Repeated Measures Anova as a linear mixed model
  • 10. A repeated measures design trial 1 2 3 4 5 Participants 1 Y11 Y21 Y31 Y41 Y51 2 Y12 Y22 Y32 Y42 Y52 3 Y13 Y23 Y33 Y43 Y53 N Y1n Y2n Y3n Y4n Y5n …. Consider now a classical repeated measures design (within- subjects) the levels of the WS IV (5 different trials) are represented by different measures taken on the same person
  • 11. Standard file format As for many applications of the repeated-measure design, each level of the WS-factor is represented by a column in the file One participant, one row
  • 12. Long file format For the mixed model we need to tabulate the data as if they came from a between-subject design One measure, one row
  • 13. Participant scores Plot for 1 participant Averages of the sample (fixed effect) Participant scores Participant average trait
  • 14. Where does the score come from? Plot for 1 participant Averages of the sample (fixed effect) Participant average trait
  • 15. Participant component Plot for 1 participant Averages of the sample (fixed effect) Participant individual trait fixed effect individual trait random error
  • 16. Solution Thus, we should consider an extra residual term which represents participants individual characteristic. This term is the same within each participant Y11=a+ b1⋅T1+ u1+ e11 ...... Each score, one residual Each score, one error Y 21=a+ b2⋅T2+ u1+ e21 Y 31=a+ b3⋅T 3+ u1+ e31 Y1j=a+ b1⋅T1+ u j+ e1j Y 2j=a+ b2⋅T2+ u j+ e2j Y 3j=a+ b3⋅T 3+ u j+ e3j We assume the 5 trials are dummy coded one participant one trait One participant one trait Average effects of trials
  • 18. Building the model We translate this in the standard mixed model yij=̄ a+aj+̄ b⋅xij+eij Fixed effects? Intercept and trial effect Random effects? Intercepts Clusters? participants Yij=a+b'⋅Ti+uj+eij
  • 19. SPSS: General mixed models Here we put the variable which specifies to which participant the measure belongs to Here we do not put anything: repeated measures are modelled as random effects
  • 20. SPSS: General mixed models Independent and dependent variables like in GLM
  • 21. SPSS: General mixed models Here we say we want to estimate the fixed effect of trial (effects on the means)
  • 22. SPSS: General mixed models Here we do not put any variable, because there is no variable with random effects We say that we want the intercept to be random We say that the cluster variable is “id”
  • 23. SPSS: General mixed models The model is as intended
  • 25. Interpreting the effects As in GLM (Anova). We interpret the main effect looking at the means Means of the 5 trials Fixed effects
  • 26. Dependency of scores We can quantify the dependency of scores within clusters (participants) by computing the intra-class correlation σa σ ICR= σa σa+σ
  • 27. Dependency of scores We can quantify the dependency of scores within clusters (participants) by computing the intra-class correlation σa σ ICR= .0078 .0078+.0302 =.205
  • 29. GAMLj: mixed models Categorical independent variable Clustering variable(s)
  • 30. GAMLj: random coefficients Random intercepts All possible random coefficients
  • 31. GAMLj: fixed coefficients Fixed effect All possible fixed coefficients
  • 32. GAMLj: Results: model R-squared R-squared Marginal: How much variance can the fixed effects alone explain of the overall variance R-squared Conditional: How much variance can the fixed and random effects together explain of the overall variance
  • 33. GAMLj: Results: random Variance of intercepts As long as the variance is non- zero, we are fine
  • 34. GAMLj: Results: fixed F-tests Coefficients Contrasts used to cast the categorical IV
  • 35. GAMLj: plot Fixed effect to plot Options
  • 37. GAMLj: post-hoc As in GLM (Anova), sometimes we want to compares conditions using post-hoc tests. GAMLj allows for Bonferroni and Holm (more liberal) p-value adjustement
  • 38. GAMLj: post-hoc The interpretation follows as for any standard ANOVA
  • 39. Between and Repeated Measures Anova linear mixed model
  • 40. Standard design There are two groups - a Control group and a Treatment group, measured at 4 times. These times are labeled as 1 (pretest), 2 (one month posttest), 3 (3 months follow-up), and 4 (6 months follow-up). The dependent variable is a depression score (e.g. Beck Depression Inventory) and the treatment is drug versus no drug. If the drug worked about as well for all subjects the slopes would be comparable and negative across time. For the control group we would expect some subjects to get better on their own and some to stay depressed, which would lead to differences in slope for that group (*) *) https://www.uvm.edu/~dhowell/StatPages/More_Stuff/Mixed-Models-Repeated/Mixed-Models-for-Repeated-Measures1.html
  • 41. Standard design There are two groups - a Control group and a Treatment group, measured at 4 times. These times are labeled as 1 (pretest), 2 (one month posttest), 3 (3 months follow-up), and 4 (6 months follow-up). *) https://www.uvm.edu/~dhowell/StatPages/More_Stuff/Mixed-Models-Repeated/Mixed-Models-for-Repeated-Measures1.html 96 observations 24 subjects
  • 42. Standard design: data Data are in the long format One subject 4 rows
  • 43. Mixed model We can translate this in a standard mixed model Fixed effects? Intercept and group,time, and interaction effect Random effects? Intercepts Clusters? subjects
  • 44. Variables Definition of the analysis Clustering variable
  • 45. Model Definition of the analysis Fixed effects Random effects
  • 47. Results Interpretation of results Fixed F-tests For the moment we ignore the coefficients of the parameter estimates
  • 48. Results: plot Interpretation of results Red is the control group
  • 49. Probing the results We can probe the interaction (and the pattern of means) in different ways (all available in GAMLj): Simple effects: Test if the effects of time is there (and how strong it is) for different groups Trend analysis: Checking the polynomial trend for time in general and for different groups Post-hoc test: not nice, but doable
  • 51. Simple Effects Simple effects are effects of one variable evaluated at one level of the other variable (like simple slopes for continuous variables) A1 A2 A3 Totals B1 E B2 E B3 E Totals Is the effect of B for A1 different from zero? Is there an effect here?
  • 52. Simple Effects Simple effects are effects of one variable evaluated at one level of the other variable (like simple slopes for continuous variables) Is the effect of B for A2 different from zero? A1 A2 A3 Totals B1 E B2 E B3 E Totals Is there an effect here?
  • 53. Simple Effects Simple effects are effects of one variable evaluated at one level of the other variable (like simple slopes for continuous variables) A1 A2 A3 Totals B1 E B2 E B3 E Totals Is the effect of B for A3 different from zero? Is there an effect here?
  • 54. Simple effects Interpretation of results Is there an effect here? Is there an effect here?
  • 55. Simple effects We should declare which is the variable we want the effect for and which is the moderator Effects of time for different groups
  • 56. Simple effects We can say that the treatment works for both groups, although in a different way (recall the interaction) In both groups there is an affect of time
  • 58. Polynomial Contrasts Trend analysis is based on Polynomial contrasts: each contrast features weights which follow well-known shapes (polynomial functions) -3 -2 -1 0 1 2 3 T1 T2 T3 T4 Linear Quadratic Cubic L=−3 −1 1 3  Q=−1 1 1 −1  C=−1 2 −2 1 
  • 59. Trend analysis ● It is useful to test what kind of trend is present in the pattern of means ● It can be applied to any ordered categorical variables ● It is often used (and SPSS gives it by default) in repeated measures analysis ● One can estimate K-1 trends (linear, quadratic, cubic etc), where K is the number of means (conditions)
  • 60. Trend analysis ● Each trend (linear, quadratic, etc) tests a particular shape of the mean pattern Linear: on average means go down (or up, not flat)
  • 61. Trend analysis ● Each trend (linear, quadratic, etc) tests a particular shape of the mean pattern Quadratic: on average means go down and then up
  • 62. Trend analysis ● Each trend (linear, quadratic, etc) tests a particular shape of the mean pattern Cubic: on average means fluctuate
  • 63. Trend analysis ● Each significant trend justifying interpreting a particular characteristic of the mean pattern
  • 64. GAMLj:Trend analysis ● First, we should code the categorical variable “time” as a polynomial contrast ● We can leave “group” as deviation (default) which means “centered contrasts”
  • 65. GAMLj:Trend analysis ● Second, look at the parameter estimates Contrast labels Contrast average effects Contrast interaction with group
  • 66. GAMLj:Trend analysis ● Average effects of the contrasts The pattern (on average) shows all three trends: 1. it goes down (linear) 2. it tend to go down and then up 3. if fluctuates a bit
  • 67. GAMLj:Trend analysis ● Trend analysis by group Those tell us if the trend is different between the two groups: Linear: no Quadratic: yes Cubib: no Both groups decreases Group 2 curve is stronger They both fluctuates a bit
  • 68. GAMLj:Trend analysis ● Trend analysis by group Those tell us if the trend is different between the two groups: Linear: no Quadratic: yes Cubic: mild Both groups decreases One group has a stronger curve They both fluctuates a bit
  • 69. GAMLj:Trend analysis Those tell us if the trend is different between the two groups: Linear: no Quadratic: yes Cubic: mild Both groups decreases Group 2 curve is stronger The fluctuation is similar
  • 70. GAMLj:Trend analysis ● Simple effects trend analysis: We can now look at the parameters of the simple effects analysis Time1: linear Time2: quadratic Time3: cubic ● In group 1 there’s only a linear trend ● In group 2 all three trend are there
  • 71. GAMLj:Trend analysis ● Simple effects trend analysis: We can now interpret the parameters of the simple effects analysis ● In group 1 there’s only a linear trend ● In group 2 all three trends are there
  • 73. Two continuous variables In the multiple regression we have seen, lines are parallels, making a flat surface The effect of one IV is constant (the same) for each level of the other IV
  • 74. Interactions lines Interaction: Lines are not parallel The effect of one IV is different for each level of the other IV
  • 75. Interactions line The bigger the interaction, the less parallel the lines: Bigger difference in the slopes
  • 76. Interactions line The bigger the interaction, the less parallel the lines: Bigger difference in the slopes
  • 77. Multiplicative effect The interaction effect is captured in the regression by a multiplicative term ̂ yi=a+ b1⋅x1+ b2⋅x2+ bint x1 x2 The product of the two independent variables ̂ yi=a+(b1+ bint x2)⋅x1+ b2⋅x2 The coefficient of x1 is changing as x2 changes The effect of one IV changes at different levels of the other IV
  • 78. Conditional effect We say that the effect of one IV is conditional to the level of the other IV CITS 100 80 60 40 20 0 SALARY 80000 70000 60000 50000 40000 Women Men For Women (0) the slope is different …than for Men (1) ̂ yi=a+(b2+ bint0)⋅x2+ b1⋅0 ̂ yi=a+(b2+ bint1)⋅x2+ b1⋅1
  • 79. Conditional vs linear effect A linear effect (when no interaction is present) tells you how much change there is in the DV when you change the IV An interaction effect (the B of the product term) tells you how much change there is in the effect of one IV on the DV when you change the other IV Change in the DV Change in the DV Change in the effect ̂ yi=a+ b1⋅x1+ b2⋅x2+ bint x1 x2 ̂ yi=a+(b1+ bint x2)⋅x1+ b2⋅x2
  • 80. Terminology When there is an interaction term in the equation, one refers to the linear effect (the ones that are not interactions) as the first-order effect First order effects ̂ yi=a+ b1⋅x1+ b2⋅x2+ bint x1 x2
  • 81. First-order effects with interaction When the interaction is in the regression, the first order effects become the effect of the IV while keeping the other IV’s constant to zero Effect of X2 for X1=0 Effect of X1 for X2=0 ̂ yi=a+ b1⋅x1+ b2⋅0+ bint x10=a+ b1⋅x1
  • 82. Making zero meaningful We can always make zero a meaningful value by centering the variables before computing the product term: c=x1−̄ x1 For each participant, compute a new variable as the old minus the average The new variable has mean=0 0 Mean=10 20 x1
  • 83. Centering The first-order effects computed on centered variables represent the average effect (the one in the middle) of the IV, across all levels of the other IV Effect of x2 for x1=0 Effect of x1 for x2=0
  • 84. Simple slope analysis We can study the interaction by evaluating the effect of one independent variables for low (-1 SD), average (Mean), and high (+1 SD) levels of the moderator We pick three lines out of many in the regression plane, and plot them Average effect +1 SD -1 SD
  • 85. Simple slope analysis We represent them in two dimensions +1 SD X2 Ave. X2 -1 DS X2 +1 SD X2 -1 SD X2 Avera. X2
  • 86. Example 50 different school classes were assessed on students reading ability and self- efficacy. In each class, the teacher was assessed as well for her/his self-efficacy. 1182 subjects 50 school clasess
  • 87. Example Efficacy and reading ability varies from participant to participant, whereas teaching efficacy varies from class to class, but not within each class
  • 88. Example We want to use a mixed model to take into the account the school class clustering effect ^ SE=a+b1 REA+b2 TE+b3TE⋅REA We wish to estimate the effect of reading ability to participants self- efficacy, the effect of teacher efficacy and the interaction between reading ability and teacher efficacy
  • 89. Mixed model We can translate this in a standard mixed model Fixed effects? Intercept and read ,teacher, and interaction effect Random effects? Intercepts read effect Clusters? School class ^ SE=a+b1 REA+b2 TE+b3TE⋅REA
  • 90. Example jamovi First we define the variables in the model and their role
  • 91. Example: fixed effects We define the fixed effects in the model Main effects and interactions
  • 92. Example: random effects We define the random effects in the model Main that can be computed within each school class
  • 94. Results: model fixed effects F-tests and p-values: we interpret them as any regression with interaction
  • 95. Results: model fixed effects B coefficients and p-values: To interpret the linear effects we should know the meaning zero of the independent variable: jamovi centers the independent variable by default Linear effects are average effects B coefficients
  • 96. Centering IV Jamovi by default centers the IVs to their means, but different options are available Centered: centered using total sample mean Cluster-based centered: centered using each cluster mean Standardized: using mean and standard deviation of the total sample Cluster-based Standardized: using means and standard deviations of each cluster
  • 97. Simple slope analysis Estimating the effect of one independent variable (read) at different levels of the moderator (teachefficacy) and make a plot
  • 98. Simple slope analysis Estimating the effect of one independent variable (read) at different levels of the moderator (teachefficacy) and make a plot
  • 99. Simple slope analysis One can add confidence bands: confidence intervals for continuous predicted values At the moment, the moderator is set to +1SD, mean, -1SD. More options will be added in the future
  • 100. Simple slope analysis Estimating the effect of one independent variable (read) at different levels of the moderator (teachefficacy) and test the effects
  • 101. Simple slope analysis Estimating the effect of one independent variable (read) at different levels of the moderator (teachefficacy) and test the effects At the moment, the moderator is set to +1SD, mean, -1SD. More options will be added in the future
  • 102. Simple slope analysis Estimating the effect of one independent variable (read) at different levels of the moderator (teachefficacy) and test the effects At the moment, the moderator is set to +1SD, mean, -1SD. More options will be added in the future B coefficients
  • 103. Questions How many clusters, how many scores within cluster Convergences Multiple classifications • Subjects by items design