Forest Plot 1
cochrane_from_rmeta <-
structure(list(
mean = c(NA, NA,1.68, NA, 2.33, 2.01, NA,1.51, 0.92,NA, 1.56, NA,3.88, 3.11, 2.87, 2.22),
lower = c(NA, NA, 1.35, NA, 1.29, 1.08, NA, 1.05, 0.69, NA, 1.23, NA, 1.36, 1.57, 1.38, 1.17),
upper = c(NA, NA, 2.08, NA, 4.2, 3.73, NA, 2.17, 1.23, NA, 1.99, NA, 11.08, 6.19, 5.98, 4.18)),
.Names = c("mean", "lower", "upper"),
row.names = c(NA, -13L),
class = "data.frame")
tabletext <- cbind(
c("Study","Baek et al."," On-call work vs insomnia or sleep difficulties","Chung et al."," 3 consecutive night shifts vs insomnia"," Short recovery periods between shifts vs insomnia","Karhula et al."," On-call work vs sleep difficulties (German)"," On-call work vs sleep difficulties (Finnish)","Lee et al."," On-call work vs insomnia or sleep difficulties","Zhang et al."," Other shift work vs sleep disorder"," 2-shift work vs sleep disorder"," 3-shift work vs sleep disorder"," 4-shift work vs sleep disorder"),
c("OR","","1.68","","2.33","2.01","","1.51","0.92","","1.56","","3.88","3.11","2.87","2.22"))
forestplot(tabletext,
cochrane_from_rmeta$mean,
cochrane_from_rmeta$lower,
cochrane_from_rmeta$upper,
hrzl_lines = gpar(col = "#444444"),
graphwidth = "auto",
new_page = TRUE,
is.summary = c(TRUE,rep(FALSE,15)),
clip = c(0.5,15),
xlog = TRUE,
boxsize = 0.25,
col = fpColors(box = "royalblue",
line = "darkblue",
summary = "royalblue"))

Forest Plot for Schneider & Harknett
betas <- c(NA, -0.30,NA,-0.33,-0.16,-0.50,-0.26,-0.29,NA,0,-0.09,-0.27,-0.35,NA,-0.54,-0.44,-0.41,-0.33,NA,0,-0.06,-0.25,-0.51,-0.85,-1.23)
OR <- exp(-betas)
tabletext <- cbind(
c("Exposure"," Weekly Variation in Hours","Schedule Type", " Variable", " Regular Evening", " Regular Night", " Rotating", " Other", "Advance Notice", " 14+ Days", " 0-2 Days", " 3-6 Days", " 7-14 Days", "Other Shift Types", " Shift Cancellation", " On-Call", " Clopening", " Schedule Decided By Employer", "Work Instability Scale", " 0", " 1", " 2"," 3"," 4"," 5+"),
c("OR","1.35* ",NA,"1.39***","1.17","1.65***","1.30**","1.34*",NA,"Ref","1.09","1.31**","1.42**",NA,"1.72***","1.55***","1.51***","1.39***","","Ref","1.06","1.28*","1.67***","2.34***","3.42***"))
s_h <-
structure(list(
mean = OR,
lower = OR,
upper = OR),
.Names = c("mean", "lower", "upper"),
row.names = c(NA, -25L),
class = "data.frame")
tabletext <- tabletext
forestplot(tabletext,
s_h$mean,
s_h$lower,
s_h$upper,
hrzl_lines = list(
"2" = gpar(col = "#444444")),
title = "Odds Ratios of Fair or Poor Subjective Sleep vs Good or Excellent",
graphwidth = "auto",
new_page = TRUE,
is.summary = c(TRUE,rep(FALSE,1),TRUE,rep(FALSE,5),TRUE,rep(FALSE,4),TRUE,rep(FALSE,4),TRUE,rep(FALSE,6)),
clip = c(0.5,4),
xlog = TRUE,
boxsize = 0.35,
col = fpColors(box = "royalblue",
line = "darkblue",
summary = "royalblue"))
