setwd("~/Library/CloudStorage/GoogleDrive-icarounam@gmail.com/Mi unidad/Agrosavia/Colaboraciones/René/1er_Cd/data")
datos<-read.table("testafin2.csv", header=T, sep=',')
datos$curva <- factor(datos$curva, levels = c("1", "2", "3"), 
                      labels = c("T3", "T1","T2"))
datos$gen<-as.factor(datos$gen)
datos$curva<-as.factor(datos$curva)
datos$id<-as.factor(datos$id)
datos$muestra<-as.factor(datos$muestra)
datos$diam2<-as.factor(datos$diam2)
library(ggplot2)
library(Rmisc)
## Loading required package: lattice
## Loading required package: plyr
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.1.2
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✔ tibble  3.2.1     ✔ purrr   1.0.1
## ✔ tidyr   1.3.0     ✔ stringr 1.5.0
## ✔ readr   2.1.1     ✔ forcats 1.0.0
## Warning: package 'tibble' was built under R version 4.1.2
## Warning: package 'tidyr' was built under R version 4.1.2
## Warning: package 'purrr' was built under R version 4.1.2
## Warning: package 'stringr' was built under R version 4.1.2
## Warning: package 'forcats' was built under R version 4.1.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::arrange()   masks plyr::arrange()
## ✖ purrr::compact()   masks plyr::compact()
## ✖ dplyr::count()     masks plyr::count()
## ✖ dplyr::desc()      masks plyr::desc()
## ✖ dplyr::failwith()  masks plyr::failwith()
## ✖ dplyr::filter()    masks stats::filter()
## ✖ dplyr::id()        masks plyr::id()
## ✖ dplyr::lag()       masks stats::lag()
## ✖ dplyr::mutate()    masks plyr::mutate()
## ✖ dplyr::rename()    masks plyr::rename()
## ✖ dplyr::summarise() masks plyr::summarise()
## ✖ dplyr::summarize() masks plyr::summarize()
library(ggpubr)
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:plyr':
## 
##     mutate
library(rstatix)
## 
## Attaching package: 'rstatix'
## The following objects are masked from 'package:plyr':
## 
##     desc, mutate
## The following object is masked from 'package:stats':
## 
##     filter
library(emmeans)
##Summary statistics
summ<-datos %>%
  group_by(curva, gen, diam2) %>%
  get_summary_stats(cd.testa, type = "mean_sd")
summ %>% as_tibble() %>% print(n=Inf)
## # A tibble: 36 × 7
##    curva gen   diam2 variable     n  mean    sd
##    <fct> <fct> <fct> <chr>    <dbl> <dbl> <dbl>
##  1 T3    CCN51 0     cd.testa     3  3.76 0.107
##  2 T3    CCN51 2     cd.testa     3  5.86 1.17 
##  3 T3    CCN51 5     cd.testa     3 10.3  1.80 
##  4 T3    CCN51 6     cd.testa     3 12.3  0.987
##  5 T3    ICS95 0     cd.testa     3  5.55 0.618
##  6 T3    ICS95 2     cd.testa     3  8.38 1.00 
##  7 T3    ICS95 5     cd.testa     3 13.4  1.07 
##  8 T3    ICS95 6     cd.testa     3 14.9  0.442
##  9 T3    TCS01 0     cd.testa     3  2.83 0.288
## 10 T3    TCS01 2     cd.testa     3  5.00 1.05 
## 11 T3    TCS01 5     cd.testa     3  6.87 0.768
## 12 T3    TCS01 6     cd.testa     3  7.83 1.11 
## 13 T1    CCN51 0     cd.testa     3  5.96 1.99 
## 14 T1    CCN51 2     cd.testa     3  8.88 1.39 
## 15 T1    CCN51 5     cd.testa     3 13.4  1.84 
## 16 T1    CCN51 6     cd.testa     3 13.8  0.37 
## 17 T1    ICS95 0     cd.testa     3  6.37 0.255
## 18 T1    ICS95 2     cd.testa     3  7.68 0.589
## 19 T1    ICS95 5     cd.testa     3  9.33 0.373
## 20 T1    ICS95 6     cd.testa     3  9.52 0.84 
## 21 T1    TCS01 0     cd.testa     3  3.75 0.335
## 22 T1    TCS01 2     cd.testa     3  5.08 0.931
## 23 T1    TCS01 5     cd.testa     3  6.53 0.432
## 24 T1    TCS01 6     cd.testa     3  7.30 0.898
## 25 T2    CCN51 0     cd.testa     3  5.09 0.202
## 26 T2    CCN51 2     cd.testa     3  5.18 0.403
## 27 T2    CCN51 5     cd.testa     3  9.80 0.949
## 28 T2    CCN51 6     cd.testa     3  8.67 0.552
## 29 T2    ICS95 0     cd.testa     3  6.87 0.575
## 30 T2    ICS95 2     cd.testa     3  9.03 0.559
## 31 T2    ICS95 5     cd.testa     3  8.10 0.561
## 32 T2    ICS95 6     cd.testa     3 10.1  1.08 
## 33 T2    TCS01 0     cd.testa     3  4.02 0.178
## 34 T2    TCS01 2     cd.testa     3  5.13 0.402
## 35 T2    TCS01 5     cd.testa     3  7.42 0.497
## 36 T2    TCS01 6     cd.testa     3  8.39 1.67
##Visualization
bxp <- ggboxplot(
  datos, x = "curva", y = "cd.testa",
  color = "diam2", palette = "jco",
  facet.by =  "gen"
)
bxp

##Check assumptions
##Outliers

datos %>%
  group_by(curva, gen, diam2) %>%
  identify_outliers(cd.testa)
## [1] curva      gen        diam2      muestra    id         cd.testa   is.outlier
## [8] is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm<-datos %>%
  group_by(curva, gen, diam2) %>%
  shapiro_test(cd.testa)
norm %>% as_tibble() %>% print(n=Inf)
## # A tibble: 36 × 6
##    curva gen   diam2 variable statistic      p
##    <fct> <fct> <fct> <chr>        <dbl>  <dbl>
##  1 T3    CCN51 0     cd.testa     0.964 0.637 
##  2 T3    CCN51 2     cd.testa     0.925 0.470 
##  3 T3    CCN51 5     cd.testa     0.850 0.239 
##  4 T3    CCN51 6     cd.testa     0.976 0.703 
##  5 T3    ICS95 0     cd.testa     0.835 0.201 
##  6 T3    ICS95 2     cd.testa     0.994 0.846 
##  7 T3    ICS95 5     cd.testa     0.993 0.846 
##  8 T3    ICS95 6     cd.testa     0.992 0.825 
##  9 T3    TCS01 0     cd.testa     0.942 0.537 
## 10 T3    TCS01 2     cd.testa     0.987 0.785 
## 11 T3    TCS01 5     cd.testa     0.993 0.835 
## 12 T3    TCS01 6     cd.testa     0.996 0.875 
## 13 T1    CCN51 0     cd.testa     0.894 0.367 
## 14 T1    CCN51 2     cd.testa     0.940 0.528 
## 15 T1    CCN51 5     cd.testa     0.902 0.393 
## 16 T1    CCN51 6     cd.testa     0.973 0.686 
## 17 T1    ICS95 0     cd.testa     0.959 0.609 
## 18 T1    ICS95 2     cd.testa     0.857 0.260 
## 19 T1    ICS95 5     cd.testa     0.985 0.763 
## 20 T1    ICS95 6     cd.testa     0.999 0.948 
## 21 T1    TCS01 0     cd.testa     0.998 0.918 
## 22 T1    TCS01 2     cd.testa     0.935 0.509 
## 23 T1    TCS01 5     cd.testa     0.817 0.155 
## 24 T1    TCS01 6     cd.testa     0.755 0.0106
## 25 T2    CCN51 0     cd.testa     0.883 0.332 
## 26 T2    CCN51 2     cd.testa     0.891 0.358 
## 27 T2    CCN51 5     cd.testa     0.869 0.293 
## 28 T2    CCN51 6     cd.testa     0.920 0.454 
## 29 T2    ICS95 0     cd.testa     0.915 0.436 
## 30 T2    ICS95 2     cd.testa     0.880 0.326 
## 31 T2    ICS95 5     cd.testa     0.962 0.624 
## 32 T2    ICS95 6     cd.testa     0.859 0.265 
## 33 T2    TCS01 0     cd.testa     0.968 0.657 
## 34 T2    TCS01 2     cd.testa     0.802 0.119 
## 35 T2    TCS01 5     cd.testa     0.992 0.833 
## 36 T2    TCS01 6     cd.testa     0.934 0.503
##Create QQ plot for each cell of design:

ggqqplot(datos, "cd.testa", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")
## Warning: The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## Warning: The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev<-datos %>%
  group_by(diam2) %>%
  levene_test(cd.testa ~ curva*gen)
lev %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         8    18     1.18  0.365
## 2 2         8    18     0.432 0.887
## 3 5         8    18     0.537 0.814
## 4 6         8    18     0.410 0.900
##Computation

res.aov <- anova_test(
  data = datos, dv = cd.testa, wid = id,
  within = diam2, between = c(curva, gen)
)
get_anova_table(res.aov)
## ANOVA Table (type II tests)
## 
##            Effect DFn DFd       F        p p<.05   ges
## 1           curva   2  18   5.325 1.50e-02     * 0.198
## 2             gen   2  18  77.179 1.48e-09     * 0.782
## 3           diam2   3  54 252.797 9.35e-32     * 0.891
## 4       curva:gen   4  18  17.181 5.81e-06     * 0.615
## 5     curva:diam2   6  54  11.339 3.68e-08     * 0.423
## 6       gen:diam2   6  54   8.561 1.51e-06     * 0.356
## 7 curva:gen:diam2  12  54   5.894 2.08e-06     * 0.433
#Table by error
res.aov.error <- aov(cd.testa ~ diam2*curva*gen + Error(id/diam2), datos)
res.aov.error
## 
## Call:
## aov(formula = cd.testa ~ diam2 * curva * gen + Error(id/diam2), 
##     data = datos)
## 
## Grand Mean: 7.842315
## 
## Stratum 1: id
## 
## Terms:
##                     curva       gen curva:gen Residuals
## Sum of Squares   15.19935 220.31264  98.08973  25.69123
## Deg. of Freedom         2         2         4        18
## 
## Residual standard error: 1.194693
## 24 out of 32 effects not estimable
## Estimated effects may be unbalanced
## 
## Stratum 2: id:diam2
## 
## Terms:
##                    diam2 diam2:curva diam2:gen diam2:curva:gen Residuals
## Sum of Squares  502.7973     45.1039   34.0544         46.8891   35.8009
## Deg. of Freedom        3           6         6              12        54
## 
## Residual standard error: 0.8142356
## Estimated effects may be unbalanced
## Emmeans
emmip(res.aov.error, gen ~ diam2 | curva)
## Note: re-fitting model with sum-to-zero contrasts

emm_curva <- emmeans(res.aov.error, pairwise ~ curva)
## Note: re-fitting model with sum-to-zero contrasts
## NOTE: Results may be misleading due to involvement in interactions
emm_curva
## $emmeans
##  curva emmean    SE df lower.CL upper.CL
##  T3      8.08 0.199 18     7.66     8.50
##  T1      8.14 0.199 18     7.72     8.55
##  T2      7.31 0.199 18     6.89     7.73
## 
## Results are averaged over the levels of: diam2, gen 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast estimate    SE df t.ratio p.value
##  T3 - T1   -0.0564 0.282 18  -0.200  0.9782
##  T3 - T2    0.7661 0.282 18   2.721  0.0356
##  T1 - T2    0.8225 0.282 18   2.921  0.0236
## 
## Results are averaged over the levels of: diam2, gen 
## P value adjustment: tukey method for comparing a family of 3 estimates
emm_gen_curva <- emmeans(res.aov.error, pairwise ~ gen | curva)
## Note: re-fitting model with sum-to-zero contrasts
## NOTE: Results may be misleading due to involvement in interactions
emm_gen_curva
## $emmeans
## curva = T3:
##  gen   emmean    SE df lower.CL upper.CL
##  CCN51   8.05 0.345 18     7.33     8.78
##  ICS95  10.55 0.345 18     9.83    11.28
##  TCS01   5.63 0.345 18     4.91     6.36
## 
## curva = T1:
##  gen   emmean    SE df lower.CL upper.CL
##  CCN51  10.52 0.345 18     9.80    11.24
##  ICS95   8.22 0.345 18     7.50     8.95
##  TCS01   5.66 0.345 18     4.94     6.39
## 
## curva = T2:
##  gen   emmean    SE df lower.CL upper.CL
##  CCN51   7.18 0.345 18     6.46     7.91
##  ICS95   8.52 0.345 18     7.79     9.24
##  TCS01   6.24 0.345 18     5.51     6.96
## 
## Results are averaged over the levels of: diam2 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95 
## 
## $contrasts
## curva = T3:
##  contrast      estimate    SE df t.ratio p.value
##  CCN51 - ICS95   -2.498 0.488 18  -5.122  0.0002
##  CCN51 - TCS01    2.422 0.488 18   4.965  0.0003
##  ICS95 - TCS01    4.920 0.488 18  10.088  <.0001
## 
## curva = T1:
##  contrast      estimate    SE df t.ratio p.value
##  CCN51 - ICS95    2.297 0.488 18   4.711  0.0005
##  CCN51 - TCS01    4.857 0.488 18   9.958  <.0001
##  ICS95 - TCS01    2.559 0.488 18   5.247  0.0002
## 
## curva = T2:
##  contrast      estimate    SE df t.ratio p.value
##  CCN51 - ICS95   -1.334 0.488 18  -2.735  0.0346
##  CCN51 - TCS01    0.946 0.488 18   1.939  0.1566
##  ICS95 - TCS01    2.280 0.488 18   4.675  0.0005
## 
## Results are averaged over the levels of: diam2 
## P value adjustment: tukey method for comparing a family of 3 estimates
emm_gen_diam2 <- emmeans(res.aov.error, pairwise ~ diam2 | curva*gen)
## Note: re-fitting model with sum-to-zero contrasts
emm_gen_diam2
## $emmeans
## curva = T3, gen = CCN51:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       3.76 0.534 62.6     2.69     4.82
##  2       5.86 0.534 62.6     4.79     6.93
##  5      10.26 0.534 62.6     9.20    11.33
##  6      12.33 0.534 62.6    11.27    13.40
## 
## curva = T1, gen = CCN51:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       5.96 0.534 62.6     4.90     7.03
##  2       8.88 0.534 62.6     7.82     9.95
##  5      13.44 0.534 62.6    12.38    14.51
##  6      13.79 0.534 62.6    12.72    14.86
## 
## curva = T2, gen = CCN51:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       5.09 0.534 62.6     4.02     6.16
##  2       5.18 0.534 62.6     4.11     6.24
##  5       9.80 0.534 62.6     8.73    10.86
##  6       8.67 0.534 62.6     7.60     9.74
## 
## curva = T3, gen = ICS95:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       5.55 0.534 62.6     4.48     6.62
##  2       8.38 0.534 62.6     7.32     9.45
##  5      13.36 0.534 62.6    12.29    14.43
##  6      14.91 0.534 62.6    13.85    15.98
## 
## curva = T1, gen = ICS95:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       6.37 0.534 62.6     5.30     7.44
##  2       7.68 0.534 62.6     6.61     8.74
##  5       9.33 0.534 62.6     8.26    10.39
##  6       9.52 0.534 62.6     8.45    10.58
## 
## curva = T2, gen = ICS95:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       6.87 0.534 62.6     5.81     7.94
##  2       9.03 0.534 62.6     7.97    10.10
##  5       8.10 0.534 62.6     7.04     9.17
##  6      10.06 0.534 62.6     8.99    11.13
## 
## curva = T3, gen = TCS01:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       2.83 0.534 62.6     1.76     3.90
##  2       5.00 0.534 62.6     3.93     6.06
##  5       6.87 0.534 62.6     5.81     7.94
##  6       7.83 0.534 62.6     6.76     8.89
## 
## curva = T1, gen = TCS01:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       3.75 0.534 62.6     2.68     4.81
##  2       5.08 0.534 62.6     4.01     6.14
##  5       6.53 0.534 62.6     5.47     7.60
##  6       7.30 0.534 62.6     6.23     8.36
## 
## curva = T2, gen = TCS01:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       4.02 0.534 62.6     2.95     5.08
##  2       5.13 0.534 62.6     4.06     6.19
##  5       7.42 0.534 62.6     6.35     8.49
##  6       8.39 0.534 62.6     7.32     9.45
## 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95 
## 
## $contrasts
## curva = T3, gen = CCN51:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -2.1033 0.665 54  -3.164  0.0132
##  0 - 5     -6.5067 0.665 54  -9.787  <.0001
##  0 - 6     -8.5767 0.665 54 -12.901  <.0001
##  2 - 5     -4.4033 0.665 54  -6.623  <.0001
##  2 - 6     -6.4733 0.665 54  -9.737  <.0001
##  5 - 6     -2.0700 0.665 54  -3.114  0.0152
## 
## curva = T1, gen = CCN51:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -2.9200 0.665 54  -4.392  0.0003
##  0 - 5     -7.4800 0.665 54 -11.251  <.0001
##  0 - 6     -7.8267 0.665 54 -11.773  <.0001
##  2 - 5     -4.5600 0.665 54  -6.859  <.0001
##  2 - 6     -4.9067 0.665 54  -7.380  <.0001
##  5 - 6     -0.3467 0.665 54  -0.521  0.9536
## 
## curva = T2, gen = CCN51:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -0.0867 0.665 54  -0.130  0.9992
##  0 - 5     -4.7067 0.665 54  -7.080  <.0001
##  0 - 6     -3.5800 0.665 54  -5.385  <.0001
##  2 - 5     -4.6200 0.665 54  -6.949  <.0001
##  2 - 6     -3.4933 0.665 54  -5.255  <.0001
##  5 - 6      1.1267 0.665 54   1.695  0.3364
## 
## curva = T3, gen = ICS95:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -2.8333 0.665 54  -4.262  0.0005
##  0 - 5     -7.8100 0.665 54 -11.748  <.0001
##  0 - 6     -9.3633 0.665 54 -14.084  <.0001
##  2 - 5     -4.9767 0.665 54  -7.486  <.0001
##  2 - 6     -6.5300 0.665 54  -9.822  <.0001
##  5 - 6     -1.5533 0.665 54  -2.336  0.1024
## 
## curva = T1, gen = ICS95:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -1.3067 0.665 54  -1.965  0.2138
##  0 - 5     -2.9567 0.665 54  -4.447  0.0003
##  0 - 6     -3.1467 0.665 54  -4.733  0.0001
##  2 - 5     -1.6500 0.665 54  -2.482  0.0743
##  2 - 6     -1.8400 0.665 54  -2.768  0.0376
##  5 - 6     -0.1900 0.665 54  -0.286  0.9918
## 
## curva = T2, gen = ICS95:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -2.1600 0.665 54  -3.249  0.0104
##  0 - 5     -1.2300 0.665 54  -1.850  0.2617
##  0 - 6     -3.1867 0.665 54  -4.793  0.0001
##  2 - 5      0.9300 0.665 54   1.399  0.5056
##  2 - 6     -1.0267 0.665 54  -1.544  0.4188
##  5 - 6     -1.9567 0.665 54  -2.943  0.0240
## 
## curva = T3, gen = TCS01:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -2.1667 0.665 54  -3.259  0.0102
##  0 - 5     -4.0433 0.665 54  -6.082  <.0001
##  0 - 6     -4.9967 0.665 54  -7.516  <.0001
##  2 - 5     -1.8767 0.665 54  -2.823  0.0327
##  2 - 6     -2.8300 0.665 54  -4.257  0.0005
##  5 - 6     -0.9533 0.665 54  -1.434  0.4841
## 
## curva = T1, gen = TCS01:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -1.3300 0.665 54  -2.001  0.2005
##  0 - 5     -2.7867 0.665 54  -4.192  0.0006
##  0 - 6     -3.5500 0.665 54  -5.340  <.0001
##  2 - 5     -1.4567 0.665 54  -2.191  0.1387
##  2 - 6     -2.2200 0.665 54  -3.339  0.0081
##  5 - 6     -0.7633 0.665 54  -1.148  0.6616
## 
## curva = T2, gen = TCS01:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2     -1.1100 0.665 54  -1.670  0.3495
##  0 - 5     -3.4033 0.665 54  -5.119  <.0001
##  0 - 6     -4.3700 0.665 54  -6.573  <.0001
##  2 - 5     -2.2933 0.665 54  -3.450  0.0059
##  2 - 6     -3.2600 0.665 54  -4.904  0.0001
##  5 - 6     -0.9667 0.665 54  -1.454  0.4720
## 
## P value adjustment: tukey method for comparing a family of 4 estimates
emm_gen_diam2_trend <- emmeans(res.aov.error, pairwise ~ diam2*gen | curva)
## Note: re-fitting model with sum-to-zero contrasts
emm_gen_diam2_trend
## $emmeans
## curva = T3:
##  diam2 gen   emmean    SE   df lower.CL upper.CL
##  0     CCN51   3.76 0.534 62.6     2.69     4.82
##  2     CCN51   5.86 0.534 62.6     4.79     6.93
##  5     CCN51  10.26 0.534 62.6     9.20    11.33
##  6     CCN51  12.33 0.534 62.6    11.27    13.40
##  0     ICS95   5.55 0.534 62.6     4.48     6.62
##  2     ICS95   8.38 0.534 62.6     7.32     9.45
##  5     ICS95  13.36 0.534 62.6    12.29    14.43
##  6     ICS95  14.91 0.534 62.6    13.85    15.98
##  0     TCS01   2.83 0.534 62.6     1.76     3.90
##  2     TCS01   5.00 0.534 62.6     3.93     6.06
##  5     TCS01   6.87 0.534 62.6     5.81     7.94
##  6     TCS01   7.83 0.534 62.6     6.76     8.89
## 
## curva = T1:
##  diam2 gen   emmean    SE   df lower.CL upper.CL
##  0     CCN51   5.96 0.534 62.6     4.90     7.03
##  2     CCN51   8.88 0.534 62.6     7.82     9.95
##  5     CCN51  13.44 0.534 62.6    12.38    14.51
##  6     CCN51  13.79 0.534 62.6    12.72    14.86
##  0     ICS95   6.37 0.534 62.6     5.30     7.44
##  2     ICS95   7.68 0.534 62.6     6.61     8.74
##  5     ICS95   9.33 0.534 62.6     8.26    10.39
##  6     ICS95   9.52 0.534 62.6     8.45    10.58
##  0     TCS01   3.75 0.534 62.6     2.68     4.81
##  2     TCS01   5.08 0.534 62.6     4.01     6.14
##  5     TCS01   6.53 0.534 62.6     5.47     7.60
##  6     TCS01   7.30 0.534 62.6     6.23     8.36
## 
## curva = T2:
##  diam2 gen   emmean    SE   df lower.CL upper.CL
##  0     CCN51   5.09 0.534 62.6     4.02     6.16
##  2     CCN51   5.18 0.534 62.6     4.11     6.24
##  5     CCN51   9.80 0.534 62.6     8.73    10.86
##  6     CCN51   8.67 0.534 62.6     7.60     9.74
##  0     ICS95   6.87 0.534 62.6     5.81     7.94
##  2     ICS95   9.03 0.534 62.6     7.97    10.10
##  5     ICS95   8.10 0.534 62.6     7.04     9.17
##  6     ICS95  10.06 0.534 62.6     8.99    11.13
##  0     TCS01   4.02 0.534 62.6     2.95     5.08
##  2     TCS01   5.13 0.534 62.6     4.06     6.19
##  5     TCS01   7.42 0.534 62.6     6.35     8.49
##  6     TCS01   8.39 0.534 62.6     7.32     9.45
## 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95 
## 
## $contrasts
## curva = T3:
##  contrast          estimate    SE   df t.ratio p.value
##  0 CCN51 - 2 CCN51  -2.1033 0.665 54.0  -3.164  0.0938
##  0 CCN51 - 5 CCN51  -6.5067 0.665 54.0  -9.787  <.0001
##  0 CCN51 - 6 CCN51  -8.5767 0.665 54.0 -12.901  <.0001
##  0 CCN51 - 0 ICS95  -1.7933 0.755 62.6  -2.377  0.4365
##  0 CCN51 - 2 ICS95  -4.6267 0.755 62.6  -6.132  <.0001
##  0 CCN51 - 5 ICS95  -9.6033 0.755 62.6 -12.727  <.0001
##  0 CCN51 - 6 ICS95 -11.1567 0.755 62.6 -14.786  <.0001
##  0 CCN51 - 0 TCS01   0.9267 0.755 62.6   1.228  0.9845
##  0 CCN51 - 2 TCS01  -1.2400 0.755 62.6  -1.643  0.8858
##  0 CCN51 - 5 TCS01  -3.1167 0.755 62.6  -4.130  0.0057
##  0 CCN51 - 6 TCS01  -4.0700 0.755 62.6  -5.394  0.0001
##  2 CCN51 - 5 CCN51  -4.4033 0.665 54.0  -6.623  <.0001
##  2 CCN51 - 6 CCN51  -6.4733 0.665 54.0  -9.737  <.0001
##  2 CCN51 - 0 ICS95   0.3100 0.755 62.6   0.411  1.0000
##  2 CCN51 - 2 ICS95  -2.5233 0.755 62.6  -3.344  0.0571
##  2 CCN51 - 5 ICS95  -7.5000 0.755 62.6  -9.939  <.0001
##  2 CCN51 - 6 ICS95  -9.0533 0.755 62.6 -11.998  <.0001
##  2 CCN51 - 0 TCS01   3.0300 0.755 62.6   4.016  0.0082
##  2 CCN51 - 2 TCS01   0.8633 0.755 62.6   1.144  0.9912
##  2 CCN51 - 5 TCS01  -1.0133 0.755 62.6  -1.343  0.9697
##  2 CCN51 - 6 TCS01  -1.9667 0.755 62.6  -2.606  0.2986
##  5 CCN51 - 6 CCN51  -2.0700 0.665 54.0  -3.114  0.1056
##  5 CCN51 - 0 ICS95   4.7133 0.755 62.6   6.246  <.0001
##  5 CCN51 - 2 ICS95   1.8800 0.755 62.6   2.491  0.3643
##  5 CCN51 - 5 ICS95  -3.0967 0.755 62.6  -4.104  0.0062
##  5 CCN51 - 6 ICS95  -4.6500 0.755 62.6  -6.162  <.0001
##  5 CCN51 - 0 TCS01   7.4333 0.755 62.6   9.851  <.0001
##  5 CCN51 - 2 TCS01   5.2667 0.755 62.6   6.980  <.0001
##  5 CCN51 - 5 TCS01   3.3900 0.755 62.6   4.493  0.0017
##  5 CCN51 - 6 TCS01   2.4367 0.755 62.6   3.229  0.0768
##  6 CCN51 - 0 ICS95   6.7833 0.755 62.6   8.990  <.0001
##  6 CCN51 - 2 ICS95   3.9500 0.755 62.6   5.235  0.0001
##  6 CCN51 - 5 ICS95  -1.0267 0.755 62.6  -1.361  0.9667
##  6 CCN51 - 6 ICS95  -2.5800 0.755 62.6  -3.419  0.0468
##  6 CCN51 - 0 TCS01   9.5033 0.755 62.6  12.594  <.0001
##  6 CCN51 - 2 TCS01   7.3367 0.755 62.6   9.723  <.0001
##  6 CCN51 - 5 TCS01   5.4600 0.755 62.6   7.236  <.0001
##  6 CCN51 - 6 TCS01   4.5067 0.755 62.6   5.973  <.0001
##  0 ICS95 - 2 ICS95  -2.8333 0.665 54.0  -4.262  0.0043
##  0 ICS95 - 5 ICS95  -7.8100 0.665 54.0 -11.748  <.0001
##  0 ICS95 - 6 ICS95  -9.3633 0.665 54.0 -14.084  <.0001
##  0 ICS95 - 0 TCS01   2.7200 0.755 62.6   3.605  0.0280
##  0 ICS95 - 2 TCS01   0.5533 0.755 62.6   0.733  0.9998
##  0 ICS95 - 5 TCS01  -1.3233 0.755 62.6  -1.754  0.8357
##  0 ICS95 - 6 TCS01  -2.2767 0.755 62.6  -3.017  0.1280
##  2 ICS95 - 5 ICS95  -4.9767 0.665 54.0  -7.486  <.0001
##  2 ICS95 - 6 ICS95  -6.5300 0.665 54.0  -9.822  <.0001
##  2 ICS95 - 0 TCS01   5.5533 0.755 62.6   7.360  <.0001
##  2 ICS95 - 2 TCS01   3.3867 0.755 62.6   4.488  0.0017
##  2 ICS95 - 5 TCS01   1.5100 0.755 62.6   2.001  0.6908
##  2 ICS95 - 6 TCS01   0.5567 0.755 62.6   0.738  0.9998
##  5 ICS95 - 6 ICS95  -1.5533 0.665 54.0  -2.336  0.4649
##  5 ICS95 - 0 TCS01  10.5300 0.755 62.6  13.955  <.0001
##  5 ICS95 - 2 TCS01   8.3633 0.755 62.6  11.084  <.0001
##  5 ICS95 - 5 TCS01   6.4867 0.755 62.6   8.597  <.0001
##  5 ICS95 - 6 TCS01   5.5333 0.755 62.6   7.333  <.0001
##  6 ICS95 - 0 TCS01  12.0833 0.755 62.6  16.014  <.0001
##  6 ICS95 - 2 TCS01   9.9167 0.755 62.6  13.142  <.0001
##  6 ICS95 - 5 TCS01   8.0400 0.755 62.6  10.655  <.0001
##  6 ICS95 - 6 TCS01   7.0867 0.755 62.6   9.392  <.0001
##  0 TCS01 - 2 TCS01  -2.1667 0.665 54.0  -3.259  0.0744
##  0 TCS01 - 5 TCS01  -4.0433 0.665 54.0  -6.082  <.0001
##  0 TCS01 - 6 TCS01  -4.9967 0.665 54.0  -7.516  <.0001
##  2 TCS01 - 5 TCS01  -1.8767 0.665 54.0  -2.823  0.1998
##  2 TCS01 - 6 TCS01  -2.8300 0.665 54.0  -4.257  0.0043
##  5 TCS01 - 6 TCS01  -0.9533 0.665 54.0  -1.434  0.9512
## 
## curva = T1:
##  contrast          estimate    SE   df t.ratio p.value
##  0 CCN51 - 2 CCN51  -2.9200 0.665 54.0  -4.392  0.0028
##  0 CCN51 - 5 CCN51  -7.4800 0.665 54.0 -11.251  <.0001
##  0 CCN51 - 6 CCN51  -7.8267 0.665 54.0 -11.773  <.0001
##  0 CCN51 - 0 ICS95  -0.4067 0.755 62.6  -0.539  1.0000
##  0 CCN51 - 2 ICS95  -1.7133 0.755 62.6  -2.271  0.5074
##  0 CCN51 - 5 ICS95  -3.3633 0.755 62.6  -4.457  0.0019
##  0 CCN51 - 6 ICS95  -3.5533 0.755 62.6  -4.709  0.0008
##  0 CCN51 - 0 TCS01   2.2167 0.755 62.6   2.938  0.1531
##  0 CCN51 - 2 TCS01   0.8867 0.755 62.6   1.175  0.9891
##  0 CCN51 - 5 TCS01  -0.5700 0.755 62.6  -0.755  0.9998
##  0 CCN51 - 6 TCS01  -1.3333 0.755 62.6  -1.767  0.8290
##  2 CCN51 - 5 CCN51  -4.5600 0.665 54.0  -6.859  <.0001
##  2 CCN51 - 6 CCN51  -4.9067 0.665 54.0  -7.380  <.0001
##  2 CCN51 - 0 ICS95   2.5133 0.755 62.6   3.331  0.0592
##  2 CCN51 - 2 ICS95   1.2067 0.755 62.6   1.599  0.9029
##  2 CCN51 - 5 ICS95  -0.4433 0.755 62.6  -0.588  1.0000
##  2 CCN51 - 6 ICS95  -0.6333 0.755 62.6  -0.839  0.9994
##  2 CCN51 - 0 TCS01   5.1367 0.755 62.6   6.807  <.0001
##  2 CCN51 - 2 TCS01   3.8067 0.755 62.6   5.045  0.0002
##  2 CCN51 - 5 TCS01   2.3500 0.755 62.6   3.114  0.1018
##  2 CCN51 - 6 TCS01   1.5867 0.755 62.6   2.103  0.6227
##  5 CCN51 - 6 CCN51  -0.3467 0.665 54.0  -0.521  1.0000
##  5 CCN51 - 0 ICS95   7.0733 0.755 62.6   9.374  <.0001
##  5 CCN51 - 2 ICS95   5.7667 0.755 62.6   7.642  <.0001
##  5 CCN51 - 5 ICS95   4.1167 0.755 62.6   5.456  0.0001
##  5 CCN51 - 6 ICS95   3.9267 0.755 62.6   5.204  0.0001
##  5 CCN51 - 0 TCS01   9.6967 0.755 62.6  12.851  <.0001
##  5 CCN51 - 2 TCS01   8.3667 0.755 62.6  11.088  <.0001
##  5 CCN51 - 5 TCS01   6.9100 0.755 62.6   9.158  <.0001
##  5 CCN51 - 6 TCS01   6.1467 0.755 62.6   8.146  <.0001
##  6 CCN51 - 0 ICS95   7.4200 0.755 62.6   9.833  <.0001
##  6 CCN51 - 2 ICS95   6.1133 0.755 62.6   8.102  <.0001
##  6 CCN51 - 5 ICS95   4.4633 0.755 62.6   5.915  <.0001
##  6 CCN51 - 6 ICS95   4.2733 0.755 62.6   5.663  <.0001
##  6 CCN51 - 0 TCS01  10.0433 0.755 62.6  13.310  <.0001
##  6 CCN51 - 2 TCS01   8.7133 0.755 62.6  11.547  <.0001
##  6 CCN51 - 5 TCS01   7.2567 0.755 62.6   9.617  <.0001
##  6 CCN51 - 6 TCS01   6.4933 0.755 62.6   8.605  <.0001
##  0 ICS95 - 2 ICS95  -1.3067 0.665 54.0  -1.965  0.7135
##  0 ICS95 - 5 ICS95  -2.9567 0.665 54.0  -4.447  0.0024
##  0 ICS95 - 6 ICS95  -3.1467 0.665 54.0  -4.733  0.0009
##  0 ICS95 - 0 TCS01   2.6233 0.755 62.6   3.477  0.0400
##  0 ICS95 - 2 TCS01   1.2933 0.755 62.6   1.714  0.8549
##  0 ICS95 - 5 TCS01  -0.1633 0.755 62.6  -0.216  1.0000
##  0 ICS95 - 6 TCS01  -0.9267 0.755 62.6  -1.228  0.9845
##  2 ICS95 - 5 ICS95  -1.6500 0.665 54.0  -2.482  0.3728
##  2 ICS95 - 6 ICS95  -1.8400 0.665 54.0  -2.768  0.2231
##  2 ICS95 - 0 TCS01   3.9300 0.755 62.6   5.208  0.0001
##  2 ICS95 - 2 TCS01   2.6000 0.755 62.6   3.446  0.0436
##  2 ICS95 - 5 TCS01   1.1433 0.755 62.6   1.515  0.9307
##  2 ICS95 - 6 TCS01   0.3800 0.755 62.6   0.504  1.0000
##  5 ICS95 - 6 ICS95  -0.1900 0.665 54.0  -0.286  1.0000
##  5 ICS95 - 0 TCS01   5.5800 0.755 62.6   7.395  <.0001
##  5 ICS95 - 2 TCS01   4.2500 0.755 62.6   5.632  <.0001
##  5 ICS95 - 5 TCS01   2.7933 0.755 62.6   3.702  0.0212
##  5 ICS95 - 6 TCS01   2.0300 0.755 62.6   2.690  0.2554
##  6 ICS95 - 0 TCS01   5.7700 0.755 62.6   7.647  <.0001
##  6 ICS95 - 2 TCS01   4.4400 0.755 62.6   5.884  <.0001
##  6 ICS95 - 5 TCS01   2.9833 0.755 62.6   3.954  0.0099
##  6 ICS95 - 6 TCS01   2.2200 0.755 62.6   2.942  0.1516
##  0 TCS01 - 2 TCS01  -1.3300 0.665 54.0  -2.001  0.6910
##  0 TCS01 - 5 TCS01  -2.7867 0.665 54.0  -4.192  0.0053
##  0 TCS01 - 6 TCS01  -3.5500 0.665 54.0  -5.340  0.0001
##  2 TCS01 - 5 TCS01  -1.4567 0.665 54.0  -2.191  0.5629
##  2 TCS01 - 6 TCS01  -2.2200 0.665 54.0  -3.339  0.0608
##  5 TCS01 - 6 TCS01  -0.7633 0.665 54.0  -1.148  0.9907
## 
## curva = T2:
##  contrast          estimate    SE   df t.ratio p.value
##  0 CCN51 - 2 CCN51  -0.0867 0.665 54.0  -0.130  1.0000
##  0 CCN51 - 5 CCN51  -4.7067 0.665 54.0  -7.080  <.0001
##  0 CCN51 - 6 CCN51  -3.5800 0.665 54.0  -5.385  0.0001
##  0 CCN51 - 0 ICS95  -1.7833 0.755 62.6  -2.363  0.4452
##  0 CCN51 - 2 ICS95  -3.9433 0.755 62.6  -5.226  0.0001
##  0 CCN51 - 5 ICS95  -3.0133 0.755 62.6  -3.993  0.0088
##  0 CCN51 - 6 ICS95  -4.9700 0.755 62.6  -6.587  <.0001
##  0 CCN51 - 0 TCS01   1.0733 0.755 62.6   1.422  0.9545
##  0 CCN51 - 2 TCS01  -0.0367 0.755 62.6  -0.049  1.0000
##  0 CCN51 - 5 TCS01  -2.3300 0.755 62.6  -3.088  0.1085
##  0 CCN51 - 6 TCS01  -3.2967 0.755 62.6  -4.369  0.0026
##  2 CCN51 - 5 CCN51  -4.6200 0.665 54.0  -6.949  <.0001
##  2 CCN51 - 6 CCN51  -3.4933 0.665 54.0  -5.255  0.0002
##  2 CCN51 - 0 ICS95  -1.6967 0.755 62.6  -2.249  0.5225
##  2 CCN51 - 2 ICS95  -3.8567 0.755 62.6  -5.111  0.0002
##  2 CCN51 - 5 ICS95  -2.9267 0.755 62.6  -3.879  0.0125
##  2 CCN51 - 6 ICS95  -4.8833 0.755 62.6  -6.472  <.0001
##  2 CCN51 - 0 TCS01   1.1600 0.755 62.6   1.537  0.9240
##  2 CCN51 - 2 TCS01   0.0500 0.755 62.6   0.066  1.0000
##  2 CCN51 - 5 TCS01  -2.2433 0.755 62.6  -2.973  0.1415
##  2 CCN51 - 6 TCS01  -3.2100 0.755 62.6  -4.254  0.0038
##  5 CCN51 - 6 CCN51   1.1267 0.665 54.0   1.695  0.8627
##  5 CCN51 - 0 ICS95   2.9233 0.755 62.6   3.874  0.0127
##  5 CCN51 - 2 ICS95   0.7633 0.755 62.6   1.012  0.9969
##  5 CCN51 - 5 ICS95   1.6933 0.755 62.6   2.244  0.5255
##  5 CCN51 - 6 ICS95  -0.2633 0.755 62.6  -0.349  1.0000
##  5 CCN51 - 0 TCS01   5.7800 0.755 62.6   7.660  <.0001
##  5 CCN51 - 2 TCS01   4.6700 0.755 62.6   6.189  <.0001
##  5 CCN51 - 5 TCS01   2.3767 0.755 62.6   3.150  0.0935
##  5 CCN51 - 6 TCS01   1.4100 0.755 62.6   1.869  0.7733
##  6 CCN51 - 0 ICS95   1.7967 0.755 62.6   2.381  0.4337
##  6 CCN51 - 2 ICS95  -0.3633 0.755 62.6  -0.482  1.0000
##  6 CCN51 - 5 ICS95   0.5667 0.755 62.6   0.751  0.9998
##  6 CCN51 - 6 ICS95  -1.3900 0.755 62.6  -1.842  0.7885
##  6 CCN51 - 0 TCS01   4.6533 0.755 62.6   6.167  <.0001
##  6 CCN51 - 2 TCS01   3.5433 0.755 62.6   4.696  0.0009
##  6 CCN51 - 5 TCS01   1.2500 0.755 62.6   1.657  0.8804
##  6 CCN51 - 6 TCS01   0.2833 0.755 62.6   0.375  1.0000
##  0 ICS95 - 2 ICS95  -2.1600 0.665 54.0  -3.249  0.0762
##  0 ICS95 - 5 ICS95  -1.2300 0.665 54.0  -1.850  0.7831
##  0 ICS95 - 6 ICS95  -3.1867 0.665 54.0  -4.793  0.0007
##  0 ICS95 - 0 TCS01   2.8567 0.755 62.6   3.786  0.0165
##  0 ICS95 - 2 TCS01   1.7467 0.755 62.6   2.315  0.4775
##  0 ICS95 - 5 TCS01  -0.5467 0.755 62.6  -0.724  0.9999
##  0 ICS95 - 6 TCS01  -1.5133 0.755 62.6  -2.006  0.6879
##  2 ICS95 - 5 ICS95   0.9300 0.665 54.0   1.399  0.9588
##  2 ICS95 - 6 ICS95  -1.0267 0.665 54.0  -1.544  0.9208
##  2 ICS95 - 0 TCS01   5.0167 0.755 62.6   6.648  <.0001
##  2 ICS95 - 2 TCS01   3.9067 0.755 62.6   5.177  0.0002
##  2 ICS95 - 5 TCS01   1.6133 0.755 62.6   2.138  0.5985
##  2 ICS95 - 6 TCS01   0.6467 0.755 62.6   0.857  0.9993
##  5 ICS95 - 6 ICS95  -1.9567 0.665 54.0  -2.943  0.1551
##  5 ICS95 - 0 TCS01   4.0867 0.755 62.6   5.416  0.0001
##  5 ICS95 - 2 TCS01   2.9767 0.755 62.6   3.945  0.0102
##  5 ICS95 - 5 TCS01   0.6833 0.755 62.6   0.906  0.9988
##  5 ICS95 - 6 TCS01  -0.2833 0.755 62.6  -0.375  1.0000
##  6 ICS95 - 0 TCS01   6.0433 0.755 62.6   8.009  <.0001
##  6 ICS95 - 2 TCS01   4.9333 0.755 62.6   6.538  <.0001
##  6 ICS95 - 5 TCS01   2.6400 0.755 62.6   3.499  0.0377
##  6 ICS95 - 6 TCS01   1.6733 0.755 62.6   2.218  0.5437
##  0 TCS01 - 2 TCS01  -1.1100 0.665 54.0  -1.670  0.8738
##  0 TCS01 - 5 TCS01  -3.4033 0.665 54.0  -5.119  0.0002
##  0 TCS01 - 6 TCS01  -4.3700 0.665 54.0  -6.573  <.0001
##  2 TCS01 - 5 TCS01  -2.2933 0.665 54.0  -3.450  0.0457
##  2 TCS01 - 6 TCS01  -3.2600 0.665 54.0  -4.904  0.0005
##  5 TCS01 - 6 TCS01  -0.9667 0.665 54.0  -1.454  0.9464
## 
## P value adjustment: tukey method for comparing a family of 12 estimates
emm_diam2 <- emmeans(res.aov.error, pairwise ~ diam2)
## Note: re-fitting model with sum-to-zero contrasts
## NOTE: Results may be misleading due to involvement in interactions
emm_diam2
## $emmeans
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       4.91 0.178 62.6     4.56     5.27
##  2       6.69 0.178 62.6     6.33     7.05
##  5       9.46 0.178 62.6     9.10     9.81
##  6      10.31 0.178 62.6     9.95    10.67
## 
## Results are averaged over the levels of: curva, gen 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast estimate    SE df t.ratio p.value
##  0 - 2      -1.780 0.222 54  -8.031  <.0001
##  0 - 5      -4.547 0.222 54 -20.518  <.0001
##  0 - 6      -5.400 0.222 54 -24.366  <.0001
##  2 - 5      -2.767 0.222 54 -12.488  <.0001
##  2 - 6      -3.620 0.222 54 -16.335  <.0001
##  5 - 6      -0.853 0.222 54  -3.847  0.0018
## 
## Results are averaged over the levels of: curva, gen 
## P value adjustment: tukey method for comparing a family of 4 estimates
emm_diam2_curva <- emmeans(res.aov.error, pairwise ~ diam2 | curva)
## Note: re-fitting model with sum-to-zero contrasts
## NOTE: Results may be misleading due to involvement in interactions
emm_diam2_curva
## $emmeans
## curva = T3:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       4.05 0.308 62.6     3.43     4.66
##  2       6.41 0.308 62.6     5.80     7.03
##  5      10.17 0.308 62.6     9.55    10.78
##  6      11.69 0.308 62.6    11.08    12.31
## 
## curva = T1:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       5.36 0.308 62.6     4.74     5.98
##  2       7.21 0.308 62.6     6.60     7.83
##  5       9.77 0.308 62.6     9.15    10.38
##  6      10.20 0.308 62.6     9.59    10.82
## 
## curva = T2:
##  diam2 emmean    SE   df lower.CL upper.CL
##  0       5.33 0.308 62.6     4.71     5.94
##  2       6.45 0.308 62.6     5.83     7.06
##  5       8.44 0.308 62.6     7.82     9.06
##  6       9.04 0.308 62.6     8.42     9.65
## 
## Results are averaged over the levels of: gen 
## Warning: EMMs are biased unless design is perfectly balanced 
## Confidence level used: 0.95 
## 
## $contrasts
## curva = T3:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2      -2.368 0.384 54  -6.169  <.0001
##  0 - 5      -6.120 0.384 54 -15.944  <.0001
##  0 - 6      -7.646 0.384 54 -19.919  <.0001
##  2 - 5      -3.752 0.384 54  -9.776  <.0001
##  2 - 6      -5.278 0.384 54 -13.750  <.0001
##  5 - 6      -1.526 0.384 54  -3.975  0.0012
## 
## curva = T1:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2      -1.852 0.384 54  -4.826  0.0001
##  0 - 5      -4.408 0.384 54 -11.484  <.0001
##  0 - 6      -4.841 0.384 54 -12.613  <.0001
##  2 - 5      -2.556 0.384 54  -6.658  <.0001
##  2 - 6      -2.989 0.384 54  -7.787  <.0001
##  5 - 6      -0.433 0.384 54  -1.129  0.6734
## 
## curva = T2:
##  contrast estimate    SE df t.ratio p.value
##  0 - 2      -1.119 0.384 54  -2.915  0.0258
##  0 - 5      -3.113 0.384 54  -8.111  <.0001
##  0 - 6      -3.712 0.384 54  -9.671  <.0001
##  2 - 5      -1.994 0.384 54  -5.196  <.0001
##  2 - 6      -2.593 0.384 54  -6.756  <.0001
##  5 - 6      -0.599 0.384 54  -1.560  0.4096
## 
## Results are averaged over the levels of: gen 
## P value adjustment: tukey method for comparing a family of 4 estimates
##Splitting dataframe by temperature ramp
## Protocol 3 (T3)

datos.curve1<-filter(datos, curva=="T3")

##Check assumptions
##Outliers

datos.curve1 %>%
  group_by(gen, diam2) %>%
  identify_outliers(cd.testa)
## [1] gen        diam2      curva      muestra    id         cd.testa   is.outlier
## [8] is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm1<-datos.curve1 %>%
  group_by(gen, diam2) %>%
  shapiro_test(cd.testa)
norm1 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 12 × 5
##    gen   diam2 variable statistic     p
##    <fct> <fct> <chr>        <dbl> <dbl>
##  1 CCN51 0     cd.testa     0.964 0.637
##  2 CCN51 2     cd.testa     0.925 0.470
##  3 CCN51 5     cd.testa     0.850 0.239
##  4 CCN51 6     cd.testa     0.976 0.703
##  5 ICS95 0     cd.testa     0.835 0.201
##  6 ICS95 2     cd.testa     0.994 0.846
##  7 ICS95 5     cd.testa     0.993 0.846
##  8 ICS95 6     cd.testa     0.992 0.825
##  9 TCS01 0     cd.testa     0.942 0.537
## 10 TCS01 2     cd.testa     0.987 0.785
## 11 TCS01 5     cd.testa     0.993 0.835
## 12 TCS01 6     cd.testa     0.996 0.875
##Create QQ plot for each cell of design:

ggqqplot(datos.curve1, "cd.testa", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")
## Warning: The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev1<-datos.curve1 %>%
  group_by(diam2) %>%
  levene_test(cd.testa ~ gen)
lev1 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         2     6    0.632  0.563
## 2 2         2     6    0.0108 0.989
## 3 5         2     6    0.276  0.768
## 4 6         2     6    0.565  0.596
##Computation

res.aov1 <- anova_test(
  data = datos.curve1, dv = cd.testa, wid = id,
  within = diam2, between = gen
)
get_anova_table(res.aov1)
## ANOVA Table (type II tests)
## 
##      Effect  DFn  DFd       F        p p<.05   ges
## 1       gen 2.00 6.00  89.883 3.37e-05     * 0.865
## 2     diam2 1.21 7.23 110.375 8.80e-06     * 0.935
## 3 gen:diam2 2.41 7.23   4.232 5.60e-02       0.526
#CCN51
datos.ccn<-filter(datos.curve1, gen=="CCN51")
res.aov.ccn1 <- anova_test(
  data = datos.ccn, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.ccn1)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd     F        p p<.05   ges
## 1  diam2   3   6 32.05 0.000433     * 0.926
#ICS95
datos.ics<-filter(datos.curve1, gen=="ICS95")
res.aov.ics1 <- anova_test(
  data = datos.ics, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.ics1)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd       F        p p<.05   ges
## 1  diam2   3   6 101.961 1.55e-05     * 0.969
#TCS01
datos.tcs<-filter(datos.curve1, gen=="TCS01")
res.aov.tcs1 <- anova_test(
  data = datos.tcs, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.tcs1)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F     p p<.05   ges
## 1  diam2   3   6 15.123 0.003     * 0.879
## Protocol 1 (T1)

datos.curve2<-filter(datos, curva=="T1")

##Check assumptions
##Outliers

datos.curve2 %>%
  group_by(gen, diam2) %>%
  identify_outliers(cd.testa)
## [1] gen        diam2      curva      muestra    id         cd.testa   is.outlier
## [8] is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm2<-datos.curve2 %>%
  group_by(gen, diam2) %>%
  shapiro_test(cd.testa)
norm2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 12 × 5
##    gen   diam2 variable statistic      p
##    <fct> <fct> <chr>        <dbl>  <dbl>
##  1 CCN51 0     cd.testa     0.894 0.367 
##  2 CCN51 2     cd.testa     0.940 0.528 
##  3 CCN51 5     cd.testa     0.902 0.393 
##  4 CCN51 6     cd.testa     0.973 0.686 
##  5 ICS95 0     cd.testa     0.959 0.609 
##  6 ICS95 2     cd.testa     0.857 0.260 
##  7 ICS95 5     cd.testa     0.985 0.763 
##  8 ICS95 6     cd.testa     0.999 0.948 
##  9 TCS01 0     cd.testa     0.998 0.918 
## 10 TCS01 2     cd.testa     0.935 0.509 
## 11 TCS01 5     cd.testa     0.817 0.155 
## 12 TCS01 6     cd.testa     0.755 0.0106
##Create QQ plot for each cell of design:

ggqqplot(datos.curve2, "cd.testa", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")
## Warning: The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev2<-datos.curve2 %>%
  group_by(diam2) %>%
  levene_test(cd.testa ~ gen)
lev2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         2     6     1.35  0.329
## 2 2         2     6     0.397 0.689
## 3 5         2     6     1.12  0.385
## 4 6         2     6     0.246 0.789
##Computation

res.aov2 <- anova_test(
  data = datos.curve2, dv = cd.testa, wid = id,
  within = diam2, between = gen
)
get_anova_table(res.aov2)
## ANOVA Table (type II tests)
## 
##      Effect DFn DFd      F        p p<.05   ges
## 1       gen   2   6 33.644 5.49e-04     * 0.849
## 2     diam2   3  18 66.218 6.39e-10     * 0.847
## 3 gen:diam2   6  18  7.330 4.41e-04     * 0.550
#CCN51
datos.ccn<-filter(datos.curve2, gen=="CCN51")
res.aov.ccn2 <- anova_test(
  data = datos.ccn, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.ccn2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F        p p<.05   ges
## 1  diam2   3   6 29.892 0.000527     * 0.872
#ICS95
datos.ics<-filter(datos.curve2, gen=="ICS95")
res.aov.ics2 <- anova_test(
  data = datos.ics, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.ics2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F        p p<.05   ges
## 1  diam2   3   6 26.763 0.000716     * 0.888
#TCS01
datos.tcs<-filter(datos.curve2, gen=="TCS01")
res.aov.tcs2 <- anova_test(
  data = datos.tcs, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.tcs2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F     p p<.05  ges
## 1  diam2   3   6 17.325 0.002     * 0.85
## Protocol 2 (T2)

datos.curve3<-filter(datos, curva=="T2")

##Check assumptions
##Outliers

datos.curve3 %>%
  group_by(gen, diam2) %>%
  identify_outliers(cd.testa)
## [1] gen        diam2      curva      muestra    id         cd.testa   is.outlier
## [8] is.extreme
## <0 rows> (or 0-length row.names)
##Normality assumption
##Compute Shapiro-Wilk test for each combinations of factor levels:

norm2<-datos.curve3 %>%
  group_by(gen, diam2) %>%
  shapiro_test(cd.testa)
norm2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 12 × 5
##    gen   diam2 variable statistic     p
##    <fct> <fct> <chr>        <dbl> <dbl>
##  1 CCN51 0     cd.testa     0.883 0.332
##  2 CCN51 2     cd.testa     0.891 0.358
##  3 CCN51 5     cd.testa     0.869 0.293
##  4 CCN51 6     cd.testa     0.920 0.454
##  5 ICS95 0     cd.testa     0.915 0.436
##  6 ICS95 2     cd.testa     0.880 0.326
##  7 ICS95 5     cd.testa     0.962 0.624
##  8 ICS95 6     cd.testa     0.859 0.265
##  9 TCS01 0     cd.testa     0.968 0.657
## 10 TCS01 2     cd.testa     0.802 0.119
## 11 TCS01 5     cd.testa     0.992 0.833
## 12 TCS01 6     cd.testa     0.934 0.503
##Create QQ plot for each cell of design:

ggqqplot(datos.curve3, "cd.testa", ggtheme = theme_bw()) +
  facet_grid(diam2~ curva*gen, labeller = "label_both")
## Warning: The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?
## The following aesthetics were dropped during statistical transformation: sample
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
##   the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
##   variable into a factor?

##Homogneity of variance assumption

##Compute the Levene’s test at each level of the within-subjects factor, here time variable:

lev2<-datos.curve3 %>%
  group_by(diam2) %>%
  levene_test(cd.testa ~ gen)
lev2 %>% as_tibble() %>% print(n=Inf)
## # A tibble: 4 × 5
##   diam2   df1   df2 statistic     p
##   <fct> <int> <int>     <dbl> <dbl>
## 1 0         2     6    0.803  0.491
## 2 2         2     6    0.0730 0.930
## 3 5         2     6    0.212  0.815
## 4 6         2     6    0.488  0.636
##Computation

res.aov2 <- anova_test(
  data = datos.curve3, dv = cd.testa, wid = id,
  within = diam2, between = gen
)
get_anova_table(res.aov2)
## ANOVA Table (type II tests)
## 
##      Effect DFn DFd      F        p p<.05   ges
## 1       gen   2   6 11.505 9.00e-03     * 0.699
## 2     diam2   3  18 90.448 4.78e-11     * 0.856
## 3 gen:diam2   6  18 14.004 6.45e-06     * 0.648
#CCN51
datos.ccn<-filter(datos.curve3, gen=="CCN51")
res.aov.ccn2 <- anova_test(
  data = datos.ccn, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.ccn2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F        p p<.05   ges
## 1  diam2   3   6 62.105 6.56e-05     * 0.949
#ICS95
datos.ics<-filter(datos.curve3, gen=="ICS95")
res.aov.ics2 <- anova_test(
  data = datos.ics, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.ics2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F        p p<.05   ges
## 1  diam2   3   6 40.072 0.000231     * 0.795
#TCS01
datos.tcs<-filter(datos.curve3, gen=="TCS01")
res.aov.tcs2 <- anova_test(
  data = datos.tcs, dv = cd.testa, wid = id,
  within = diam2
)
get_anova_table(res.aov.tcs2)
## ANOVA Table (type III tests)
## 
##   Effect DFn DFd      F        p p<.05  ges
## 1  diam2   3   6 25.837 0.000789     * 0.85
## Gráficas por réplica y genotipo
datos$diam2<-as.numeric(as.character(datos$diam2))
##Gráfica por réplica compuesta
pht<- ggplot(datos, aes(x = diam2)) +
  facet_grid(curva~gen*muestra) +
  geom_line(aes(y=cd.testa)) +
  geom_point(aes(y=cd.testa)) +
  scale_y_continuous(name = expression("Cd (mg*kg"^"-1)")) +  # Etiqueta de la variable continua
  scale_x_continuous(name = "día", breaks=seq(0,7,1)) + # Etiqueta de los grupos
  theme(axis.line = element_line(colour = "black", # Personalización del tema
                                 size = 0.25)) +
  theme(text = element_text(size = 12))
## Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
pht

## Gráfica por genotipo

datos2<-summarySE (datos, measurevar = "cd.testa", groupvars = c("curva", "gen","diam2"))
write.csv(datos2, "~/Library/CloudStorage/GoogleDrive-icarounam@gmail.com/Mi unidad/Agrosavia/Env_muestra/data/Cd_testa_mean.csv")

pht2<- ggplot(datos2, aes(x = diam2)) +
  facet_grid(curva~gen) +
  geom_errorbar(aes(ymin=cd.testa-ci, ymax=cd.testa+ci), width=.1) +
  geom_line(aes(y=cd.testa)) +
  geom_point(aes(y=cd.testa)) +
  scale_y_continuous(name = expression("Cd (mg*kg"^"-1)")) +  # Etiqueta de la variable continua
  scale_x_continuous(name = "día", breaks=seq(0,7,1)) + # Etiqueta de los grupos
  theme(axis.line = element_line(colour = "black", # Personalización del tema
                                 size = 0.25)) +
  theme(text = element_text(size = 15))
pht2