MODELOS DE EFECTOS MIXTOS

\[\text{Modelo de efectos Mixtos}\]

\[Y_{ijk}= \mu +\alpha_i+ \beta_j+(\alpha\beta)_{ij}+ \epsilon_{ijk} \\ Y_{ijk} =\text{Rendimiento}\\\mu= \text{Media del rendimiento}\\ \alpha_i =\text{Efecto del Genotipo}\\ \beta_j=\text{Efecto aleatorio del ambiente}\\ (\alpha\beta)_{ij} = \text{Efecto de la interacción}\\ \epsilon_{ijk}= \text{Error} \]

set.seed(1002540919)
library(nlme)
data("Machines")
Datos=Machines
colnames(Datos)<-c("Ambiente","Genotipo","Rendimiento")
Datos
## Grouped Data: score ~ Machine | Worker
##    Ambiente Genotipo Rendimiento
## 1         1        A        52.0
## 2         1        A        52.8
## 3         1        A        53.1
## 4         2        A        51.8
## 5         2        A        52.8
## 6         2        A        53.1
## 7         3        A        60.0
## 8         3        A        60.2
## 9         3        A        58.4
## 10        4        A        51.1
## 11        4        A        52.3
## 12        4        A        50.3
## 13        5        A        50.9
## 14        5        A        51.8
## 15        5        A        51.4
## 16        6        A        46.4
## 17        6        A        44.8
## 18        6        A        49.2
## 19        1        B        62.1
## 20        1        B        62.6
## 21        1        B        64.0
## 22        2        B        59.7
## 23        2        B        60.0
## 24        2        B        59.0
## 25        3        B        68.6
## 26        3        B        65.8
## 27        3        B        69.7
## 28        4        B        63.2
## 29        4        B        62.8
## 30        4        B        62.2
## 31        5        B        64.8
## 32        5        B        65.0
## 33        5        B        65.4
## 34        6        B        43.7
## 35        6        B        44.2
## 36        6        B        43.0
## 37        1        C        67.5
## 38        1        C        67.2
## 39        1        C        66.9
## 40        2        C        61.5
## 41        2        C        61.7
## 42        2        C        62.3
## 43        3        C        70.8
## 44        3        C        70.6
## 45        3        C        71.0
## 46        4        C        64.1
## 47        4        C        66.2
## 48        4        C        64.0
## 49        5        C        72.1
## 50        5        C        72.0
## 51        5        C        71.1
## 52        6        C        62.0
## 53        6        C        61.4
## 54        6        C        60.5
class(Datos) <-"data.frame"
Datos[,"Ambiente"]<- factor(Datos[,"Ambiente"],level=1:6,
                              ordered=FALSE)
str(Datos, give.attr = FALSE) 
## 'data.frame':    54 obs. of  3 variables:
##  $ Ambiente   : Factor w/ 6 levels "1","2","3","4",..: 1 1 1 2 2 2 3 3 3 4 ...
##  $ Genotipo   : Factor w/ 3 levels "A","B","C": 1 1 1 1 1 1 1 1 1 1 ...
##  $ Rendimiento: num  52 52.8 53.1 51.8 52.8 53.1 60 60.2 58.4 51.1 ...

\[H_0= \text{No hay interaccion entre el Genotipo y el Ambiente} \\ H_1=\text{Hay interacción entre el Genotipo y el Ambiente} \]

library(ggplot2)
ggplot(Datos, aes(x = Genotipo, y = Rendimiento, group = Ambiente, 
                  col = Ambiente)) + 
  geom_point() + stat_summary(fun = mean, geom = "line") + theme_bw()

with(Datos, interaction.plot(x.factor = Genotipo, 
                                trace.factor = Ambiente, 
                                response = Rendimiento, ylab="Rendimiento",
                             xlab="Genotipo", col=c("blue","green","red",
                                                    "purple","pink","orange"), 
                             lwd=1,lty =1,  trace.label = "Ambiente"))

library(collapsibleTree)
collapsibleTree(Datos,hierarchy = c("Ambiente","Genotipo","Rendimiento"))
mod_1=aov(Rendimiento~Ambiente+Genotipo,data=Datos)
summary(mod_1)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## Ambiente     5 1241.9   248.4   24.85 4.87e-12 ***
## Genotipo     2 1755.3   877.6   87.80  < 2e-16 ***
## Residuals   46  459.8    10.0                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
tb = summary(mod_1)
ifelse(unlist(tb)[9] > 0.05, 'Rechazo Ho',
       'No rechazo Ho')
##     Mean Sq3 
## "Rechazo Ho"

Rechazo la hipotesis nula, por lo cual decimos que si hay interacción entre el genotipo y ambiente.

library(lme4)
## Loading required package: Matrix
## 
## Attaching package: 'lme4'
## The following object is masked from 'package:nlme':
## 
##     lmList
fit.Datos <- lmer(Rendimiento ~ Genotipo + (1 | Ambiente) + 
                       (1 | Ambiente:Genotipo), data = Datos)
summary(fit.Datos)
## Linear mixed model fit by REML ['lmerMod']
## Formula: Rendimiento ~ Genotipo + (1 | Ambiente) + (1 | Ambiente:Genotipo)
##    Data: Datos
## 
## REML criterion at convergence: 215.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.26959 -0.54847 -0.01071  0.43937  2.54006 
## 
## Random effects:
##  Groups            Name        Variance Std.Dev.
##  Ambiente:Genotipo (Intercept) 13.9095  3.7295  
##  Ambiente          (Intercept) 22.8584  4.7811  
##  Residual                       0.9246  0.9616  
## Number of obs: 54, groups:  Ambiente:Genotipo, 18; Ambiente, 6
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   52.356      2.486  21.062
## GenotipoB      7.967      2.177   3.660
## GenotipoC     13.917      2.177   6.393
## 
## Correlation of Fixed Effects:
##           (Intr) GentpB
## GenotipoB -0.438       
## GenotipoC -0.438  0.500
fit.Datos1 <- lmer(Rendimiento ~ Ambiente + (1 | Genotipo) + 
                    (1 | Genotipo:Ambiente), data = Datos)
summary(fit.Datos1)
## Linear mixed model fit by REML ['lmerMod']
## Formula: Rendimiento ~ Ambiente + (1 | Genotipo) + (1 | Genotipo:Ambiente)
##    Data: Datos
## 
## REML criterion at convergence: 197.7
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.29391 -0.55060 -0.01558  0.43931  2.56719 
## 
## Random effects:
##  Groups            Name        Variance Std.Dev.
##  Genotipo:Ambiente (Intercept) 13.9095  3.7295  
##  Genotipo          (Intercept) 46.3881  6.8109  
##  Residual                       0.9246  0.9616  
## Number of obs: 54, groups:  Genotipo:Ambiente, 18; Genotipo, 3
## 
## Fixed effects:
##             Estimate Std. Error t value
## (Intercept)   60.911      4.495  13.552
## Ambiente2     -2.922      3.079  -0.949
## Ambiente3      5.211      3.079   1.693
## Ambiente4     -1.333      3.079  -0.433
## Ambiente5      1.811      3.079   0.588
## Ambiente6    -10.333      3.079  -3.356
## 
## Correlation of Fixed Effects:
##           (Intr) Ambnt2 Ambnt3 Ambnt4 Ambnt5
## Ambiente2 -0.342                            
## Ambiente3 -0.342  0.500                     
## Ambiente4 -0.342  0.500  0.500              
## Ambiente5 -0.342  0.500  0.500  0.500       
## Ambiente6 -0.342  0.500  0.500  0.500  0.500
V_G= 46.3881
V_A= 22.8584

#Variación Total
46.3881 + 22.8584
## [1] 69.2465
#Variación Genotipo 
  (46.3881 / 69.2465)*100
## [1] 66.98981
#Variación Ambiente
  (22.8584 / 69.2465)*100
## [1] 33.01019
#Variación Genotipo-Ambiente
 (13.9095/69.2465)*100
## [1] 20.08694

Aproximadamente el 67% de la varianza total pertenece al Genotipo, y aproximadamente el 33% de la varianza total pertenece al Ambiente; La varianza correspondiente al Genotipo-Ambiente es aproximadamente del 20%

\[\text{Heredabilidad}\] La heredabilidad es la proporción de variación de un rasgo que podemos atribuir a la variación genotípica interindividual. Si un carácter tiene una heredabilidad alta, significa que su variación en la población está mayormente influida por la genética de cada individuo, mientras que si tiene un valor bajo, el ambiente de cada individuo y las interacciones genotipo-ambiente tendrán un papel fundamental en la variación de dicha característica.

La heredabilidad es un estadístico, que oscila entre el 1 (rasgo afectado solo por la genética) y el 0 (rasgo afectado solo por el ambiente) y se puede representar con diferentes fórmulas, dependiendo de si hablamos de heredabilidad en sentido amplio o estricto.(Gonzalez, 2020)

Para seguir con el ejercicio dado anteriormente, se utilizara la heredabilidad en sentido amplio, en donde se utiliza la formula

\[H_2 = V_G / V_P \\H_2 = \text{Heredabilidad en sentido amplio} \\ V_G= \text{Variación de los genotipos(Genotipo A-B-C)} \\V_P= \text{Variación del Fenotipo (Fenotipo = Genotipo + Ambiente + Relacion Genotipo-Amniente)} \]

V_G = 46.3881
V_P= 22.8584+46.3881+13.9095 

H_2= V_G/V_P
     ceiling(46.3881/83.156)
## [1] 1

Como el calculo nos arrojo aproximadamente 1, podemos decir que los rasgo heredados solo van a ser datos por el genotipo.

\[\text{Bibliografia}\] GONZÁLEZ ,R. (2020, September 9). Heredabilidad: Conceptos básicos - El Blog de Genotipia. Genotipia. https://genotipia.com/heredabilidad/