Professional Documents
Culture Documents
Analyses
Matt Baldwin
Lucas Keefer
We will cover
Simple and simultaneous mediation
Sequential mediation
Moderated mediation
Three models using PROCESS for SPSS
R-code for those models
MAYBE: Monte-Carlo estimator online
Terms
M
a b
X Y
c
Indirect effect: a * b 0
Terms
Simple mediation
One predictor
One outcome
One or more mediators in parallel
Sequential mediation
One predictor
One outcome
More than one mediator in sequence
Terms
Moderated mediation: strength of indirect effect
depends on one or more moderators
One predictor
One outcome
One or more mediators (not in sequence)
One or more moderators
Bootstrapping: estimating a parameter from
repeated resampling of the data
Approximates sampling distribution
Uses standard error to calculate confidence interval
for indirect effect (a*b)
PROCESS: SPSS
Andrew Hayes, Ph.D.
http://afhayes.com/introduction-to-
mediation-moderation-and-conditional-
process-analysis.html
Installing PROCESS
PROCESS: Models
Templates PDF file: templates.pdf
Model 4
Simple mediation
Multiple mediators in parallel
Model 4
Model 4 Output
Model 4 Output
Data
Model
Number of
Resamples
boot(model, data, R = #)
Data
Whatever object contains the data you are
analyzing
If there are filters to apply, do so beforehand:
med_data <- subset(data, filters)
Model
The model must be specified manually:
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Model
The model must be specified manually:
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Model
The model must be specified manually:
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Model
The model must be specified manually:
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Model
The model must be specified manually:
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Model
The model must be specified manually:
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Simple Mediation
Simple Mediation
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Simple Mediation
boot(model, data, R = #)
obj <- boot(mediation, med_data, R = 10000)
boot.ci(obj)
Moderated Mediation
Moderated Mediation
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M~X+W+WX, data=d)
model2<-lm(Y~M+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]
return(as.numeric(ab))
}
Sequential Mediation
Sequential Mediation
mediation<-function(med_data,i){
d <- med_data[i,]
model1<- lm(M1~X, data=d)
model2<-lm(M2~M1+X, data=d)
model3<-lm(Y~M2+M1+X, data=d)
ab <- coef(model1)[2]*coef(model2)[2]*
coef(model3)[2]
return(as.numeric(ab))
}
Final Pointers
Want to add model covariates? Just add them
into all the model commands (NOT as first
predictor)
Final Pointers
Want to add model covariates? Just add them
into all the model commands (NOT as first
predictor)