Hello,
I'm currently conducting a meta-analysis and needing to generate a forest plot summarizing specificity proportions which I was successfully able to do via the meta package in R. However, I now need to color code specific aspects (boxes) of the forest plot and am having difficulty in doing so and was therefore hoping someone might be able to provide some insight or advice?
I have provided the syntax which was used to generate said forest plot, below. For the color-coding, I specifically need distinct color codes for the following boxes of the respective studies (labeled by author name on the far left column within the forest plot):
First color:
- Cripps
- Hunt
- Williams
Second color:
- Aniwan
- Digby
- Kallenberg
- Gimeno
- Lane
- Ng
Third color:
Common effects model - pooled proportion at the bottom of the plot
Fourth color:
Random effects model - pooled proportion at the bottom of the plot
Would someone perhaps know how to go about this, so that there are four distinct color codes within the forest plot as indicated above? Additionally, can a legend / key be added to the forest plot image?
Thank you!!
#setwd("C:/Users/k19027833/OneDrive - King's College London/Annie PhD/Systematic Review/Meta-Analysis")
setwd("C:/Users/k19027833/OneDrive - King's College London/Annie PhD/Systematic Review/Meta-Analysis")
AnnieMA3<-read.csv(file="AnnieMA_specificitypooled.csv")
#Annie MA
##AnnieMA3<-as.matrix(AnnieMA3[,2:3])
##AnnieMA3
#chisq.test(AnnieMA3)
#chisq.test(AnnieMA3)$expected
#set.seed(1066)
#fisher.test(AnnieMA3,simulate.p.value=TRUE)
#install.packages("meta")
library(meta)
#mydata<-read.csv("Pooled Meta analysis_Results_01Aug2023.csv", header=TRUE)
#attach(mydata)
#str(mydata)
names(AnnieMA3)
m1 <- metaprop(controlsb.truenegative.,controlsa.false.positive.+controlsb.truenegative.,studlab=Author,data=AnnieMA3)
#m1 <- metaprop(casesa..true.pos.,casesa..true.pos.+casesb..false.neg.,studlab=Authors,data=AnnieMA3)
m1
forest(m1)