Main outcome
p=ggplot(aes(y = antral.volume, x = factor(t), fill=study.goup), data = bdpa) + geom_boxplot()
p= p + labs(x = "Time in minutes", y = "Estimated antral volume in ml", colour = "Study group")
print(p)

p=ggplot(aes(y = antral.volume.ml.kg, x = factor(t), fill=study.goup), data = bdpa) + geom_boxplot()
p= p + labs(x = "Time in minutes", y = "Estimated antral volume in ml/kg", colour = "Study group")
p=p+ geom_hline(yintercept = 1.5) + annotate("text", min(0), 1.5, vjust = -1, label = " 1.5ml/kg")
p=p+ geom_hline(yintercept = 0.8) +
annotate("text", min(0), 0.8, vjust = -1, label = " 0.8ml/kg")
print(p)

Fitted curves
p=ggplot(data = bdpa, aes(x = bdpa$t, y = bdpa$antral.volume, group = bdpa$id, color=bdpa$study.goup)) + labs(
x = "Time in minutes",
y = "Estimated antral volume in ml",
colour = "Study group"
)
p=p + stat_smooth(aes(group = bdpa$study.goup))
p=p+ theme(legend.background = element_rect(fill=rgb(1,1,1), size=0.5, linetype=2));
print(p)
## `geom_smooth()` using method = 'loess'

p=ggplot(data = bdpa, aes(x = bdpa$t, y = bdpa$antral.volume.ml.kg, group = bdpa$id, color=bdpa$study.goup)) + labs(
x = "Time in minutes",
y = "Estimated antral volume in ml/kg",
colour = "Study group"
)
p=p + stat_smooth(aes(group = bdpa$study.goup))
p=p+ geom_hline(yintercept = 1.5) + annotate("text", min(0), 1.5, vjust = -1, label = " 1.5ml/kg")
p=p+ geom_hline(yintercept = 0.8) +
annotate("text", min(0), 0.8, vjust = -1, label = " 0.8ml/kg")
p=p+ theme(legend.background = element_rect(fill=rgb(1,1,1), size=0.5, linetype=2));
print(p)
## `geom_smooth()` using method = 'loess'
