Table of contents

  1. Variables
  2. Independent Student-T Tests
  3. Graphs
    1. Duration
    2. Fresh Gas Flow
    3. Fresh Gas Consumed
    4. Sevoflurane Inspired
    5. Sevoflurane Expired
    6. Sevoflurane Volume Consumed

Variables/Abbreviations

Independent Student T-Tests

tDurP1 <- t.test(P1_Duration~Intervention, data=Flow)
tDurP2 <- t.test(P2_Duration~Intervention, data=Flow)
tDurT <- t.test(T_Duration~Intervention, data=Flow)

tFGFP1 <- t.test(P1_FGF ~ Intervention, data=Flow)
tFGFP2 <- t.test(P2_FGF ~ Intervention, data=Flow)
tFGFT <- t.test(T_FGF ~ Intervention, data=Flow)

tFGCP1 <- t.test(P1_FGC_Volume ~ Intervention, data=Flow)
tFGCP2 <- t.test(P2_FGC_Volume ~ Intervention, data=Flow)
tFGCT <- t.test(T_FGC_Volume ~ Intervention, data=Flow)

tInspSevP1 <- t.test(P1_Inspired_Sevo ~ Intervention, data=Flow)
tInspSevP2 <- t.test(P2_Inspired_Sevo ~ Intervention, data=Flow)
tInspSevT <- t.test(T_Inspired_Sevo ~ Intervention, data=Flow)

tExpSevP1 <- t.test(P1_Expired_Sevo ~ Intervention, data=Flow)
tExpSevP2 <- t.test(P2_Expired_Sevo ~ Intervention, data=Flow)
tExpSevT <- t.test(T_Expired_Sevo ~ Intervention, data=Flow)

tSevoCP1 <- t.test(P1_Sevo_Consumed ~ Intervention, data=Flow)
tSevoCP2 <- t.test(P1_Sevo_Consumed ~ Intervention, data=Flow)
tSevoCT <- t.test(P1_Sevo_Consumed ~ Intervention, data=Flow)

tSevoCostP1 <- t.test(P1_Sevo_CostperCase_Calc ~ Intervention, data=Flow)
tSevoCostP2 <- t.test(P2_Sevo_CostperCase_Calc ~ Intervention, data=Flow)
tSevoCostT <- t.test(T_Sevo_CostperCase_Calc ~ Intervention, data=Flow)


pvalues<- data.frame(tDurP1$p.value, tDurP2$p.value, tDurT$p.value, tFGFP1$p.value, tFGFP2$p.value, tFGFT$p.value, tFGCP1$p.value, tFGCP2$p.value, tFGCT$p.value, tInspSevP1$p.value, tInspSevP2$p.value, tInspSevT$p.value, tExpSevP1$p.value, tExpSevP2$p.value, tExpSevT$p.value, tSevoCP1$p.value, tSevoCP2$p.value, tSevoCT$p.value)

colnames(pvalues) <- c("P1D", "P2D","TD", "P1FGF", "P2FGF", "TFGF", "P1FGC", "P2FGC", "TFGC", "P1SevI", "P2SevI", "ASevI", "P1SevE", "P2SevE", "ASevE", "P1SevC", "P2SevC", "TSevC" )
pvalues2 <- data.frame(t(pvalues))
colnames(pvalues2) <- c("pvalue")
pvalues2
##              pvalue
## P1D    3.667894e-03
## P2D    2.304647e-04
## TD     4.941022e-06
## P1FGF  8.331184e-01
## P2FGF  2.487518e-01
## TFGF   4.495352e-01
## P1FGC  7.539043e-03
## P2FGC  2.249355e-04
## TFGC   4.612680e-05
## P1SevI 5.306406e-02
## P2SevI 3.615661e-02
## ASevI  1.056879e-01
## P1SevE 4.252962e-01
## P2SevE 4.334590e-02
## ASevE  1.280432e-01
## P1SevC 1.287413e-03
## P2SevC 1.287413e-03
## TSevC  1.287413e-03
tSevoCostT
## 
##  Welch Two Sample t-test
## 
## data:  T_Sevo_CostperCase_Calc by Intervention
## t = -4.8541, df = 52.373, p-value = 1.131e-05
## alternative hypothesis: true difference in means between group Post-Int and group Pre-Int is not equal to 0
## 95 percent confidence interval:
##  -1.1461301 -0.4757608
## sample estimates:
## mean in group Post-Int  mean in group Pre-Int 
##               0.743600               1.554545

Graphs

BarPlot Duration

gP1D <- ggplot(Flow, aes (y= P1_Duration, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 1") +
  ylab("Duration FGF(minutes)") +
  ylim(0,16) +
  theme(legend.position="none") +
  stat_summary(fun=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=4.5, xend=2, yend =4.5) +
  geom_text(x=1.5, y=5, label = "**", size=10)

gP2D <- ggplot(Flow, aes (y= P2_Duration, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 2") +
  ylim(0,16) +
  theme(legend.position="none", 
        axis.text.y=element_blank(),
        axis.title.y=element_blank()) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=6.5, xend=2, yend =6.5) +
  geom_text(x=1.5, y=7, label = "***", size=10)
  
gTD <- ggplot(Flow, aes (y= T_Duration, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE))  +
  xlab("Total") +
  theme(legend.position="none",
        axis.text.y= element_blank(),
        axis.title.y=element_blank()) +  
  ylim(0,16) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=8.5, xend=2, yend =8.5) +
  geom_text(x=1.5, y=9, label = "***", size=10)

g1grob <- ggplotGrob(gP1D)
g2grob <- ggplotGrob(gP2D)
gTgrob <- ggplotGrob(gTD)
grid.arrange(g1grob, g2grob, gTD, ncol =3, top=textGrob("Duration of Fresh Gas Flow", gp=gpar(fontsize=20,font=8)))

BarPlot Fresh Gas Flow

gP1FGF <- ggplot(Flow, aes (y= P1_FGF, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 1") +
  ylab("Fresh Gas Flow (L/min)") +
  ylim(0,16) +
  theme(legend.position="none") +
  stat_summary(fun=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)

gP2FGF <- ggplot(Flow, aes (y= P2_FGF, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 2") +
  ylim(0,16) +
  theme(legend.position="none", 
        axis.text.y=element_blank(),
        axis.title.y=element_blank()) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)
  
gTFGF <- ggplot(Flow, aes (y= T_FGF, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE))  +
  xlab("Total") +
  theme(legend.position="none",
        axis.text.y= element_blank(),
        axis.title.y=element_blank()) +  
  ylim(0,16) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)

gFF1grob <- ggplotGrob(gP1FGF)
gFF2grob <- ggplotGrob(gP2FGF)
gFFTgrob <- ggplotGrob(gTFGF)
grid.arrange(gFF1grob, gFF2grob, gFFTgrob, ncol =3, top=textGrob("Fresh Gas Flow", gp=gpar(fontsize=20,font=8)))

BarPlot Fresh Flow Consumed

gP1FGC <- ggplot(Flow, aes (y= P1_FGC_Volume, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 1") +
  ylab("Volume Fresh Gas Consumed (L)") +
  ylim(0,120) +
  theme(legend.position="none") +
  stat_summary(fun=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=45, xend=2, yend =45) +
  geom_text(x=1.5, y=50, label = "**", size=10)

gP2FGC <- ggplot(Flow, aes (y= P2_FGC_Volume, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 2") +
  ylim(0,120) +
  theme(legend.position="none", 
        axis.text.y=element_blank(),
        axis.title.y=element_blank()) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=45, xend=2, yend =45) +
  geom_text(x=1.5, y=50, label = "***", size=10)
  
gTFGC <- ggplot(Flow, aes (y= T_FGC_Volume, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE))  +
  xlab("Total") +
  theme(legend.position="none",
        axis.text.y= element_blank(),
        axis.title.y=element_blank()) +  
  ylim(0,120) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=75, xend=2, yend =75) +
  geom_text(x=1.5, y=80, label = "***", size=10)

gFGC1grob <- ggplotGrob(gP1FGC)
gFGC2grob <- ggplotGrob(gP2FGC)
gFGCTgrob <- ggplotGrob(gTFGC)
grid.arrange(gFGC1grob, gFGC2grob, gFGCTgrob, ncol =3, top=textGrob("Fresh Gas Consumed", gp=gpar(fontsize=20,font=8)))

BarPlots Inspired Sevoflurane

gP1SevoI <- ggplot(Flow, aes (y= P1_Inspired_Sevo, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 1") +
  ylab("Sevoflurane %") +
  ylim(0,3) +
  theme(legend.position="none") +
  stat_summary(fun=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)

gP2SevoI <- ggplot(Flow, aes (y= P2_Inspired_Sevo, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 2") +
  ylim(0,3) +
  theme(legend.position="none", 
        axis.text.y=element_blank(),
        axis.title.y=element_blank()) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=2.1, xend=2, yend =2.1) +
  geom_text(x=1.5, y=2.35, label = "*", size=10)
  
gTSevoI <- ggplot(Flow, aes (y= T_Inspired_Sevo, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE))  +
  xlab("Case Average") +
  theme(legend.position="none",
        axis.text.y= element_blank(),
        axis.title.y=element_blank()) +  
  ylim(0,3) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)

gSevoI1grob <- ggplotGrob(gP1SevoI)
gSevoI2grob <- ggplotGrob(gP2SevoI)
gSevoITgrob <- ggplotGrob(gTSevoI)
grid.arrange(gSevoI1grob, gSevoI2grob, gSevoITgrob, ncol =3, top=textGrob("Inspired Sevoflurane", gp=gpar(fontsize=20,font=8)))

BarPlots Expired Sevoflurane

gP1SevoE <- ggplot(Flow, aes (y= P1_Expired_Sevo, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 1") +
  ylab("Sevoflurane %") +
  ylim(0,3) +
  theme(legend.position="none") +
  stat_summary(fun=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)

gP2SevoE <- ggplot(Flow, aes (y= P2_Expired_Sevo, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 2") +
  ylim(0,3) +
  theme(legend.position="none", 
        axis.text.y=element_blank(),
        axis.title.y=element_blank()) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=1.6, xend=2, yend =1.6) +
  geom_text(x=1.5, y=1.85, label = "*", size=10)
  
gTSevoE <- ggplot(Flow, aes (y= T_Expired_Sevo, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE))  +
  xlab("Case Average") +
  theme(legend.position="none",
        axis.text.y= element_blank(),
        axis.title.y=element_blank()) +  
  ylim(0,3) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2)

gSevoE1grob <- ggplotGrob(gP1SevoE)
gSevoE2grob <- ggplotGrob(gP2SevoE)
gSevoETgrob <- ggplotGrob(gTSevoE)
grid.arrange(gSevoE1grob, gSevoE2grob, gSevoETgrob, ncol =3, top=textGrob("Expired Sevoflurane", gp=gpar(fontsize=20,font=8)))

BarPlots Sevoflurane Consumed

gP1SevoC <- ggplot(Flow, aes (y= P1_Sevo_Consumed, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 1") +
  ylab("Volume (mL)") +
  ylim(0,14) +
  theme(legend.position="none") +
  stat_summary(fun=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=5, xend=2, yend =5) +
  geom_text(x=1.5, y=5.5, label = "**", size=10)

gP2SevoC <- ggplot(Flow, aes (y= P2_Sevo_Consumed, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE)) +
  xlab("Period 2") +
  ylim(0,14) +
  theme(legend.position="none", 
        axis.text.y=element_blank(),
        axis.title.y=element_blank()) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=5, xend=2, yend =5) +
  geom_text(x=1.5, y=5.5, label = "**", size=10)
  
gTSevoC <- ggplot(Flow, aes (y= T_Sevo_Consumed, x= factor(Intervention, level=c('Pre-Int', 'Post-Int')), fill = Intervention, show.legend=FALSE))  +
  xlab("Total") +
  theme(legend.position="none",
        axis.text.y= element_blank(),
        axis.title.y=element_blank()) +  
  ylim(0,14) +
  stat_summary(fun.y=mean, 
               geom = "bar",  
               color = "black") + 
  stat_summary(fun.data = mean_se, 
               geom = "errorbar", 
               width = 0.2) +
  geom_segment(x=1, y=7.5, xend=2, yend =7.5) +
  geom_text(x=1.5, y=8, label = "**", size=10)

gSevoC1grob <- ggplotGrob(gP1SevoC)
gSevoC2grob <- ggplotGrob(gP2SevoC)
gSevoCTgrob <- ggplotGrob(gTSevoC)
grid.arrange(gSevoC1grob, gSevoC2grob, gSevoCTgrob, ncol =3, top=textGrob("Sevoflurane Consumed", gp=gpar(fontsize=20,font=8)))