# ============================
# 1. Cargar paquetes
# ============================
library(readxl)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.6
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.1     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.2.0     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(agricolae)
library(car)       # Para Levene
## Loading required package: carData
## 
## Attaching package: 'car'
## 
## The following object is masked from 'package:dplyr':
## 
##     recode
## 
## The following object is masked from 'package:purrr':
## 
##     some
library(rstatix)   # Para Shapiro-Wilk
## 
## Attaching package: 'rstatix'
## 
## The following object is masked from 'package:stats':
## 
##     filter
# ============================
# 2. Importar datos
# ============================
datos <- read_excel("Patogenicidad_HM2.xlsx", sheet = "diam_les")
datos$Tratamientos <- as.factor(datos$Tratamientos)

# ============================
# 3. Asegurar que las variables sean numéricas
# ============================
datos <- datos %>%
  mutate(
    diam_tran_les = as.numeric(trimws(diam_tran_les)),
    diam_long_les = as.numeric(trimws(diam_long_les))
  )

# ============================
# 4. Función de análisis completo
# ============================
analisis_completo <- function(var, ylabel){

  cat("\n================================\n")
  cat("Variable:", var, "\n")
  cat("================================\n\n")
  
  # ---- 4a. Descriptivas ----
  descriptivas <- datos %>%
    group_by(Tratamientos) %>%
    summarise(
      n = n(),
      media = mean(.data[[var]], na.rm = TRUE),
      sd = sd(.data[[var]], na.rm = TRUE),
      min = min(.data[[var]], na.rm = TRUE),
      max = max(.data[[var]], na.rm = TRUE),
      se = sd / sqrt(n)
    )
  print(descriptivas)
  
  # ---- 4b. ANOVA ----
  formula_anova <- as.formula(paste(var, "~ Tratamientos"))
  modelo <- aov(formula_anova, data = datos)
  cat("\nANOVA:\n")
  print(summary(modelo))
  
  # ---- 4c. Comprobación de supuestos ----
  residuos <- residuals(modelo)
  
  cat("\nShapiro-Wilk normality test:\n")
  print(shapiro.test(residuos))
  
  cat("\nLevene's Test for homogeneity of variance:\n")
  print(leveneTest(formula_anova, data = datos))
  
  # ---- 4d. Comparación de medias: Tukey HSD ----
  tukey <- HSD.test(modelo, "Tratamientos", group = TRUE)
  print(tukey$groups)
  
  # Preparar tabla para graficar
  tukey_df <- tukey$groups %>%
    rownames_to_column("Tratamientos") %>%
    left_join(descriptivas, by = "Tratamientos") %>%
    arrange(media)
  
  # ---- 4e. Gráfico ----
  ggplot(tukey_df, aes(x = reorder(Tratamientos, media), y = media)) +
    geom_col(fill = "orange", width = 0.6) +
    geom_errorbar(aes(ymin = media - se, ymax = media + se),
                  width = 0.15, linewidth = 0.8) +
    geom_text(aes(label = groups, y = media + se + 0.5), size = 4) +
    labs(x = "Tratamientos",
         y = ylabel,
         title = paste("Comparación de medias —", ylabel)) +
    theme_bw() +
    theme(axis.text.x = element_text(angle = 90, hjust = 1))
}

# ============================
# 5. Ejecutar análisis
# ============================
# Para diámetro transversal
analisis_completo("diam_tran_les", "Lesión transversal (cm)")
## 
## ================================
## Variable: diam_tran_les 
## ================================
## 
## # A tibble: 29 × 7
##    Tratamientos     n media     sd   min   max     se
##    <fct>        <int> <dbl>  <dbl> <dbl> <dbl>  <dbl>
##  1 112              4 0.875 0.126    0.7   1   0.0629
##  2 114              4 1.48  0.386    1.1   1.9 0.193 
##  3 3Q1              4 1.82  1.37     0.6   3.2 0.684 
##  4 3Q10             4 1.08  0.479    0.4   1.5 0.239 
##  5 3Q11             4 0.7   0.0816   0.6   0.8 0.0408
##  6 3Q12             4 1.75  0.465    1.3   2.2 0.233 
##  7 3Q3              4 1.12  0.222    0.8   1.3 0.111 
##  8 3Q4              4 0.9   0.294    0.6   1.3 0.147 
##  9 3Q5              4 1.55  0.640    0.9   2.1 0.320 
## 10 3Q9              4 1.42  0.727    0.7   2.1 0.364 
## # ℹ 19 more rows
## 
## ANOVA:
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## Tratamientos 28  69.61  2.4861   8.412 7.13e-15 ***
## Residuals    87  25.71  0.2955                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Shapiro-Wilk normality test:
## 
##  Shapiro-Wilk normality test
## 
## data:  residuos
## W = 0.98386, p-value = 0.1787
## 
## 
## Levene's Test for homogeneity of variance:
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value    Pr(>F)    
## group 28  11.604 < 2.2e-16 ***
##       87                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##            diam_tran_les groups
## ASI                3.225      a
## EM1                3.025     ab
## PecanBON           2.875    abc
## Huay1              2.300   abcd
## Huay2              2.300   abcd
## Huay3              1.925  abcde
## EM2                1.850 abcdef
## 3Q1                1.825 abcdef
## 3Q12               1.750 abcdef
## VID1               1.675  bcdef
## 3Q5                1.550  bcdef
## 114                1.475  cdefg
## 3Q9                1.425  cdefg
## HMV4               1.350   defg
## VID3               1.325   defg
## OlivoHMFCA         1.300   defg
## 3Q3                1.125   defg
## 3Q10               1.075   defg
## Car                0.950   defg
## CO3                0.925   defg
## 3Q4                0.900   defg
## 112                0.875   defg
## Car2               0.825   defg
## EM4                0.750    efg
## 3Q11               0.700    efg
## CO1                0.550    efg
## VID4               0.550    efg
## CO6                0.425     fg
## Control            0.000      g

# Para diámetro longitudinal
analisis_completo("diam_long_les", "Lesión longitudinal (cm)")
## 
## ================================
## Variable: diam_long_les 
## ================================
## 
## # A tibble: 29 × 7
##    Tratamientos     n media    sd   min   max    se
##    <fct>        <int> <dbl> <dbl> <dbl> <dbl> <dbl>
##  1 112              4  2.28 0.785   1.4   3.3 0.392
##  2 114              4  6.22 1.96    4.6   8.8 0.980
##  3 3Q1              4  5.78 5.47    0.9  11   2.74 
##  4 3Q10             4  4.42 2.20    1.3   6.1 1.10 
##  5 3Q11             4  1.02 0.320   0.8   1.5 0.160
##  6 3Q12             4  6.5  0.712   5.9   7.5 0.356
##  7 3Q3              4  7    0.816   6     8   0.408
##  8 3Q4              4  1.72 1.26    0.9   3.6 0.630
##  9 3Q5              4  4.92 1.86    3.3   7.3 0.929
## 10 3Q9              4  4.53 2.43    2.2   7   1.21 
## # ℹ 19 more rows
## 
## ANOVA:
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## Tratamientos 28  608.7  21.740    4.65 1.78e-08 ***
## Residuals    87  406.7   4.675                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Shapiro-Wilk normality test:
## 
##  Shapiro-Wilk normality test
## 
## data:  residuos
## W = 0.96337, p-value = 0.002947
## 
## 
## Levene's Test for homogeneity of variance:
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value    Pr(>F)    
## group 28  11.526 < 2.2e-16 ***
##       87                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##            diam_long_les groups
## EM1                8.050      a
## 3Q3                7.000     ab
## Huay1              6.675    abc
## Huay2              6.675    abc
## PecanBON           6.650    abc
## 3Q12               6.500   abcd
## 114                6.225  abcde
## OlivoHMFCA         5.975  abcde
## 3Q1                5.775 abcdef
## EM2                5.550 abcdef
## Huay3              4.950 abcdef
## 3Q5                4.925 abcdef
## ASI                4.925 abcdef
## 3Q9                4.525 abcdef
## 3Q10               4.425 abcdef
## VID1               4.375 abcdef
## HMV4               4.200 abcdef
## VID3               3.825 abcdef
## Car2               2.525 abcdef
## Car                2.500 abcdef
## 112                2.275 abcdef
## 3Q4                1.725  bcdef
## EM4                1.625  bcdef
## CO3                1.500  bcdef
## VID4               1.075   cdef
## 3Q11               1.025   cdef
## CO1                0.650    def
## CO6                0.475     ef
## Control            0.000      f

================================ Variable: diam_tran_les ================================

ANOVA

p-value = 7.13e-15: es muchísimo menor que 0.05, lo que significa que hay diferencias estadísticamente significativas entre al menos un par de tratamientos para la variable diam_tran_les.

Interpretación: Los tratamientos afectan significativamente el diámetro transversal de la lesión. No todos los tratamientos son iguales; algunos causan lesiones más grandes que otros.

Prueba de normalidad (Shapiro-Wilk)

Hipótesis:

𝐻0: Los datos son normales. 𝐻a: Los datos no son normales.

Interpretación:

W = 0.98386, p-value = 0.1787

Como p > 0.05, no hay evidencia para rechazar la hipótesis de normalidad.

Esto indica que los residuos del modelo ANOVA se distribuyen aproximadamente de forma normal, lo que valida el uso del ANOVA clásico. p-value = 0.1787 > 0.05

Levene’s Test

Hipótesis nula (H₀): las varianzas son iguales entre los grupos.

Hipótesis alternativa (H₁): al menos un grupo tiene varianza diferente.

p-value < 2.2e-16: es mucho menor que 0.05, por lo que rechazamos H₀.

Interpretación: Las varianzas de los tratamientos no son homogéneas; hay heterocedasticidad.

Implicaciones para el ANOVA

El ANOVA clásico asume homogeneidad de varianzas.

Dado que hay heterocedasticidad, los resultados del ANOVA pueden ser sensibles a este problema, aunque con tamaños de muestra balanceados (n = 4 por tratamiento) el ANOVA es relativamente robusto.

Alternativas:

_Transformar los datos (raíz cuadrada, logaritmo, etc.) y volver a probar ANOVA y Levene (Se lo hizo y continua habiendo heterocedasticidad) .

_Usar ANOVA robusto o pruebas no paramétricas (ej. Kruskal-Wallis) si la transformación no corrige la heterocedasticidad.

Tranformación

Tus datos son medidas de diámetros de lesiones (≥ 0, continuas):

_Raíz cuadrada es la más indicada si las diferencias de varianza no son extremas.

_Log(x+1) se usa si hay muchos valores pequeños y varianzas muy desiguales (por ejemplo, algunos 0 y otros muy grandes).

Prueba raíz cuadrada:

datos$sqrt_diam <- sqrt(datos$diam_tran_les)
shapiro.test(residuals(aov(sqrt_diam ~ Tratamientos, data=datos)))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(aov(sqrt_diam ~ Tratamientos, data = datos))
## W = 0.98326, p-value = 0.1581
leveneTest(sqrt_diam ~ Tratamientos, data=datos)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value    Pr(>F)    
## group 28  4.9903 3.889e-09 ***
##       87                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Transformación logarítmica
datos$log_diam <- log(datos$diam_tran_les + 1)

# ANOVA con datos transformados
modelo_log <- aov(log_diam ~ Tratamientos, data = datos)

# Normalidad de los residuos
shapiro.test(residuals(modelo_log))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(modelo_log)
## W = 0.98839, p-value = 0.4273
# Homogeneidad de varianzas
library(car)
leveneTest(log_diam ~ Tratamientos, data = datos)
## Levene's Test for Homogeneity of Variance (center = median)
##       Df F value    Pr(>F)    
## group 28  6.6069 4.849e-12 ***
##       87                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Interpretación de ambas transformaciones

Normalidad (Shapiro-Wilk)

_Raíz cuadrada: W = 0.98326, p = 0.1581 → no se rechaza normalidad

_Log(x+1): W = 0.98839, p = 0.4273 → no se rechaza normalidad

Ambos cumplen bastante bien el supuesto de normalidad. El log tiene un valor de W ligeramente más cercano a 1 y p más alto, indicando residuos un poco más normales, aunque la diferencia es mínima.

Homogeneidad de varianzas (Levene)

Raíz cuadrada: F = 4.9903, p = 3.89e-09 → rechaza homogeneidad

Log(x+1): F = 6.6069, p = 4.85e-12 → rechaza homogeneidad

ambos siguen mostrando heterocedasticidad significativa, y de hecho el log es un poco peor que la raíz cuadrada en este sentido (F más alto).

Conclusión práctica

_Normalidad: ambos aceptables.

_Homogeneidad de varianzas: ninguna transformación la arregla completamente, aunque la raíz cuadrada tiene F ligeramente menor que el log. _La raíz cuadrada es más conveniente porque mantiene las varianzas un poco más homogéneas y la normalidad es aceptable. _Dado que tu diseño es balanceado, puedes justificar el uso de ANOVA + Tukey incluso con heterocedasticidad leve a moderada.

Aunque los datos presentaron cierta heterogeneidad de varianzas entre tratamientos, el diseño completamente balanceado (n = 4 por tratamiento) y la normalidad aceptable de los residuos permiten aplicar ANOVA y la prueba de Tukey HSD de manera robusta. Para mejorar el cumplimiento de los supuestos, se aplicó una transformación de raíz cuadrada a los valores de diámetro de lesión transversal, la cual redujo parcialmente la heterocedasticidad y mantuvo la normalidad de los residuos (Shapiro-Wilk, p = 0.1581; Levene, F = 4.99, p < 0.001). Esta estrategia es consistente con la literatura que respalda la robustez del ANOVA en diseños balanceados frente a desviaciones moderadas de los supuestos (Glass et al., 1972; Maxwell & Delaney, 2004).

Ajustar ANOVA con datos transformados

modelo_sqrt <- aov(sqrt_diam ~ Tratamientos, data = datos)
summary(modelo_sqrt)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## Tratamientos 28 15.319  0.5471   10.57 <2e-16 ***
## Residuals    87  4.501  0.0517                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Interpretación: El análisis de varianza (ANOVA) muestra que existen diferencias altamente significativas entre los 29 tratamientos evaluados (F = 10.57, p < 0.001). La variación debida a los tratamientos (Sum Sq = 15.319) es mucho mayor que la variación residual dentro de los grupos (Sum Sq = 4.501), lo que indica que los tratamientos influyen de manera clara en la variable medida. En otras palabras, no todos los tratamientos tienen el mismo efecto y, para identificar cuáles difieren entre sí, es necesario realizar un análisis post-hoc, como Tukey.

comparaciones múltiples (Tukey HSD)

mostrará las diferencias par a par y los intervalos de confianza.

tukey_res <- TukeyHSD(modelo_sqrt)
tukey_res
##   Tukey multiple comparisons of means
##     95% family-wise confidence level
## 
## Fit: aov(formula = sqrt_diam ~ Tratamientos, data = datos)
## 
## $Tratamientos
##                             diff         lwr         upr     p adj
## 114-112              0.273118174 -0.34762548  0.89386183 0.9961513
## 3Q1-112              0.334851127 -0.28589253  0.95559478 0.9497610
## 3Q10-112             0.078039514 -0.54270414  0.69878317 1.0000000
## 3Q11-112            -0.097920677 -0.71866433  0.52282298 1.0000000
## 3Q12-112             0.380435533 -0.24030812  1.00117919 0.8370880
## 3Q3-112              0.122866556 -0.49787710  0.74361021 1.0000000
## 3Q4-112              0.005963990 -0.61477966  0.62670764 1.0000000
## 3Q5-112              0.290435218 -0.33030843  0.91117887 0.9908906
## 3Q9-112              0.228666985 -0.39207667  0.84941064 0.9997828
## ASI-112              0.861531194  0.24078754  1.48227485 0.0002424
## Car-112              0.027313719 -0.59342993  0.64805737 1.0000000
## Car2-112            -0.031319445 -0.65206310  0.58942421 1.0000000
## CO1-112             -0.192654930 -0.81339858  0.42808872 0.9999916
## CO3-112              0.021479830 -0.59926382  0.64222348 1.0000000
## CO6-112             -0.369431626 -0.99017528  0.25131203 0.8719128
## Control-112         -0.933506656 -1.55425031 -0.31276300 0.0000382
## EM1-112              0.802257207  0.18151355  1.42300086 0.0010342
## EM2-112              0.346466268 -0.27427738  0.96720992 0.9288829
## EM4-112             -0.071866672 -0.69261032  0.54887698 1.0000000
## HMV4-112             0.220542844 -0.40020081  0.84128650 0.9998866
## Huay1-112            0.562090452 -0.05865320  1.18283410 0.1353191
## Huay2-112            0.562090452 -0.05865320  1.18283410 0.1353191
## Huay3-112            0.438534233 -0.18220942  1.05927789 0.5924213
## OlivoHMFCA-112       0.206246325 -0.41449733  0.82698998 0.9999677
## PecanBON-112         0.758755793  0.13801214  1.37949945 0.0028569
## VID1-112             0.353426478 -0.26731717  0.97417013 0.9138697
## VID3-112             0.203940317 -0.41680334  0.82468397 0.9999740
## VID4-112            -0.201469308 -0.82221296  0.41927435 0.9999795
## 3Q1-114              0.061732953 -0.55901070  0.68247661 1.0000000
## 3Q10-114            -0.195078661 -0.81582231  0.42566499 0.9999892
## 3Q11-114            -0.371038852 -0.99178250  0.24970480 0.8671250
## 3Q12-114             0.107317359 -0.51342629  0.72806101 1.0000000
## 3Q3-114             -0.150251618 -0.77099527  0.47049203 1.0000000
## 3Q4-114             -0.267154184 -0.88789784  0.35358947 0.9972244
## 3Q5-114              0.017317044 -0.60342661  0.63806070 1.0000000
## 3Q9-114             -0.044451189 -0.66519484  0.57629246 1.0000000
## ASI-114              0.588413020 -0.03233063  1.20915667 0.0882870
## Car-114             -0.245804455 -0.86654811  0.37493920 0.9992530
## Car2-114            -0.304437619 -0.92518127  0.31630603 0.9832319
## CO1-114             -0.465773105 -1.08651676  0.15497055 0.4651762
## CO3-114             -0.251638345 -0.87238200  0.36910531 0.9989054
## CO6-114             -0.642549800 -1.26329345 -0.02180615 0.0332359
## Control-114         -1.206624830 -1.82736848 -0.58588118 0.0000000
## EM1-114              0.529139033 -0.09160462  1.14988269 0.2195770
## EM2-114              0.073348094 -0.54739556  0.69409175 1.0000000
## EM4-114             -0.344984846 -0.96572850  0.27575881 0.9318314
## HMV4-114            -0.052575331 -0.67331898  0.56816832 1.0000000
## Huay1-114            0.288972277 -0.33177138  0.90971593 0.9914897
## Huay2-114            0.288972277 -0.33177138  0.90971593 0.9914897
## Huay3-114            0.165416059 -0.45532759  0.78615971 0.9999997
## OlivoHMFCA-114      -0.066871849 -0.68761550  0.55387180 1.0000000
## PecanBON-114         0.485637619 -0.13510603  1.10638127 0.3778416
## VID1-114             0.080308304 -0.54043535  0.70105196 1.0000000
## VID3-114            -0.069177857 -0.68992151  0.55156580 1.0000000
## VID4-114            -0.474587482 -1.09533113  0.14615617 0.4255454
## 3Q10-3Q1            -0.256811614 -0.87755527  0.36393204 0.9984870
## 3Q11-3Q1            -0.432771804 -1.05351546  0.18797185 0.6194366
## 3Q12-3Q1             0.045584406 -0.57515925  0.66632806 1.0000000
## 3Q3-3Q1             -0.211984571 -0.83272822  0.40875908 0.9999456
## 3Q4-3Q1             -0.328887137 -0.94963079  0.29185652 0.9585734
## 3Q5-3Q1             -0.044415909 -0.66515956  0.57632774 1.0000000
## 3Q9-3Q1             -0.106184142 -0.72692780  0.51455951 1.0000000
## ASI-3Q1              0.526680067 -0.09406359  1.14742372 0.2271050
## Car-3Q1             -0.307537408 -0.92828106  0.31320625 0.9809895
## Car2-3Q1            -0.366170572 -0.98691423  0.25457308 0.8813070
## CO1-3Q1             -0.527506057 -1.14824971  0.09323760 0.2245566
## CO3-3Q1             -0.313371298 -0.93411495  0.30737236 0.9761370
## CO6-3Q1             -0.704282753 -1.32502641 -0.08353910 0.0095130
## Control-3Q1         -1.268357783 -1.88910144 -0.64761413 0.0000000
## EM1-3Q1              0.467406080 -0.15333757  1.08814973 0.4577450
## EM2-3Q1              0.011615141 -0.60912851  0.63235879 1.0000000
## EM4-3Q1             -0.406717799 -1.02746145  0.21402585 0.7363818
## HMV4-3Q1            -0.114308284 -0.73505194  0.50643537 1.0000000
## Huay1-3Q1            0.227239325 -0.39350433  0.84798298 0.9998057
## Huay2-3Q1            0.227239325 -0.39350433  0.84798298 0.9998057
## Huay3-3Q1            0.103683106 -0.51706055  0.72442676 1.0000000
## OlivoHMFCA-3Q1      -0.128604802 -0.74934846  0.49213885 1.0000000
## PecanBON-3Q1         0.423904666 -0.19683899  1.04464832 0.6604533
## VID1-3Q1             0.018575351 -0.60216830  0.63931900 1.0000000
## VID3-3Q1            -0.130910810 -0.75165446  0.48983284 1.0000000
## VID4-3Q1            -0.536320435 -1.15706409  0.08442322 0.1985977
## 3Q11-3Q10           -0.175960191 -0.79670384  0.44478346 0.9999987
## 3Q12-3Q10            0.302396019 -0.31834763  0.92313967 0.9845906
## 3Q3-3Q10             0.044827042 -0.57591661  0.66557070 1.0000000
## 3Q4-3Q10            -0.072075523 -0.69281918  0.54866813 1.0000000
## 3Q5-3Q10             0.212395705 -0.40834795  0.83313936 0.9999436
## 3Q9-3Q10             0.150627471 -0.47011618  0.77137112 1.0000000
## ASI-3Q10             0.783491681  0.16274803  1.40423533 0.0016120
## Car-3Q10            -0.050725794 -0.67146945  0.57001786 1.0000000
## Car2-3Q10           -0.109358959 -0.73010261  0.51138469 1.0000000
## CO1-3Q10            -0.270694444 -0.89143810  0.35004921 0.9966235
## CO3-3Q10            -0.056559684 -0.67730334  0.56418397 1.0000000
## CO6-3Q10            -0.447471139 -1.06821479  0.17327251 0.5503236
## Control-3Q10        -1.011546169 -1.63228982 -0.39080252 0.0000047
## EM1-3Q10             0.724217693  0.10347404  1.34496135 0.0061855
## EM2-3Q10             0.268426754 -0.35231690  0.88917041 0.9970198
## EM4-3Q10            -0.149906186 -0.77064984  0.47083747 1.0000000
## HMV4-3Q10            0.142503330 -0.47824032  0.76324698 1.0000000
## Huay1-3Q10           0.484050938 -0.13669271  1.10479459 0.3845363
## Huay2-3Q10           0.484050938 -0.13669271  1.10479459 0.3845363
## Huay3-3Q10           0.360494719 -0.26024893  0.98123837 0.8966267
## OlivoHMFCA-3Q10      0.128206811 -0.49253684  0.74895046 1.0000000
## PecanBON-3Q10        0.680716279  0.05997263  1.30145993 0.0155740
## VID1-3Q10            0.275386965 -0.34535669  0.89613062 0.9956601
## VID3-3Q10            0.125900803 -0.49484285  0.74664446 1.0000000
## VID4-3Q10           -0.279508821 -0.90025247  0.34123483 0.9946325
## 3Q12-3Q11            0.478356210 -0.14238744  1.09909986 0.4090027
## 3Q3-3Q11             0.220787233 -0.39995642  0.84153089 0.9998843
## 3Q4-3Q11             0.103884668 -0.51685899  0.72462832 1.0000000
## 3Q5-3Q11             0.388355896 -0.23238776  1.00909955 0.8091667
## 3Q9-3Q11             0.326587662 -0.29415599  0.94733131 0.9616477
## ASI-3Q11             0.959451872  0.33870822  1.58019552 0.0000193
## Car-3Q11             0.125234397 -0.49550926  0.74597805 1.0000000
## Car2-3Q11            0.066601232 -0.55414242  0.68734489 1.0000000
## CO1-3Q11            -0.094734253 -0.71547791  0.52600940 1.0000000
## CO3-3Q11             0.119400507 -0.50134315  0.74014416 1.0000000
## CO6-3Q11            -0.271510948 -0.89225460  0.34923270 0.9964702
## Control-3Q11        -0.835585978 -1.45632963 -0.21484233 0.0004614
## EM1-3Q11             0.900177884  0.27943423  1.52092154 0.0000909
## EM2-3Q11             0.444386945 -0.17635671  1.06513060 0.5648552
## EM4-3Q11             0.026054005 -0.59468965  0.64679766 1.0000000
## HMV4-3Q11            0.318463521 -0.30228013  0.93920717 0.9711639
## Huay1-3Q11           0.660011129  0.03926748  1.28075478 0.0236495
## Huay2-3Q11           0.660011129  0.03926748  1.28075478 0.0236495
## Huay3-3Q11           0.536454910 -0.08428874  1.15719856 0.1982191
## OlivoHMFCA-3Q11      0.304167002 -0.31657665  0.92491065 0.9834172
## PecanBON-3Q11        0.856676470  0.23593282  1.47742012 0.0002737
## VID1-3Q11            0.451347156 -0.16939650  1.07209081 0.5320949
## VID3-3Q11            0.301860994 -0.31888266  0.92260465 0.9849318
## VID4-3Q11           -0.103548630 -0.72429228  0.51719502 1.0000000
## 3Q3-3Q12            -0.257568977 -0.87831263  0.36317468 0.9984155
## 3Q4-3Q12            -0.374471543 -0.99521520  0.24627211 0.8565537
## 3Q5-3Q12            -0.090000315 -0.71074397  0.53074334 1.0000000
## 3Q9-3Q12            -0.151768548 -0.77251220  0.46897510 1.0000000
## ASI-3Q12             0.481095661 -0.13964799  1.10183931 0.3971498
## Car-3Q12            -0.353121813 -0.97386547  0.26762184 0.9145674
## Car2-3Q12           -0.411754978 -1.03249863  0.20898867 0.7147630
## CO1-3Q12            -0.573090463 -1.19383412  0.04765319 0.1136721
## CO3-3Q12            -0.358955703 -0.97969936  0.26178795 0.9005543
## CO6-3Q12            -0.749867159 -1.37061081 -0.12912351 0.0034960
## Control-3Q12        -1.313942188 -1.93468584 -0.69319854 0.0000000
## EM1-3Q12             0.421821674 -0.19892198  1.04256533 0.6699463
## EM2-3Q12            -0.033969265 -0.65471292  0.58677439 1.0000000
## EM4-3Q12            -0.452302205 -1.07304586  0.16844145 0.5276131
## HMV4-3Q12           -0.159892689 -0.78063634  0.46085096 0.9999998
## Huay1-3Q12           0.181654919 -0.43908873  0.80239857 0.9999975
## Huay2-3Q12           0.181654919 -0.43908873  0.80239857 0.9999975
## Huay3-3Q12           0.058098700 -0.56264495  0.67884235 1.0000000
## OlivoHMFCA-3Q12     -0.174189208 -0.79493286  0.44655444 0.9999990
## PecanBON-3Q12        0.378320260 -0.24242339  0.99906391 0.8441494
## VID1-3Q12           -0.027009054 -0.64775271  0.59373460 1.0000000
## VID3-3Q12           -0.176495216 -0.79723887  0.44424844 0.9999986
## VID4-3Q12           -0.581904840 -1.20264849  0.03883881 0.0984268
## 3Q4-3Q3             -0.116902566 -0.73764622  0.50384109 1.0000000
## 3Q5-3Q3              0.167568662 -0.45317499  0.78831232 0.9999996
## 3Q9-3Q3              0.105800429 -0.51494322  0.72654408 1.0000000
## ASI-3Q3              0.738664638  0.11792099  1.35940829 0.0044954
## Car-3Q3             -0.095552836 -0.71629649  0.52519082 1.0000000
## Car2-3Q3            -0.154186001 -0.77492965  0.46655765 0.9999999
## CO1-3Q3             -0.315521486 -0.93626514  0.30522217 0.9741249
## CO3-3Q3             -0.101386726 -0.72213038  0.51935693 1.0000000
## CO6-3Q3             -0.492298182 -1.11304183  0.12844547 0.3503660
## Control-3Q3         -1.056373212 -1.67711686 -0.43562956 0.0000014
## EM1-3Q3              0.679390651  0.05864700  1.30013430 0.0160032
## EM2-3Q3              0.223599712 -0.39714394  0.84434336 0.9998545
## EM4-3Q3             -0.194733228 -0.81547688  0.42601042 0.9999896
## HMV4-3Q3             0.097676288 -0.52306737  0.71841994 1.0000000
## Huay1-3Q3            0.439223896 -0.18151976  1.05996755 0.5891770
## Huay2-3Q3            0.439223896 -0.18151976  1.05996755 0.5891770
## Huay3-3Q3            0.315667677 -0.30507598  0.93641133 0.9739836
## OlivoHMFCA-3Q3       0.083379769 -0.53736388  0.70412342 1.0000000
## PecanBON-3Q3         0.635889237  0.01514558  1.25663289 0.0377272
## VID1-3Q3             0.230559923 -0.39018373  0.85130358 0.9997489
## VID3-3Q3             0.081073761 -0.53966989  0.70181741 1.0000000
## VID4-3Q3            -0.324335864 -0.94507952  0.29640779 0.9644911
## 3Q5-3Q4              0.284471228 -0.33627242  0.90521488 0.9931337
## 3Q9-3Q4              0.222702995 -0.39804066  0.84344665 0.9998647
## ASI-3Q4              0.855567204  0.23482355  1.47631086 0.0002814
## Car-3Q4              0.021349729 -0.59939392  0.64209338 1.0000000
## Car2-3Q4            -0.037283435 -0.65802709  0.58346022 1.0000000
## CO1-3Q4             -0.198618921 -0.81936257  0.42212473 0.9999845
## CO3-3Q4              0.015515839 -0.60522781  0.63625949 1.0000000
## CO6-3Q4             -0.375395616 -0.99613927  0.24534804 0.8536282
## Control-3Q4         -0.939470646 -1.56021430 -0.31872699 0.0000327
## EM1-3Q4              0.796293217  0.17554956  1.41703687 0.0011919
## EM2-3Q4              0.340502278 -0.28024138  0.96124593 0.9402373
## EM4-3Q4             -0.077830662 -0.69857432  0.54291299 1.0000000
## HMV4-3Q4             0.214578853 -0.40616480  0.83532251 0.9999316
## Huay1-3Q4            0.556126461 -0.06461719  1.17687011 0.1483488
## Huay2-3Q4            0.556126461 -0.06461719  1.17687011 0.1483488
## Huay3-3Q4            0.432570243 -0.18817341  1.05331390 0.6203777
## OlivoHMFCA-3Q4       0.200282335 -0.42046132  0.82102599 0.9999818
## PecanBON-3Q4         0.752791803  0.13204815  1.37353546 0.0032720
## VID1-3Q4             0.347462488 -0.27328116  0.96820614 0.9268519
## VID3-3Q4             0.197976327 -0.42276733  0.81871998 0.9999855
## VID4-3Q4            -0.207433298 -0.82817695  0.41331035 0.9999640
## 3Q9-3Q5             -0.061768233 -0.68251189  0.55897542 1.0000000
## ASI-3Q5              0.571095976 -0.04964768  1.19183963 0.1173752
## Car-3Q5             -0.263121499 -0.88386515  0.35762215 0.9977956
## Car2-3Q5            -0.321754663 -0.94249832  0.29898899 0.9675534
## CO1-3Q5             -0.483090149 -1.10383380  0.13765350 0.3886167
## CO3-3Q5             -0.268955389 -0.88969904  0.35178826 0.9969312
## CO6-3Q5             -0.659866844 -1.28061050 -0.03912319 0.0237172
## Control-3Q5         -1.223941874 -1.84468553 -0.60319822 0.0000000
## EM1-3Q5              0.511821989 -0.10892166  1.13256564 0.2763244
## EM2-3Q5              0.056031050 -0.56471260  0.67677470 1.0000000
## EM4-3Q5             -0.362301890 -0.98304554  0.25844176 0.8918915
## HMV4-3Q5            -0.069892375 -0.69063603  0.55085128 1.0000000
## Huay1-3Q5            0.271655233 -0.34908842  0.89239889 0.9964425
## Huay2-3Q5            0.271655233 -0.34908842  0.89239889 0.9964425
## Huay3-3Q5            0.148099015 -0.47264464  0.76884267 1.0000000
## OlivoHMFCA-3Q5      -0.084188893 -0.70493255  0.53655476 1.0000000
## PecanBON-3Q5         0.468320575 -0.15242308  1.08906423 0.4535999
## VID1-3Q5             0.062991260 -0.55775239  0.68373491 1.0000000
## VID3-3Q5            -0.086494901 -0.70723855  0.53424875 1.0000000
## VID4-3Q5            -0.491904526 -1.11264818  0.12883913 0.3519606
## ASI-3Q9              0.632864210  0.01212056  1.25360786 0.0399397
## Car-3Q9             -0.201353265 -0.82209692  0.41939039 0.9999797
## Car2-3Q9            -0.259986430 -0.88073008  0.36075722 0.9981671
## CO1-3Q9             -0.421321915 -1.04206557  0.19942174 0.6722142
## CO3-3Q9             -0.207187155 -0.82793081  0.41355650 0.9999648
## CO6-3Q9             -0.598098610 -1.21884226  0.02264504 0.0748241
## Control-3Q9         -1.162173640 -1.78291729 -0.54142999 0.0000001
## EM1-3Q9              0.573590222 -0.04715343  1.19433387 0.1127592
## EM2-3Q9              0.117799283 -0.50294437  0.73854294 1.0000000
## EM4-3Q9             -0.300533657 -0.92127731  0.32021000 0.9857522
## HMV4-3Q9            -0.008124141 -0.62886779  0.61261951 1.0000000
## Huay1-3Q9            0.333423467 -0.28732019  0.95416712 0.9519836
## Huay2-3Q9            0.333423467 -0.28732019  0.95416712 0.9519836
## Huay3-3Q9            0.209867248 -0.41087640  0.83061090 0.9999550
## OlivoHMFCA-3Q9      -0.022420660 -0.64316431  0.59832299 1.0000000
## PecanBON-3Q9         0.530088808 -0.09065484  1.15083246 0.2167164
## VID1-3Q9             0.124759494 -0.49598416  0.74550315 1.0000000
## VID3-3Q9            -0.024726668 -0.64547032  0.59601698 1.0000000
## VID4-3Q9            -0.430136292 -1.05087995  0.19060736 0.6317141
## Car-ASI             -0.834217475 -1.45496113 -0.21347382 0.0004772
## Car2-ASI            -0.892850639 -1.51359429 -0.27210699 0.0001096
## CO1-ASI             -1.054186125 -1.67492978 -0.43344247 0.0000015
## CO3-ASI             -0.840051365 -1.46079502 -0.21930771 0.0004134
## CO6-ASI             -1.230962820 -1.85170647 -0.61021917 0.0000000
## Control-ASI         -1.795037850 -2.41578150 -1.17429420 0.0000000
## EM1-ASI             -0.059273988 -0.68001764  0.56146967 1.0000000
## EM2-ASI             -0.515064926 -1.13580858  0.10567873 0.2650393
## EM4-ASI             -0.933397866 -1.55414152 -0.31265421 0.0000383
## HMV4-ASI            -0.640988351 -1.26173200 -0.02024470 0.0342436
## Huay1-ASI           -0.299440743 -0.92018440  0.32130291 0.9864006
## Huay2-ASI           -0.299440743 -0.92018440  0.32130291 0.9864006
## Huay3-ASI           -0.422996962 -1.04374061  0.19774669 0.6645980
## OlivoHMFCA-ASI      -0.655284869 -1.27602852 -0.03454122 0.0259602
## PecanBON-ASI        -0.102775402 -0.72351905  0.51796825 1.0000000
## VID1-ASI            -0.508104716 -1.12884837  0.11263894 0.2896259
## VID3-ASI            -0.657590877 -1.27833453 -0.03684722 0.0248084
## VID4-ASI            -1.063000502 -1.68374415 -0.44225685 0.0000012
## Car2-Car            -0.058633165 -0.67937682  0.56211049 1.0000000
## CO1-Car             -0.219968650 -0.84071230  0.40077500 0.9998919
## CO3-Car             -0.005833890 -0.62657754  0.61490976 1.0000000
## CO6-Car             -0.396745345 -1.01748900  0.22399831 0.7772010
## Control-Car         -0.960820375 -1.58156403 -0.34007672 0.0000186
## EM1-Car              0.774943487  0.15419983  1.39568714 0.0019678
## EM2-Car              0.319152548 -0.30159110  0.93989620 0.9704346
## EM4-Car             -0.099180391 -0.71992404  0.52156326 1.0000000
## HMV4-Car             0.193229124 -0.42751453  0.81397278 0.9999911
## Huay1-Car            0.534776732 -0.08596692  1.15552039 0.2029812
## Huay2-Car            0.534776732 -0.08596692  1.15552039 0.2029812
## Huay3-Car            0.411220513 -0.20952314  1.03196417 0.7170851
## OlivoHMFCA-Car       0.178932605 -0.44181105  0.79967626 0.9999982
## PecanBON-Car         0.731442073  0.11069842  1.35218573 0.0052769
## VID1-Car             0.326112759 -0.29463089  0.94685641 0.9622610
## VID3-Car             0.176626597 -0.44411706  0.79737025 0.9999986
## VID4-Car            -0.228783027 -0.84952668  0.39196063 0.9997809
## CO1-Car2            -0.161335485 -0.78207914  0.45940817 0.9999998
## CO3-Car2             0.052799275 -0.56794438  0.67354293 1.0000000
## CO6-Car2            -0.338112181 -0.95885583  0.28263147 0.9444087
## Control-Car2        -0.902187210 -1.52293086 -0.28144356 0.0000863
## EM1-Car2             0.833576652  0.21283300  1.45432030 0.0004847
## EM2-Car2             0.377785713 -0.24295794  0.99852937 0.8459066
## EM4-Car2            -0.040547227 -0.66129088  0.58019643 1.0000000
## HMV4-Car2            0.251862289 -0.36888136  0.87260594 0.9988896
## Huay1-Car2           0.593409897 -0.02733376  1.21415355 0.0811073
## Huay2-Car2           0.593409897 -0.02733376  1.21415355 0.0811073
## Huay3-Car2           0.469853678 -0.15088997  1.09059733 0.4466787
## OlivoHMFCA-Car2      0.237565770 -0.38317788  0.85830942 0.9995784
## PecanBON-Car2        0.790075238  0.16933159  1.41081889 0.0013808
## VID1-Car2            0.384745924 -0.23599773  1.00548958 0.8221771
## VID3-Car2            0.235259762 -0.38548389  0.85600341 0.9996433
## VID4-Car2           -0.170149863 -0.79089352  0.45059379 0.9999994
## CO3-CO1              0.214134760 -0.40660889  0.83487841 0.9999342
## CO6-CO1             -0.176776695 -0.79752035  0.44396696 0.9999986
## Control-CO1         -0.740851725 -1.36159538 -0.12010807 0.0042812
## EM1-CO1              0.994912137  0.37416848  1.61565579 0.0000075
## EM2-CO1              0.539121198 -0.08162245  1.15986485 0.1908199
## EM4-CO1              0.120788258 -0.49995539  0.74153191 1.0000000
## HMV4-CO1             0.413197774 -0.20754588  1.03394143 0.7084628
## Huay1-CO1            0.754745382  0.13400173  1.37548903 0.0031301
## Huay2-CO1            0.754745382  0.13400173  1.37548903 0.0031301
## Huay3-CO1            0.631189163  0.01044551  1.25193282 0.0412138
## OlivoHMFCA-CO1       0.398901255 -0.22184240  1.01964491 0.7686206
## PecanBON-CO1         0.951410723  0.33066707  1.57215438 0.0000239
## VID1-CO1             0.546081409 -0.07466224  1.16682506 0.1724611
## VID3-CO1             0.396595247 -0.22414841  1.01733890 0.7777931
## VID4-CO1            -0.008814377 -0.62955803  0.61192928 1.0000000
## CO6-CO3             -0.390911455 -1.01165511  0.22983220 0.7996790
## Control-CO3         -0.954986485 -1.57573014 -0.33424283 0.0000217
## EM1-CO3              0.780777377  0.16003372  1.40152103 0.0017177
## EM2-CO3              0.324986438 -0.29575721  0.94573009 0.9636864
## EM4-CO3             -0.093346502 -0.71409015  0.52739715 1.0000000
## HMV4-CO3             0.199063014 -0.42168064  0.81980667 0.9999838
## Huay1-CO3            0.540610622 -0.08013303  1.16135427 0.1867754
## Huay2-CO3            0.540610622 -0.08013303  1.16135427 0.1867754
## Huay3-CO3            0.417054403 -0.20368925  1.03779806 0.6914090
## OlivoHMFCA-CO3       0.184766495 -0.43597716  0.80551015 0.9999964
## PecanBON-CO3         0.737275963  0.11653231  1.35801962 0.0046366
## VID1-CO3             0.331946649 -0.28879700  0.95269030 0.9542070
## VID3-CO3             0.182460487 -0.43828317  0.80320414 0.9999972
## VID4-CO3            -0.222949137 -0.84369279  0.39779452 0.9998619
## Control-CO6         -0.564075030 -1.18481868  0.05666862 0.1311889
## EM1-CO6              1.171688832  0.55094518  1.79243249 0.0000001
## EM2-CO6              0.715897894  0.09515424  1.33664155 0.0074135
## EM4-CO6              0.297564954 -0.32317870  0.91830861 0.9874582
## HMV4-CO6             0.589974469 -0.03076918  1.21071812 0.0859884
## Huay1-CO6            0.931522077  0.31077842  1.55226573 0.0000403
## Huay2-CO6            0.931522077  0.31077842  1.55226573 0.0000403
## Huay3-CO6            0.807965858  0.18722221  1.42870951 0.0009022
## OlivoHMFCA-CO6       0.575677951 -0.04506570  1.19642160 0.1090098
## PecanBON-CO6         1.128187418  0.50744377  1.74893107 0.0000002
## VID1-CO6             0.722858104  0.10211445  1.34360176 0.0063722
## VID3-CO6             0.573371943 -0.04737171  1.19411560 0.1131572
## VID4-CO6             0.167962318 -0.45278133  0.78870597 0.9999995
## EM1-Control          1.735763862  1.11502021  2.35650752 0.0000000
## EM2-Control          1.279972924  0.65922927  1.90071658 0.0000000
## EM4-Control          0.861639984  0.24089633  1.48238364 0.0002417
## HMV4-Control         1.154049499  0.53330585  1.77479315 0.0000001
## Huay1-Control        1.495597107  0.87485345  2.11634076 0.0000000
## Huay2-Control        1.495597107  0.87485345  2.11634076 0.0000000
## Huay3-Control        1.372040888  0.75129724  1.99278454 0.0000000
## OlivoHMFCA-Control   1.139752980  0.51900933  1.76049663 0.0000001
## PecanBON-Control     1.692262448  1.07151880  2.31300610 0.0000000
## VID1-Control         1.286933134  0.66618948  1.90767679 0.0000000
## VID3-Control         1.137446972  0.51670332  1.75819063 0.0000001
## VID4-Control         0.732037348  0.11129370  1.35278100 0.0052080
## EM2-EM1             -0.455790939 -1.07653459  0.16495271 0.5112877
## EM4-EM1             -0.874123879 -1.49486753 -0.25338023 0.0001766
## HMV4-EM1            -0.581714363 -1.20245802  0.03902929 0.0987375
## Huay1-EM1           -0.240166755 -0.86091041  0.38057690 0.9994928
## Huay2-EM1           -0.240166755 -0.86091041  0.38057690 0.9994928
## Huay3-EM1           -0.363722974 -0.98446663  0.25702068 0.8880744
## OlivoHMFCA-EM1      -0.596010882 -1.21675453  0.02473277 0.0775689
## PecanBON-EM1        -0.043501414 -0.66424507  0.57724224 1.0000000
## VID1-EM1            -0.448830728 -1.06957438  0.17191292 0.5439236
## VID3-EM1            -0.598316890 -1.21906054  0.02242676 0.0745419
## VID4-EM1            -1.003726514 -1.62447017 -0.38298286 0.0000059
## EM4-EM2             -0.418332940 -1.03907659  0.20241071 0.6856918
## HMV4-EM2            -0.125923424 -0.74666708  0.49482023 1.0000000
## Huay1-EM2            0.215624184 -0.40511947  0.83636784 0.9999252
## Huay2-EM2            0.215624184 -0.40511947  0.83636784 0.9999252
## Huay3-EM2            0.092067965 -0.52867569  0.71281162 1.0000000
## OlivoHMFCA-EM2      -0.140219943 -0.76096360  0.48052371 1.0000000
## PecanBON-EM2         0.412289525 -0.20845413  1.03303318 0.7124341
## VID1-EM2             0.006960210 -0.61378344  0.62770386 1.0000000
## VID3-EM2            -0.142525951 -0.76326960  0.47821770 1.0000000
## VID4-EM2            -0.547935576 -1.16867923  0.07280808 0.1678010
## HMV4-EM4             0.292409516 -0.32833414  0.91315317 0.9900279
## Huay1-EM4            0.633957124  0.01321347  1.25470078 0.0391274
## Huay2-EM4            0.633957124  0.01321347  1.25470078 0.0391274
## Huay3-EM4            0.510400905 -0.11034275  1.13114456 0.2813637
## OlivoHMFCA-EM4       0.278112997 -0.34263066  0.89885665 0.9950011
## PecanBON-EM4         0.830622465  0.20987881  1.45136612 0.0005211
## VID1-EM4             0.425293150 -0.19545050  1.04603680 0.6540912
## VID3-EM4             0.275806989 -0.34493666  0.89655064 0.9955636
## VID4-EM4            -0.129602636 -0.75034629  0.49114102 1.0000000
## Huay1-HMV4           0.341547608 -0.27919604  0.96229126 0.9383456
## Huay2-HMV4           0.341547608 -0.27919604  0.96229126 0.9383456
## Huay3-HMV4           0.217991389 -0.40275226  0.83873504 0.9999084
## OlivoHMFCA-HMV4     -0.014296519 -0.63504017  0.60644713 1.0000000
## PecanBON-HMV4        0.538212949 -0.08253070  1.15895660 0.1933174
## VID1-HMV4            0.132883635 -0.48786002  0.75362729 1.0000000
## VID3-HMV4           -0.016602527 -0.63734618  0.60414113 1.0000000
## VID4-HMV4           -0.422012151 -1.04275580  0.19873150 0.6690810
## Huay2-Huay1          0.000000000 -0.62074365  0.62074365 1.0000000
## Huay3-Huay1         -0.123556219 -0.74429987  0.49718743 1.0000000
## OlivoHMFCA-Huay1    -0.355844127 -0.97658778  0.26489953 0.9082002
## PecanBON-Huay1       0.196665341 -0.42407831  0.81740899 0.9999873
## VID1-Huay1          -0.208663973 -0.82940763  0.41207968 0.9999597
## VID3-Huay1          -0.358150135 -0.97889379  0.26259352 0.9025715
## VID4-Huay1          -0.763559759 -1.38430341 -0.14281611 0.0025594
## Huay3-Huay2         -0.123556219 -0.74429987  0.49718743 1.0000000
## OlivoHMFCA-Huay2    -0.355844127 -0.97658778  0.26489953 0.9082002
## PecanBON-Huay2       0.196665341 -0.42407831  0.81740899 0.9999873
## VID1-Huay2          -0.208663973 -0.82940763  0.41207968 0.9999597
## VID3-Huay2          -0.358150135 -0.97889379  0.26259352 0.9025715
## VID4-Huay2          -0.763559759 -1.38430341 -0.14281611 0.0025594
## OlivoHMFCA-Huay3    -0.232287908 -0.85303156  0.38845574 0.9997138
## PecanBON-Huay3       0.320221560 -0.30052209  0.94096521 0.9692754
## VID1-Huay3          -0.085107754 -0.70585141  0.53563590 1.0000000
## VID3-Huay3          -0.234593916 -0.85533757  0.38614974 0.9996603
## VID4-Huay3          -0.640003540 -1.26074719 -0.01925989 0.0348931
## PecanBON-OlivoHMFCA  0.552509468 -0.06823418  1.17325312 0.1567127
## VID1-OlivoHMFCA      0.147180154 -0.47356350  0.76792381 1.0000000
## VID3-OlivoHMFCA     -0.002306008 -0.62304966  0.61843764 1.0000000
## VID4-OlivoHMFCA     -0.407715633 -1.02845929  0.21302802 0.7321481
## VID1-PecanBON       -0.405329314 -1.02607297  0.21541434 0.7422305
## VID3-PecanBON       -0.554815476 -1.17555913  0.06592818 0.1513395
## VID4-PecanBON       -0.960225100 -1.58096875 -0.33948145 0.0000189
## VID3-VID1           -0.149486162 -0.77022981  0.47125749 1.0000000
## VID4-VID1           -0.554895786 -1.17563944  0.06584787 0.1511550
## VID4-VID3           -0.405409624 -1.02615328  0.21533403 0.7418936

Generar letras para graficar

library(multcompView)

pvals <- tukey_res$Tratamientos[, "p adj"]
letters <- multcompLetters(pvals)
letters$Letters  # Letras tipo a, b, c para cada tratamiento
##        114        3Q1       3Q10       3Q11       3Q12        3Q3        3Q4 
##    "abcde"    "abcde"     "acdf"      "adf"    "abcde"     "acdf"     "acdf" 
##        3Q5        3Q9        ASI        Car       Car2        CO1        CO3 
##    "abcde"    "abcdf"        "e"     "acdf"     "acdf"       "af"     "acdf" 
##        CO6    Control        EM1        EM2        EM4       HMV4      Huay1 
##       "fg"        "g"       "be"    "abcde"      "adf"    "abcdf"      "bce" 
##      Huay2      Huay3 OlivoHMFCA   PecanBON       VID1       VID3       VID4 
##      "bce"     "bcde"    "abcdf"       "be"    "abcde"    "abcdf"       "af" 
##        112 
##     "acdf"
install.packages("ggrepel")  # instala el paquete
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.5'
## (as 'lib' is unspecified)

Grafico

library(ggplot2)
library(dplyr)
library(ggrepel)

# =========================
# 1. Resumen de medias y SE en escala original
# =========================
resumen <- datos %>%
  group_by(Tratamientos) %>%
  summarise(
    mean_orig = mean(diam_tran_les, na.rm = TRUE),
    se_orig   = sd(diam_tran_les, na.rm = TRUE)/sqrt(n())
  )

# Definir altura máxima para el gráfico (para espacio a las letras)
y_max <- max(resumen$mean_orig + resumen$se_orig) * 1.1

# =========================
# 2. Agregar letras de significancia del Tukey (basado en variable transformada)
# =========================
# Asegúrate de que 'letters$Letters' exista y tenga los nombres de Tratamientos
resumen$letters <- letters$Letters[match(resumen$Tratamientos, names(letters$Letters))]

# =========================
# 3. Gráfico con barras más anchas, letras verticales y variable original
# =========================

library(ggplot2)

# Guardar el gráfico en un objeto
grafico <- ggplot(resumen, aes(x = reorder(Tratamientos, -mean_orig), y = mean_orig)) +
  geom_col(fill = "orange", width = 0.8) +
   geom_errorbar(aes(ymin = mean_orig, ymax = mean_orig + se_orig),
                width = 0.2, size = 1) +
    geom_text(aes(y = mean_orig + se_orig + 0.1, label = letters),
            angle = 90, vjust = 0.5, hjust = 0, size = 5) +
  labs(
    x = "Aislados fúnguicos",
    y = "Diámetro transversal (cm)"
  ) +
  coord_cartesian(ylim = c(0, y_max)) +
  scale_x_discrete(expand = expansion(add = c(0.9, 0.5))) +
  scale_y_continuous(expand = expansion(mult = c(0, 0.05))) +
  theme_minimal(base_size = 16) +
  theme(
    axis.line = element_line(color = "black", size = 1),
    axis.ticks = element_line(color = "black", size = 1),
    axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1, size = 12, color = "black"),
    axis.text.y = element_text(size = 12, color = "black"),
    axis.title.x = element_text(size = 14, color = "black"),
    axis.title.y = element_text(size = 12, color = "black"),
    panel.grid.major = element_line(color = "gray90"),
    panel.grid.minor = element_blank(),
    plot.margin = margin(20, 30, 10, 10)
  )
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## 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.
grafico

# Exportar como PNG
ggsave("grafico_diametro_tranversal_naranja.png", plot = grafico, width = 10, height = 6, dpi = 300)

# Exportar como PDF
ggsave("grafico_diametro_tranversal_naranja.pdf", plot = grafico, width = 10, height = 6)

Interpretación de la Virulencia de los Aislados

El análisis gráfico de los diámetros transversales de lesión permite evaluar la virulencia de los distintos aislados fúngicos sobre la madera de pecana.

Aislados más virulentos Los tratamientos ASI, EM1 y PecanBON presentan los mayores diámetros de lesión (≈3 cm) y se ubican en el extremo izquierdo del gráfico. Las letras de significancia (‘e’ o ‘be’) indican que estas diferencias son estadísticamente significativas respecto a los aislados menos virulentos. Estos resultados muestran que dichos aislados son los más agresivos en este ensayo.

Aislados menos virulentos Los tratamientos CO6, VID4, CO1, 3Q11, EM4 y el Control presentan los menores diámetros de lesión (0.5–1cm), ubicándose hacia el extremo derecho del gráfico. El Control, correspondiente a discos inoculados sin hongo, representa el daño basal de la herida. El aislado CO6 que comparten letras de significancia con el Control (fg), no difieren estadísticamente del daño basal, lo que los clasifica como los menos agresivos.

Aislados de virulencia intermedia El grupo central, con diámetros de 1.5–2.5 cm, comparte múltiples letras de significancia (‘abcde’, ‘abcdf’). Estos aislados presentan una virulencia mayor que el Control, pero estadísticamente inferior a los aislados más agresivos.

Consideraciones del diseño experimental

El ensayo se realizó con un diseño completamente aleatorizado, lo que asegura que las diferencias observadas se deben a los tratamientos (aislados) y no a factores externos.

El Control establece la línea base del daño por inoculación mecánica, permitiendo identificar qué aislados son realmente patogénicos o virulentos.

Grafico solicitado por Franca

library(ggplot2)
library(dplyr)
library(ggrepel)

# =========================
# 1. Resumen de medias y SE en escala original
# =========================
resumen <- datos %>%
  group_by(Tratamientos) %>%
  summarise(
    mean_orig = mean(diam_tran_les, na.rm = TRUE),
    se_orig   = sd(diam_tran_les, na.rm = TRUE)/sqrt(n())
  )

# Definir altura máxima para el gráfico (para espacio a las letras)
y_max <- max(resumen$mean_orig + resumen$se_orig) * 1.1

# =========================
# 2. Agregar letras de significancia del Tukey (basado en variable transformada)
# =========================
# Asegúrate de que 'letters$Letters' exista y tenga los nombres de Tratamientos
resumen$letters <- letters$Letters[match(resumen$Tratamientos, names(letters$Letters))]

# =========================
# 3. Gráfico con barras más anchas, letras verticales y variable original
# =========================



library(ggplot2)

# Guardar el gráfico en un objeto
grafico <- ggplot(resumen, aes(x = reorder(Tratamientos, -mean_orig), y = mean_orig)) +
  geom_col(fill = "darkgray", width = 0.8) +
  
  # ❗ SOLO BRAZO SUPERIOR DEL ERROR
  geom_errorbar(aes(ymin = mean_orig, ymax = mean_orig + se_orig),
                width = 0.2, size = 1) +
  
  geom_text(aes(y = mean_orig + se_orig + 0.1, label = letters),
            angle = 90, vjust = 0.5, hjust = 0, size = 5) +
  
  labs(
    x = "Aislados fúngicos",
    y = "Diámetro transversal (cm)"
  ) +
  coord_cartesian(ylim = c(0, y_max)) +
  scale_x_discrete(expand = expansion(add = c(0.9, 0.5))) +
  scale_y_continuous(expand = expansion(mult = c(0, 0.05))) +
  theme_minimal(base_size = 16) +
  theme(
    axis.line = element_line(color = "black", size = 1),
    axis.ticks = element_line(color = "black", size = 1),
    axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1, size = 12, color = "black"),
    axis.text.y = element_text(size = 12, color = "black"),
    axis.title.x = element_text(size = 14, color = "black"),
    axis.title.y = element_text(size = 12, color = "black"),
    panel.grid.major = element_blank(),
    panel.grid.minor = element_blank(),
    
    plot.margin = margin(20, 30, 10, 10)
  )

grafico

# Exportar como PNG
ggsave("grafico_diam_transversal_gris.png", plot = grafico, width = 10, height = 6, dpi = 300)

# Exportar como PDF
ggsave("grafico__diam_transversal_gris.pdf", plot = grafico, width = 10, height = 6)