Section 1: Sample size calculation.

At the time of the study’s design, we lacked previous data on the area of hyperalgesia in the first 24 hours. Therefore, we made only two assumptions. First, the hyperalgesia area distribution should be normal. Second, if there were differences between levobupivacaine and saline groups, it should be at least one standard deviation of that theoretical distribution. Then, we assummed a difference delta = 1 (one sd) in a normal distribution Z(0,1); with a power of 0.95 and a type I error of 0.05:

power.t.test(delta=1, sd = 1, sig.level = 0.05, power=0.95)
## 
##      Two-sample t test power calculation 
## 
##               n = 26.98922
##           delta = 1
##              sd = 1
##       sig.level = 0.05
##           power = 0.95
##     alternative = two.sided
## 
## NOTE: n is number in *each* group

We selected 27 patients per arm.

Section 2: Statistical analysis

First, we loaded the dataset

tabla0<-read_ods(path="/home/rbn/Documentos/manu/cesareas/CRD.ods", sheet = 1)
tabla1<-read_ods(path="/home/rbn/Documentos/manucesarea/Cesareas.ods", sheet = 1)
tabla2<-read_ods(path="/home/rbn/Documentos/manucesarea/Cesareas.ods", sheet = 3)
tabla3<-read_ods(path="/home/rbn/Documentos/manu/cesareas/CRD2.ods", sheet = 1)
dn4<-read_ods(path="/home/rbn/Documentos/manu/cesareas/DN4.ods", sheet = 1)

We generated table 1, group description.

tabmulti(GestacionesPreviasNS + ASA ~ GrupoTto, 
         data = tabla0,
         ymeasures= "freq",
         columns=c("xgroups", "p"),
         n.headings=TRUE) %>% kable()
Variable Levobupivacaine (n = 33) Saline (n = 37) P
GestacionesPreviasNS, n (%)

0.13
   Más de 1 11 (33.3) 19 (51.4)
   Solo 1 22 (66.7) 18 (48.6)
ASA, n (%)

0.90
   1 28 (84.8) 31 (83.8)
   2 5 (15.2) 6 (16.2)
tabmedians(Edad ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##               Variable Levobupivacaine (n = 33)  Saline (n = 37)    P
## 1 Edad, Median (Q1-Q3)         33.0 (30.0-36.0) 35.0 (33.0-40.0) 0.02
tabmedians(Peso ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##               Variable Levobupivacaine (n = 33)  Saline (n = 37)    P
## 1 Peso, Median (Q1-Q3)         78.0 (70.2-83.0) 77.0 (71.0-87.0) 0.70
tabmedians(Talla ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                Variable Levobupivacaine (n = 33)     Saline (n = 37)    P
## 1 Talla, Median (Q1-Q3)      164.0 (162.0-165.0) 163.0 (158.0-168.0) 0.78
tabmedians(BMI ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##              Variable Levobupivacaine (n = 33)  Saline (n = 37)    P
## 1 BMI, Median (Q1-Q3)         29.0 (26.8-31.2) 29.3 (26.6-33.0) 0.54
tabmedians(SemanasGestación ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                           Variable Levobupivacaine (n = 33)  Saline (n = 37)
## 1 SemanasGestación, Median (Q1-Q3)         39.0 (38.6-39.6) 39.0 (38.4-39.8)
##      P
## 1 0.98
tabmedians(BloqueoSensitivo ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                           Variable Levobupivacaine (n = 33)     Saline (n = 37)
## 1 BloqueoSensitivo, Median (Q1-Q3)      120.0 (100.0-135.0) 120.0 (100.0-130.0)
##      P
## 1 0.73
tabmedians(URPA ~ GrupoTto, data=tabla0, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##               Variable Levobupivacaine (n = 33)     Saline (n = 37)    P
## 1 URPA, Median (Q1-Q3)      135.0 (120.0-180.0) 180.0 (120.0-180.0) 0.18

Hyperalgesia

tabmedians(AreaHiperalgesia24h ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                              Variable Levobupivacaine (n = 33)
## 1 AreaHiperalgesia24h, Median (Q1-Q3)         43.4 (18.5-80.0)
##     Saline (n = 37)    P
## 1 68.4 (39.0-136.3) 0.01
tabmedians(AreaHiperalgesia48h ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                              Variable Levobupivacaine (n = 33)
## 1 AreaHiperalgesia48h, Median (Q1-Q3)          45.1 (0.9-89.8)
##     Saline (n = 37)    P
## 1 67.3 (31.3-175.1) 0.03
tabmedians(AreaHiperalgesia72h ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                              Variable Levobupivacaine (n = 33)  Saline (n = 37)
## 1 AreaHiperalgesia72h, Median (Q1-Q3)        57.8 (24.1-104.8) 57.4 (9.5-144.6)
##      P
## 1 0.76

And now we calculated group:time interaction

set_theme(base = theme_minimal())
library(reshape2)
library(nparLD)
l<-c("24h", "48h", "72h")
lsign1<-c("24h\np=0.01", "48h\np=0.03", "72h")
lsign2<-c("24h\np=0.001", "48h", "72h")
lsign3<-c("4h", "24h\np=0.003", "48h\np=0.02")
#hay que cambiar vari
#hiperalgesis

vari<-c("AreaHiperalgesia24h", 
        "AreaHiperalgesia48h", 
        "AreaHiperalgesia72h")

AreaHiperalgesia<-melt(tabla1, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

e<-nparLD(value ~ variable * Group, data=AreaHiperalgesia, subject="Número")
##  Total number of observations:  210 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  3 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   AreaHiperalgesia24h AreaHiperalgesia48h AreaHiperalgesia72h 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
e$ANOVA.test
##                Statistic       df      p-value
## Group           3.109590 1.000000 0.0778325397
## variable        0.130100 1.673347 0.8418924454
## Group:variable  8.982503 1.673347 0.0003414615

And we generated a plot

E<-ggplot(data = AreaHiperalgesia, aes(x = variable, y = value, fill=Group), ) + 
  geom_boxplot(outlier.shape = NA) +
  xlab("time") +
  ylab("cm²") +
  ylim(0,400)+
  scale_fill_manual(values=c("dark grey", "light grey"))+
scale_x_discrete(breaks=vari,
                 labels=lsign1)+
  theme(legend.position = "none")
E <- E + labs(title="Hiperalgesia Area, group:time p < 0.001", tag="A")
E

Now, we repeated the same with pain threshold

tabmedians(UmbralDolor24 ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                        Variable Levobupivacaine (n = 33)     Saline (n = 37)
## 1 UmbralDolor24, Median (Q1-Q3)      633.3 (441.3-802.7) 417.3 (300.0-572.0)
##       P
## 1 0.001
tabmedians(UmbralDolor48 ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                        Variable Levobupivacaine (n = 33)     Saline (n = 37)
## 1 UmbralDolor48, Median (Q1-Q3)      629.7 (391.3-871.7) 490.3 (282.3-830.0)
##      P
## 1 0.30
tabmedians(UmbralDolor72 ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                        Variable Levobupivacaine (n = 33)     Saline (n = 37)
## 1 UmbralDolor72, Median (Q1-Q3)      393.0 (242.7-800.0) 347.7 (253.7-830.0)
##      P
## 1 0.69
vari<-c("UmbralDolor24", 
        "UmbralDolor48", 
        "UmbralDolor72")

UmbralDolor<-melt(tabla1, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

e1<-nparLD(value ~ variable * Group, data=UmbralDolor, subject="Número")
##  Total number of observations:  210 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  3 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   UmbralDolor24 UmbralDolor48 UmbralDolor72 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
e1$ANOVA.test
##                Statistic      df     p-value
## Group           1.923724 1.00000 0.165446697
## variable        5.829538 1.75201 0.004451472
## Group:variable  6.624395 1.75201 0.002188580
E1<-ggplot(data = UmbralDolor, aes(x = variable, y = value, fill=Group), ) + 
  geom_boxplot(outlier.shape = NA) +
  xlab("time") +
  ylab("g/mm²") +
  scale_fill_manual(values=c("dark grey", "light grey"))+
  scale_x_discrete(breaks=vari, labels=lsign2)+
  theme(legend.position = "none")+
  ylim(0,1000)
E1 <- E1 + labs(title="Mechanical pain threshold, group:time p = 0.002", tag="B")
E1

Cumulative Morphine

tabmedians(NumeroBolosMorfina4h ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                               Variable Levobupivacaine (n = 33)
## 1 NumeroBolosMorfina4h, Median (Q1-Q3)         1.00 (0.00-2.00)
##    Saline (n = 37)    P
## 1 2.00 (0.00-4.00) 0.10
tabmedians(NumeroBolosMorfina24h ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                                Variable Levobupivacaine (n = 33)
## 1 NumeroBolosMorfina24h, Median (Q1-Q3)           4.0 (2.0-11.0)
##   Saline (n = 37)     P
## 1 11.0 (6.0-23.0) 0.003
tabmedians(NumeroBolosMorfina48h ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                                Variable Levobupivacaine (n = 33)
## 1 NumeroBolosMorfina48h, Median (Q1-Q3)           9.0 (4.0-16.0)
##   Saline (n = 37)    P
## 1 18.0 (9.0-34.0) 0.02
vari<-c("NumeroBolosMorfina4h", 
        "NumeroBolosMorfina24h", 
        "NumeroBolosMorfina48h")

BolosMorfina<-melt(tabla1, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

h<-nparLD(value ~ variable * Group, BolosMorfina, subject="Número")
##  Total number of observations:  210 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  3 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   NumeroBolosMorfina4h NumeroBolosMorfina24h NumeroBolosMorfina48h 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
h$ANOVA.test
##                 Statistic       df      p-value
## Group            7.842040 1.000000 5.104497e-03
## variable       178.873628 1.386686 2.390925e-55
## Group:variable   5.365765 1.386686 1.158632e-02
H<-ggplot(data = BolosMorfina, aes(x = variable, y = value, fill=Group), ) + 
  geom_boxplot(outlier.shape = NA) +
  xlab("time") +
  ylab("boluses") +
  scale_fill_manual(values=c("dark grey", "light grey"))+
scale_x_discrete(breaks=vari,
                 labels=lsign3)+
  theme(legend.position = "top")+
  ylim(0,50)
E2 <- H + labs(title="Total of Morphine Boluses, group:time p = 0.012", tag="C")
E2

and finnaly Cumulative Acetaminophen

tabla1$AcumPara4<-tabla3$AcumPara4
tabla1$AcumPara24<-tabla3$AcumPara24
tabla1$AcumPara48<-tabla3$AcumPara48
tabmedians(AcumPara4 ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                    Variable Levobupivacaine (n = 33) Saline (n = 37)    P
## 1 AcumPara4, Median (Q1-Q3)                  0 (0-0)         0 (0-0) 0.22
tabmedians(AcumPara24 ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                     Variable Levobupivacaine (n = 33) Saline (n = 37)    P
## 1 AcumPara24, Median (Q1-Q3)                  0 (0-0)         0 (0-1) 0.10
tabmedians(AcumPara48 ~ Group, data=tabla1, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                     Variable Levobupivacaine (n = 33) Saline (n = 37)    P
## 1 AcumPara48, Median (Q1-Q3)                  0 (0-0)         0 (0-1) 0.18
vari<-c("AcumPara4", 
        "AcumPara24", 
        "AcumPara48")

AcumPara<-melt(tabla1, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

v<-nparLD(value ~ variable * Group, AcumPara, subject="Número")
##  Total number of observations:  210 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  3 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   AcumPara4 AcumPara24 AcumPara48 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
v$ANOVA.test
##                 Statistic       df      p-value
## Group           2.8044515 1.000000 0.0940029909
## variable       11.9316913 1.216307 0.0002105459
## Group:variable  0.8798906 1.216307 0.3677845403
H<-ggplot(data = AcumPara, aes(x = variable, y = value, fill=Group), ) + 
  geom_boxplot(outlier.shape = NA) +
  xlab("time") +
  ylab("g") +
  scale_fill_manual(values=c("dark grey", "light grey"))+
scale_x_discrete(breaks=vari,
                 labels=l)+
  theme(legend.position = "top")+
  ylim(0,4)
E3 <- H + labs(title="Acetaminophen (Cumulative), group:time p = 0.274", tag="D")
E3

Now, we finish table 2:

tabmulti(DormirDecubitoLateral ~ GrupoTto, 
         data = tabla0,
         ymeasures= "freq",
         columns=c("xgroups", "p"),
         n.headings=TRUE) %>% kable()
Variable Levobupivacaine (n = 33) Saline (n = 37) P
DormirDecubitoLateral, n (%)

0.02
   No 13 (39.4) 25 (67.6)
   Yes 20 (60.6) 12 (32.4)
tabmedians(AmbulacionHora ~ GrupoTto, data=tabla3, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                         Variable Levobupivacaine (n = 33)   Saline (n = 37)
## 1 AmbulacionHora, Median (Q1-Q3)        4.00 (2.00-22.00) 2.00 (1.00-12.00)
##      P
## 1 0.48
tabmedians(ToleranciaOralHora ~ GrupoTto, data=tabla3, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                             Variable Levobupivacaine (n = 33)   Saline (n = 37)
## 1 ToleranciaOralHora, Median (Q1-Q3)        4.00 (1.00-23.00) 3.00 (1.00-13.00)
##      P
## 1 0.94

And we calculate DN4 and interaction

tabmedians(DN4_1 ~ Group, data=dn4, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                Variable Levobupivacaine (n = 33)  Saline (n = 37)    P
## 1 DN4_1, Median (Q1-Q3)         2.00 (0.00-3.00) 2.00 (1.00-3.00) 0.82
tabmedians(DN4_4 ~ Group, data=dn4, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                Variable Levobupivacaine (n = 33)  Saline (n = 37)    P
## 1 DN4_4, Median (Q1-Q3)         1.00 (1.00-3.00) 2.00 (0.00-2.00) 0.33
tabmedians(DN4_6 ~ Group, data=dn4, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                Variable Levobupivacaine (n = 33)  Saline (n = 37)    P
## 1 DN4_6, Median (Q1-Q3)         0.00 (0.00-2.00) 1.00 (0.00-1.00) 0.75
tabmedians(DN4_12 ~ Group, data=dn4, columns=c("xgroups", "p"), parenth="q1q3", sep.char = "-")
##                 Variable Levobupivacaine (n = 33) Saline (n = 37)    P
## 1 DN4_12, Median (Q1-Q3)                  0 (0-1)         0 (0-1) 0.54
l<-c("1m", "4m", "6m", "12m")


vari<-c("DN4_1", "DN4_4", "DN4_6", "DN4_12")


DN4<-melt(dn4, 
                      id.vars=c("Numero", "Group"),      
                      measure.vars=vari)

y<-nparLD(value ~ variable * Group, data=DN4, subject="Numero")
##  Total number of observations:  280 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  4 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   DN4_1 DN4_4 DN4_6 DN4_12 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
y$ANOVA.test
##                 Statistic       df      p-value
## Group           0.2464455 1.000000 6.195891e-01
## variable       30.2330638 2.740712 4.580421e-18
## Group:variable  0.4280706 2.740712 7.149840e-01

Now, we analyze pain (visceral / somatic, rest, movement)

Somatic Pain at Rest

tabmulti(EVADolorSReposo0 + EVADolorSReposo30m + EVADolorSReposo1h + EVADolorSReposo2h + EVADolorSReposo4h + EVADolorSReposo24h + EVADolorSReposo48h + EVADolorSReposo72h ~ Group,
         data = tabla1,
         ymeasures= "median",
         columns=c("xgroups", "p"),
         n.headings=TRUE) %>% kable()
Variable Levobupivacaine (n = 33) Saline (n = 37) P
EVADolorSReposo0, Median (IQR) 0 (0) 0 (0) 0.36
EVADolorSReposo30m, Median (IQR) 0 (0) 0 (0) 0.94
EVADolorSReposo1h, Median (IQR) 0 (0) 0 (0) 0.47
EVADolorSReposo2h, Median (IQR) 0.00 (2.00) 1.00 (2.00) 0.18
EVADolorSReposo4h, Median (IQR) 1.00 (3.00) 2.00 (3.00) 0.19
EVADolorSReposo24h, Median (IQR) 0 (1) 0 (2) 0.13
EVADolorSReposo48h, Median (IQR) 0 (0) 0 (0) 0.91
EVADolorSReposo72h, Median (IQR) 0 (0) 0 (0) 0.60

Visceral Pain at Rest

Variable Overall (n = 70) Levobupivacaine (n = 33) Saline (n = 37) P
EVADolorVReposo0, Median (IQR) 0 (0) 0 (0) 0 (0) 0.49
EVADolorVReposo30m, Median (IQR) 0 (0) 0 (0) 0 (0) 0.66
EVADolorVReposo1h, Median (IQR) 0 (0) 0 (0) 0 (1) 0.22
EVADolorVReposo2h, Median (IQR) 0.00 (2.00) 0.00 (1.00) 1.00 (3.00) 0.24
EVADolorVReposo4h, Median (IQR) 2.00 (4.00) 2.00 (3.00) 2.00 (4.00) 0.22
EVADolorVReposo24h, Median (IQR) 0 (1) 0 (1) 0 (1) 0.68
EVADolorVReposo48h, Median (IQR) 0 (0) 0 (0) 0 (0) 0.99
EVADolorVReposo72h, Median (IQR) 0 (0) 0 (0) 0 (0) 0.52

Somatic Pain at Movement

tabmulti(EVADolorSMovimiento0 + EVADolorSMovimiento30m + EVADolorSMovimiento1h + EVADolorSMovimiento2h + EVADolorSMovimiento4h + EVADolorSMovimiento24h + EVADolorSMovimiento48h + EVADolorSMovimiento72h ~ Group, 
         data = tabla1,
         ymeasures= "median",
         columns=c("overall", "xgroups", "p"),
         n.headings=TRUE) %>% kable()
Variable Overall (n = 70) Levobupivacaine (n = 33) Saline (n = 37) P
EVADolorSMovimiento0, Median (IQR) 0 (0) 0 (0) 0 (0) 0.22
EVADolorSMovimiento30m, Median (IQR) 0 (1) 0 (1) 0 (0) 0.37
EVADolorSMovimiento1h, Median (IQR) 0 (1) 0 (2) 0 (1) 0.87
EVADolorSMovimiento2h, Median (IQR) 2.00 (3.00) 1.00 (3.00) 2.00 (3.00) 0.51
EVADolorSMovimiento4h, Median (IQR) 3.00 (2.75) 3.00 (3.00) 3.00 (3.00) 0.30
EVADolorSMovimiento24h, Median (IQR) 4.00 (3.00) 2.00 (3.00) 4.00 (3.00) 0.11
EVADolorSMovimiento48h, Median (IQR) 2.00 (3.00) 2.00 (3.00) 2.00 (3.00) 0.56
EVADolorSMovimiento72h, Median (IQR) 1.00 (3.00) 1.00 (3.00) 1.00 (3.00) 0.99

visceral pain at movement

Variable Overall (n = 70) Levobupivacaine (n = 33) Saline (n = 37) P
EVADolorVMovimiento0, Median (IQR) 0 (0) 0 (0) 0 (0) 0.25
EVADolorVMovimiento30m, Median (IQR) 0 (0) 0 (0) 0 (0) 0.64
EVADolorVMovimiento1h, Median (IQR) 0 (1) 0 (0) 0 (1) 0.22
EVADolorVMovimiento2h, Median (IQR) 1.00 (3.00) 0.00 (2.00) 1.00 (3.00) 0.45
EVADolorVMovimiento4h, Median (IQR) 3.00 (4.75) 3.00 (4.00) 3.00 (5.00) 0.36
EVADolorVMovimiento24h, Median (IQR) 0 (4) 0 (3) 0 (4) 0.75
EVADolorVMovimiento48h, Median (IQR) 0 (0) 0 (0) 0 (0) 0.65
EVADolorVMovimiento72h, Median (IQR) 0 (0) 0 (0) 0 (0) 0.62

After that, we generate 4 plots:

##  Total number of observations:  560 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  8 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   EVADolorSReposo0 EVADolorSReposo30m EVADolorSReposo1h EVADolorSReposo2h EVADolorSReposo4h EVADolorSReposo24h EVADolorSReposo48h EVADolorSReposo72h 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
## 
## 
##  Warning(s):
##  The covariance matrix is singular.

Statistic df p-value
Group 2.4365116 1.000000 0.1185396
variable 24.8695273 5.029738 0.0000000
Group:variable 0.7630498 5.029738 0.5770395

##  Total number of observations:  560 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  8 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   EVADolorVReposo0 EVADolorVReposo30m EVADolorVReposo1h EVADolorVReposo2h EVADolorVReposo4h EVADolorVReposo24h EVADolorVReposo48h EVADolorVReposo72h 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
##                 Statistic      df      p-value
## Group           0.6511926 1.00000 4.196866e-01
## variable       32.1342002 4.51179 6.390016e-30
## Group:variable  0.9419341 4.51179 4.459718e-01

##  Total number of observations:  560 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  8 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   EVADolorSMovimiento0 EVADolorSMovimiento30m EVADolorSMovimiento1h EVADolorSMovimiento2h EVADolorSMovimiento4h EVADolorSMovimiento24h EVADolorSMovimiento48h EVADolorSMovimiento72h 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
##                 Statistic       df      p-value
## Group           0.6949119 1.000000 4.044987e-01
## variable       52.3545166 4.322238 1.651518e-47
## Group:variable  0.7214322 4.322238 5.875186e-01

##  Total number of observations:  560 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  8 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   EVADolorVMovimiento0 EVADolorVMovimiento30m EVADolorVMovimiento1h EVADolorVMovimiento2h EVADolorVMovimiento4h EVADolorVMovimiento24h EVADolorVMovimiento48h EVADolorVMovimiento72h 
##  Group level:   Levobupivacaine Saline 
##  If the order is not correct, specify the correct order in time.order or group.order.
##                 Statistic       df      p-value
## Group           0.4897076 1.000000 4.840578e-01
## variable       27.5290758 4.763447 9.015586e-27
## Group:variable  0.7058735 4.763447 6.121294e-01

And with the plot, we can generate Figure 2`

Figure2<-ggarrange(E,E1, E2, E3, A, B, C, D, ncol=2, nrow=4, common.legend = TRUE, legend = "top")
Figure2

Kaplan Meier: Morphine free time

library(gridExtra)
library(ggpubr)
tabla1$Libremorfina<-(tabla1$HorasMorfina1*60+tabla1$MinutosMorfina1)/60
tabla1$censormorfina[tabla1$NumeroBolosMorfina48h==0]<-0 
tabla1$censormorfina[tabla1$NumeroBolosMorfina48h!=0]<-1

fit <-survfit(Surv(time=tabla1$Libremorfina, event=tabla1$censormorfina) ~ tabla1$Group)
G<-ggsurvplot(fit, 
           data = tabla1, 
           pval = TRUE,
           legend = c(0.8,0.8),
           risk.table = "abs_pct",
           xlim = c(0,48),
           break.time.by=12,
           palette=c("black", "dark grey"),
           xlab = "Hours",
           ylab = "Morphine-free Patients (%)",
           surv.scale="percent",
           risk.table.title = "Number of Morphine-free Patients (%)")
Figure3 <- G
Figure3

Biochemical parameters

**** ANALITICAS

Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
PCRPre, M (SD) 0.82 (1.04) 0.87 (1.31) 0.77 (0.63) 0.71
PCRPost, M (SD) 0.76 (0.95) 0.79 (1.20) 0.73 (0.56) 0.81
PCR8h, M (SD) 1.61 (2.17) 1.90 (2.87) 1.28 (0.83) 0.22
PCR1d, M (SD) 9.8 (3.8) 10.0 (4.4) 9.6 (3.0) 0.66
PCR2d, M (SD) 8.88 (3.66) 9.11 (4.33) 8.63 (2.76) 0.57
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
AlfaGAPre, M (SD) 57.7 (12.9) 56.9 (12.0) 58.6 (14.0) 0.60
AlfaGAPost, M (SD) 50.8 (12.1) 50.5 (11.4) 51.2 (13.0) 0.82
AlfaGA8h, M (SD) 52.7 (19.9) 53.4 (25.1) 51.8 (12.0) 0.73
AlfaGA1d, M (SD) 79.3 (18.3) 79.2 (20.5) 79.4 (15.7) 0.96
AlfaGA2d, M (SD) 108.7 (20.1) 108.2 (23.5) 109.3 (15.7) 0.82
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
GlucosaPre, M (SD) 73.0 (10.7) 73.0 (18.5) 71.2 (10.3) 0.54
GlucosaPost, M (SD) 76.1 (7.8) 74.2 (8.1) 78.8 (8.2) 0.07
Glucosa8h, M (SD) 77.7 (21.4) 73.5 (13.3) 93.4 (27.8) <0.001
Glucosa1d, M (SD) 93.9 (13.9) 92.0 (17.4) 102.3 (21.3) 0.04
Glucosa2d, M (SD) 92.8 (23.9) 96.6 (37.2) 103.5 (20.5) 0.28
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
InsulinaPre, M (SD) 3.13 (0.49) 3.07 (0.56) 3.19 (0.39) 0.30
InsulinaPost, M (SD) 3.27 (0.65) 2.94 (0.54) 3.65 (0.55) <0.001
Insulina8h, M (SD) 1.41 (0.66) 0.94 (0.39) 1.94 (0.48) <0.001
Insulina1d, M (SD) 7.54 (2.99) 5.89 (2.17) 9.39 (2.71) <0.001
Insulina2d, M (SD) 8.2 (3.9) 5.8 (2.7) 10.9 (3.4) <0.001
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
CortisolPre, M (SD) 27.9 (5.7) 28.0 (6.3) 27.8 (5.0) 0.93
CortisolPost, M (SD) 34.1 (9.0) 35.6 (10.4) 32.5 (7.0) 0.14
Cortisol8h, M (SD) 17.4 (7.8) 16.1 (7.8) 18.8 (7.7) 0.15
Cortisol1d, M (SD) 20.0 (8.0) 19.6 (7.4) 20.6 (8.7) 0.60
Cortisol2d, M (SD) 17.7 (6.3) 18.1 (7.5) 17.3 (4.7) 0.58
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
ProlactinaPre, M (SD) 405.3 (198.8) 391.3 (154.0) 421.0 (241.0) 0.55
ProlactinaPost, M (SD) 318.9 (124.8) 322.2 (111.9) 315.1 (139.5) 0.82
Prolactina8h, M (SD) 195.3 (82.4) 198.8 (85.6) 191.3 (79.8) 0.70
Prolactina1d, M (SD) 206.2 (85.7) 204.9 (68.6) 207.7 (102.6) 0.89
Prolactina2d, M (SD) 182.4 (79.8) 194.2 (86.7) 169.1 (70.2) 0.19
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
GHPre, M (SD) 0.60 (1.05) 0.49 (0.61) 0.71 (1.38) 0.40
GHPost, M (SD) 0.27 (0.37) 0.32 (0.44) 0.21 (0.28) 0.24
GH8h, M (SD) 0.52 (0.86) 0.48 (0.80) 0.56 (0.92) 0.71
GH1d, M (SD) 1.42 (2.47) 1.09 (1.11) 1.80 (3.39) 0.26
GH2d, M (SD) 0.70 (1.37) 0.50 (0.70) 0.93 (1.84) 0.21
Variable Overall (n = 70) Levobupivacaine (n = 37) Saline (n = 33) P
IL6Pre, M (SD) 6.29 (12.16) 7.75 (14.00) 4.65 (9.66) 0.28
IL6Post, M (SD) 8.49 (11.66) 9.82 (14.46) 7.00 (7.31) 0.30
IL68h, M (SD) 64.8 (38.1) 69.6 (43.1) 59.3 (31.4) 0.25
IL61d, M (SD) 37.2 (22.7) 37.3 (21.1) 37.1 (24.7) 0.97
IL62d, M (SD) 21.6 (21.1) 24.5 (22.7) 18.4 (19.0) 0.23
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   PCRPre PCRPost PCR8h PCR1d PCR2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
##                   Statistic       df       p-value
## Group            0.06189984 1.000000  8.035180e-01
## variable       495.68226271 2.493272 2.317233e-268
## Group:variable   0.17586117 2.493272  8.817169e-01
data_summary <- function(data, varname, groupnames){
  require(plyr)
  summary_func <- function(x, col){
    c(mean = mean(x[[col]], na.rm=TRUE),
      sd = sd(x[[col]], na.rm=TRUE))
  }
  data_sum<-ddply(data, groupnames, .fun=summary_func,
                  varname)
  data_sum <- rename(data_sum, c("mean" = varname))
 return(data_sum)
}
prueba <- data_summary(data=PCR , varname="value", groupnames=c("Group", "variable"))
K<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab(expression(paste(mu,"g/dL"))) +  
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=l)+
  theme(legend.position = "none")
K <- K + labs(title="C-Reactive Protein, ANOVA test p = 0.881", tag="A")
K

#AlfaGA

vari<-c("AlfaGAPre",
        "AlfaGAPost",
        "AlfaGA8h",
        "AlfaGA1d",
        "AlfaGA2d")

AlfaGA<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

l1<-nparLD(value ~ variable * Group, data=AlfaGA, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   AlfaGAPre AlfaGAPost AlfaGA8h AlfaGA1d AlfaGA2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
l1$ANOVA.test
##                  Statistic       df       p-value
## Group            0.2144365 1.000000  6.433121e-01
## variable       394.3515165 2.582871 4.551915e-221
## Group:variable   0.1034942 2.582871  9.405562e-01
prueba <- data_summary(data=AlfaGA , varname="value", groupnames=c("Group", "variable"))
L<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab("mg/mL") + 
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=l)+
  theme(legend.position = "none")
L <- L + labs(title=expression(paste(alpha[1],"-Acid Glycoprotein, ANOVA test p = 0.940")), tag="B")
L

#Glucosa
  
vari<-c("GlucosaPre",
        "GlucosaPost",
        "Glucosa8h",
        "Glucosa1d",
        "Glucosa2d")

Glucosa<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

m<-nparLD(value ~ variable * Group, data=Glucosa, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   GlucosaPre GlucosaPost Glucosa8h Glucosa1d Glucosa2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
m$ANOVA.test
##                 Statistic       df      p-value
## Group          13.8302958 1.000000 2.000839e-04
## variable       30.1562700 3.309549 3.095740e-21
## Group:variable  0.9514672 3.309549 4.210281e-01
prueba <- data_summary(data=Glucosa , varname="value", groupnames=c("Group", "variable"))
M<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab("mg/mL") + 
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=lsign1)+
  theme(legend.position = "none")
M <- M + labs(title="Glucose, ANOVA test p = 0.025", tag="C")
M

#Insulina

vari<-c("InsulinaPre",
        "InsulinaPost",
        "Insulina8h",
        "Insulina1d",
        "Insulina2d")

Insulina<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

n<-nparLD(value ~ variable * Group, data=Insulina, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   InsulinaPre InsulinaPost Insulina8h Insulina1d Insulina2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
  n$ANOVA.test
##                 Statistic       df       p-value
## Group           91.401909 1.000000  1.172633e-21
## variable       298.665953 3.102983 1.903294e-200
## Group:variable   7.171013 3.102983  6.554885e-05
prueba <- data_summary(data=Insulina , varname="value", groupnames=c("Group", "variable"))
N<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab(expression(paste(mu,"UI/mL"))) +
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=lsign2)+
  theme(legend.position = "none")
N <- N + labs(title="Insulin, ANOVA test p = 0.002", tag="D")
N

#Cortisol

vari<-c("CortisolPre",
        "CortisolPost",
        "Cortisol8h",
        "Cortisol1d",
        "Cortisol2d")

Cortisol<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

o<-nparLD(value ~ variable * Group, data=Cortisol, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   CortisolPre CortisolPost Cortisol8h Cortisol1d Cortisol2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
o$ANOVA.test
##                 Statistic       df      p-value
## Group           0.1047257 1.000000 7.462306e-01
## variable       92.8389901 3.070992 1.978511e-61
## Group:variable  1.3759972 3.070992 2.474368e-01
prueba <- data_summary(data=Cortisol , varname="value", groupnames=c("Group", "variable"))
O<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab(expression(paste(mu,"g/dL"))) +  
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=l)+
  theme(legend.position = "none")
O <- O + labs(title="Cortisol, ANOVA test p = 0.247", tag="E")
O

#Prolactine

vari<-c("ProlactinaPre",
        "ProlactinaPost",
        "Prolactina8h",
        "Prolactina1d",
        "Prolactina2d")

Prolactina<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

p<-nparLD(value ~ variable * Group, data=Prolactina, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   ProlactinaPre ProlactinaPost Prolactina8h Prolactina1d Prolactina2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
p$ANOVA.test
##                  Statistic       df      p-value
## Group            0.6150311 1.000000 4.328998e-01
## variable       144.6674571 3.197379 1.053340e-99
## Group:variable   0.3371213 3.197379 8.110872e-01
prueba <- data_summary(data=Prolactina , varname="value", groupnames=c("Group", "variable"))
P<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab("ng/dL") + 
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=l)+
  theme(legend.position = "none")
P <- P + labs(title="Prolactin, ANOVA test p = 0.811", tag="F")
P

#GH

vari<-c("GHPre",
        "GHPost",
        "GH8h",
        "GH1d",
        "GH2d")

GH<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

q<-nparLD(value ~ variable * Group, data=GH, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   GHPre GHPost GH8h GH1d GH2d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
q$ANOVA.test
##                  Statistic       df      p-value
## Group           0.03567876 1.000000 8.501804e-01
## variable       27.06864715 3.501681 5.237010e-20
## Group:variable  0.63207512 3.501681 6.185049e-01
prueba <- data_summary(data=GH , varname="value", groupnames=c("Group", "variable"))
Q<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab("ng/dL") + 
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=l)+
  theme(legend.position = "none")
Q <- Q + labs(title="GH, ANOVA test p = 0.618", tag="G")
Q

#IL6

vari<-c("IL6Pre",
        "IL6Post",
        "IL68h",
        "IL61d",
        "IL62d")

IL6<-melt(tabla2, 
                      id.vars=c("Número", "Group"),      
                      measure.vars=vari)

s<-nparLD(value ~ variable * Group, data=IL6, subject="Número")
##  Total number of observations:  350 
##  Total number of subjects:   70 
##  Total number of missing observations:  0 
## 
##  Class level information 
##  ----------------------- 
##  Levels of variable (sub-plot factor time) :  5 
##  Levels of Group (whole-plot factor group) :  2 
## 
##  Abbreviations 
##  ----------------------- 
##  RankMeans = Rank means
##  Nobs = Number of observations
##  RTE = Relative treatment effect
##  case2x2 = tests for 2-by-2 design
##  Wald.test = Wald-type test statistic
##  ANOVA.test = ANOVA-type test statistic with Box approximation
##  ANOVA.test.mod.Box = modified ANOVA-type test statistic with Box approximation
##  Wald.test.time = Wald-type test statistic for simple time effect
##  ANOVA.test.time = ANOVA-type test statistic for simple time effect
##  N = Standard Normal Distribution N(0,1)
##  T = Student's T distribution with respective degrees of freedom
##  pattern.time (time effects) = Test against patterned alternatives in time using normal distribution ( no pattern specified ) 
##  pair.comparison = Tests for pairwise comparisions (without specifying a pattern) 
##  pattern.pair.comparison = Test for pairwise comparisons with patterned alternatives in time ( no pattern specified ) 
##  pattern.group (group effects) = Test against patterned alternatives in group ( no pattern specified ) 
##  covariance = Covariance matrix 
##  Note: The description output above will disappear by setting description=FALSE in the input. See the help file for details. 
## 
##  F1 LD F1 Model 
##  ----------------------- 
##  Check that the order of the time and group levels are correct.
##  Time level:   IL6Pre IL6Post IL68h IL61d IL62d 
##  Group level:   Saline Levobupivacaine 
##  If the order is not correct, specify the correct order in time.order or group.order.
s$ANOVA.test
##                  Statistic       df       p-value
## Group            2.0662882 1.000000  1.505876e-01
## variable       159.0570298 3.682364 8.264881e-126
## Group:variable   0.1720685 3.682364  9.433193e-01
prueba <- data_summary(data=IL6 , varname="value", groupnames=c("Group", "variable"))
S<-ggplot(prueba, aes(x=variable, y=value, group=Group, shape=Group, linetype=Group)) + 
  geom_errorbar(aes(ymin=value-sd, ymax=value+sd), width=.1, position=position_dodge(0.05)) +
  geom_line() + geom_point()+ theme_classic() +
  xlab("time") +
  ylab("pg/dL") +  
  scale_fill_manual(labels=c("Levobupivacaine", "Saline"))+
  scale_x_discrete(breaks=vari,labels=l)+
  theme(legend.position = "none")
S <- S + labs(title="Interleukin-6, ANOVA test p = 0.943", tag="H")
S

Figure4<-ggarrange(K,L,M,N,O,P,Q,S, ncol=2, nrow=4, common.legend = TRUE, legend = "top")
Figure4