#### Introduction #### #Meta Analysis Example #Difference between Males and Females #in Maladaptive Perfectionism dat<-read.csv(file.choose()) dat library(metafor) #### Fixed Effects Model #### #Fixed Effects Model (method="FE") #Raw mean difference (measure="MD") ma1<-rma(data=dat, yi=g, sei=se_g, method="FE") summary(ma1) #### Random Effects Model #### #Random Effects Model #Restricted Maximum Likelihood Estimation (method="REML") #Raw Mean Difference (measure="MD") ma2<-rma(data=dat, yi=g, sei=se_g, method="REML") summary(ma2) #### Diagnostics on the Random Effect Model #### #Forest Plot for the Standardized Mean Difference forest(ma2,level=95) #Identify Influential Cases ic<-influence(ma2) plot(ic) (cd_cut<-4/(length(dat$g))) any(ic$inf$cook.d > cd_cut) #Influential Cases #One at a time leave out a study #Plot the effect sizes from each analsysis plot(leave1out(ma2)$estimate) #Publication Bias - Funnel Plot funnel(ma2) regtest(ma2) #Test for Funnel Plot Asymmetry #Four helpful plots with one command plot(ma2) #### Let's redo the analysis without Study 6 #### # Recall: Study 6 g=3.97 dat2<-dat[-6,] dat2 #Random Effects Model #Restricted Maximum Likelihood Estimation (method="REML") ma3<-rma(data=dat2, yi=g, sei=se_g, method="REML") summary(ma3) funnel(ma3) regtest(ma3) #Test for Funnel Plot Asymmetry #Forest Plot for the Standardized Mean Difference forest(ma3,level=95) #### Moderator Analyses #### library(ggplot2) #Country as a Moderator of Effect Size boxplot(dat$g ~ dat$country) #Random Effects Model #Restricted Maximum Likelihood Estimation (method="REML") #With moderator "Country" ma4<-rma(data=dat, yi=g, sei=se_g, method="REML", mods=~country) summary(ma4) tapply(dat$g,dat$country,mean) #Forest Plot with Fitted Values forest(ma4) forest(ma4,order="obs") plot(ma4) # Likelihood Ratio Test for Moderator "Country" # Must use ML, not REML ma5a<-rma(data=dat, yi=g, sei=se_g, method="ML", mods=NULL) ma5b<-rma(data=dat, yi=g, sei=se_g, method="ML", mods=~country) anova(ma5a,ma5b) #### The End! ####