df<-as.data.frame(read.xlsx("C:/Users/Victor/Documents/ACTIVIDAD DE TITULACION/PARCELAS DIVIDIDAS/dpd.xlsx", sheet=1))
En un ensayo de trigo se dispusieron dos parcelas principales en tres bloques. Sobre las parcelas principales se aleatorizaron los niveles del factor riego y éstas fueron divididas en cuatro subparcelas donde se aleatorizaron 4 variedades de trigo. La variable en estudio fue el rendimiento medido en kg/parcela experimental. Los datos se recogen en la siguiente tabla:
flextable(df)
Bloque | Parc | Variedad | Rendimiento |
---|---|---|---|
1 | Riego | BUCK-Charrua | 409.3 |
2 | Riego | BUCK-Charrua | 311.7 |
3 | Riego | BUCK-Charrua | 516.4 |
1 | Secano | BUCK-Charrua | 266.3 |
2 | Secano | BUCK-Charrua | 252.8 |
3 | Secano | BUCK-Charrua | 299.9 |
1 | Riego | LasRosas-INTA | 544.9 |
2 | Riego | LasRosas-INTA | 445.4 |
3 | Riego | LasRosas-INTA | 585.7 |
1 | Secano | LasRosas-INTA | 259.3 |
2 | Secano | LasRosas-INTA | 358.4 |
3 | Secano | LasRosas-INTA | 350.2 |
1 | Riego | Pigue | 519.9 |
2 | Riego | Pigue | 477.0 |
3 | Riego | Pigue | 624.5 |
1 | Secano | Pigue | 340.7 |
2 | Secano | Pigue | 296.6 |
3 | Secano | Pigue | 327.2 |
1 | Riego | Pro-INTA Puntal | 629.5 |
2 | Riego | Pro-INTA Puntal | 639.0 |
3 | Riego | Pro-INTA Puntal | 585.7 |
1 | Secano | Pro-INTA Puntal | 236.6 |
2 | Secano | Pro-INTA Puntal | 335.7 |
3 | Secano | Pro-INTA Puntal | 390.5 |
Ho : El efecto del riego es el mismo o no hay efecto del riego
H1 : Al menos un nivel de riego produce un efecto distinto al de los
demás
Ho : El efecto de las variedades de trigo es el mismo o no hay efecto
de las variedades
H1 : Al menos una variedad de trigo produce un efecto distinto a la de
las demás
Ho : El efecto de los bloques es el mismo o no hay efecto de los
bloques
H1 : Al menos un bloque produce un efecto distinto al de los demás
\[Y_{ijk}=\mu+ \alpha_{i} + \beta_{j}+(\alpha\beta)_{ij}+\gamma_{k}+(\alpha\gamma)_{ik}+\epsilon_{ijk}\] donde:
\(Y_{ijk}\) = Rendimiento obtenido
en el j-ésimo bloque de la i-ésima variedad
\(\mu\) = Efecto medio general
\(\alpha_i\) = Efecto atribuido a la
i_ésimo nivel de riego
\(\beta_j\) = Efecto atribuido al
j-ésimo bloque
\((\alpha\beta)_{ij}\) = Error en la
Parcela Grande \(\gamma_{k}\) = Efecto
de la k-ésima variedad de trigo \((\alpha\gamma)_{ik}\) = Efecto del
interacción del i-ésimo nivel de riego con la k-ésima variedad de trigo
\(\epsilon_{ijk}\) = Error en la
Parcela Chica
head(df)
str(df)
'data.frame': 24 obs. of 4 variables:
$ Bloque : num 1 2 3 1 2 3 1 2 3 1 ...
$ Parc : chr "Riego" "Riego" "Riego" "Secano" ...
$ Variedad : chr "BUCK-Charrua" "BUCK-Charrua" "BUCK-Charrua" "BUCK-Charrua" ...
$ Rendimiento: num 409 312 516 266 253 ...
BLOQUE <- factor(df$Bloque)
PG <- factor(df$Parc)
PCH <- factor(df$Variedad)
VR <- as.numeric(df$Rendimiento)
modelo1<-sp.plot(BLOQUE, PG, PCH, VR)
ANALYSIS SPLIT PLOT: VR
Class level information
PG : Riego Secano
PCH : BUCK-Charrua LasRosas-INTA Pigue Pro-INTA Puntal
BLOQUE : 1 2 3
Number of observations: 24
Analysis of Variance Table
Response: VR
Df Sum Sq Mean Sq F value Pr(>F)
BLOQUE 2 22913 11456 4.2942 0.039206 *
PG 1 276233 276233 55.2384 0.017626 *
Ea 2 10001 5001
PCH 3 51096 17032 6.3840 0.007837 **
PG:PCH 3 18926 6309 2.3647 0.122328
Eb 12 32015 2668
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cv(a) = 17 %, cv(b) = 12.4 %, Mean = 416.8
modelo2 <- aov(VR ~ BLOQUE + PG*PCH + BLOQUE/PG + BLOQUE*PCH)
summary(modelo2)
Df Sum Sq Mean Sq F value Pr(>F)
BLOQUE 2 22913 11456 3.229 0.111706
PG 1 276233 276233 77.860 0.000118 ***
PCH 3 51096 17032 4.801 0.049090 *
PG:PCH 3 18926 6309 1.778 0.251100
BLOQUE:PG 2 10001 5001 1.410 0.314912
BLOQUE:PCH 6 10728 1788 0.504 0.787516
Residuals 6 21287 3548
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Comentario: Como la interacción BLOQUExVARIEDAD (BLOQUE*PCH) no fue significativa (p=0,7875), la estructura de parcelas no interactúa con la estructura de tratamientos, se realizará un nuevo análisis sin ese término en el modelo.
modelo3 <- aov(VR ~ BLOQUE + PG*PCH + BLOQUE/PG)
summary(modelo3)
Df Sum Sq Mean Sq F value Pr(>F)
BLOQUE 2 22913 11456 4.294 0.03921 *
PG 1 276233 276233 103.540 0.000000297 ***
PCH 3 51096 17032 6.384 0.00784 **
PG:PCH 3 18926 6309 2.365 0.12233
BLOQUE:PG 2 10001 5001 1.874 0.19570
Residuals 12 32015 2668
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Comentarios: Los resultados sugieren que no hay interacción Parc*Variedad (p=0,1223), por lo que los resultados de los efectos principales pueden interpretarse directamente: existe efecto del riego (p<0,0001) y de la variedad (p=0,001).
shapiro.test(modelo3$res)
Shapiro-Wilk normality test
data: modelo3$res
W = 0.98747, p-value = 0.9865
bartlett.test(modelo3$res, PG)
Bartlett test of homogeneity of variances
data: modelo3$res and PG
Bartlett's K-squared = 0.81582, df = 1, p-value = 0.3664
bartlett.test(modelo3$res, PCH)
Bartlett test of homogeneity of variances
data: modelo3$res and PCH
Bartlett's K-squared = 3.9749, df = 3, p-value = 0.2642
bartlett.test(modelo3$res, PG:PCH)
Bartlett test of homogeneity of variances
data: modelo3$res and PG:PCH
Bartlett's K-squared = 4.8439, df = 7, p-value = 0.679
Tukey_PG<-HSD.test(VR, PG, DFerror=2, MSerror=5001); Tukey_PG
$statistics
MSerror Df Mean CV MSD
5001 2 416.8 16.96683 124.1125
$parameters
test name.t ntr StudentizedRange alpha
Tukey PG 2 6.079637 0.05
$means
VR std r se Min Max Q25 Q50 Q75
Riego 524.0833 99.63338 12 20.41446 311.7 639.0 469.10 532.40 595.400
Secano 309.5167 48.38859 12 20.41446 236.6 390.5 264.55 313.55 343.075
$comparison
NULL
$groups
VR groups
Riego 524.0833 a
Secano 309.5167 b
attr(,"class")
[1] "group"
Tukey_PCH<-HSD.test(VR, PCH, DFerror = 12, MSerror = 2668); Tukey_PCH
$statistics
MSerror Df Mean CV MSD
2668 12 416.8 12.39268 88.53766
$parameters
test name.t ntr StudentizedRange alpha
Tukey PCH 4 4.19866 0.05
$means
VR std r se Min Max Q25 Q50 Q75
BUCK-Charrua 342.7333 101.3105 6 21.08712 252.8 516.4 274.700 305.80 384.900
LasRosas-INTA 423.9833 124.9780 6 21.08712 259.3 585.7 352.250 401.90 520.025
Pigue 430.9833 129.9641 6 21.08712 296.6 624.5 330.575 408.85 509.175
Pro-INTA Puntal 469.5000 171.0079 6 21.08712 236.6 639.0 349.400 488.10 618.550
$comparison
NULL
$groups
VR groups
Pro-INTA Puntal 469.5000 a
Pigue 430.9833 ab
LasRosas-INTA 423.9833 ab
BUCK-Charrua 342.7333 b
attr(,"class")
[1] "group"
op<-par(mfrow = c(1,2), cex=1.0, cex.lab=2.0)
plot(Tukey_PG, xlab = "Riego",variation = "IQR")
plot(Tukey_PCH, xlab = "Variedades",variation = "IQR")
rm(list = ls())
df<-as.data.frame(read.xlsx("C:/Users/Victor/Documents/ACTIVIDAD DE TITULACION/PARCELAS DIVIDIDAS/dpd.xlsx", sheet=2))
En un ensayo de resistencia de cartón se realizaron preparados de pasta básica con tres distintas cantidades de agua (50, 75 y 100 litros). Cada uno de los preparados (parcelas grandes) se repitió tres veces en orden aleatorio a lo largo del tiempo. Luego, se dividieron los preparados en cuatro fracciones iguales (parcelas chicas) y se los sometió a distintas temperaturas de cocción (20, 25, 30 y 35 grados), las que fueron asignadas al azar. La variable en estudio fue la resistencia del cartón obtenido. Los datos se recogen en la siguiente tabla:
flextable(df)
Agua | Rep | Temperatura | resistencia |
---|---|---|---|
50 | 1 | 15 | 55.78 |
50 | 2 | 15 | 59.51 |
50 | 3 | 15 | 61.64 |
75 | 1 | 20 | 59.56 |
75 | 2 | 20 | 64.89 |
75 | 3 | 20 | 58.64 |
100 | 1 | 25 | 67.53 |
100 | 2 | 25 | 72.77 |
100 | 3 | 25 | 66.93 |
50 | 1 | 30 | 57.00 |
50 | 2 | 30 | 60.16 |
50 | 3 | 30 | 63.87 |
75 | 1 | 15 | 65.26 |
75 | 2 | 15 | 58.19 |
75 | 3 | 15 | 59.96 |
100 | 1 | 20 | 64.71 |
100 | 2 | 20 | 62.81 |
100 | 3 | 20 | 62.03 |
50 | 1 | 25 | 53.69 |
50 | 2 | 25 | 61.87 |
50 | 3 | 25 | 54.50 |
75 | 1 | 30 | 70.96 |
75 | 2 | 30 | 62.85 |
75 | 3 | 30 | 64.11 |
100 | 1 | 15 | 64.40 |
100 | 2 | 15 | 60.51 |
100 | 3 | 15 | 62.41 |
50 | 1 | 20 | 56.30 |
50 | 2 | 20 | 56.79 |
50 | 3 | 20 | 51.96 |
75 | 1 | 25 | 63.37 |
75 | 2 | 25 | 62.55 |
75 | 3 | 25 | 61.81 |
100 | 1 | 30 | 72.59 |
100 | 2 | 30 | 73.79 |
100 | 3 | 30 | 74.55 |
Ho : El efecto de las cantidades de agua es el mismo o no hay efecto
de la cantidad de agua
H1 : Al menos un nivel de agua produce un efecto distinto al de los
demás
Ho : El efecto de las temperaturas de cocción es el mismo o no hay
efecto de las temperaturas
H1 : Al menos un nivel de temperatura produce un efecto distinto al de
los demás
head(df)
str(df)
'data.frame': 36 obs. of 4 variables:
$ Agua : num 50 50 50 75 75 75 100 100 100 50 ...
$ Rep : num 1 2 3 1 2 3 1 2 3 1 ...
$ Temperatura: num 15 15 15 20 20 20 25 25 25 30 ...
$ resistencia: num 55.8 59.5 61.6 59.6 64.9 ...
REP <- as.factor(df$Rep)
PG <- as.factor(df$Agua)
PCH <- as.factor(df$Temperatura)
VR <- as.numeric(df$resistencia)
modelo1<-sp.plot(REP, PG, PCH, VR)
ANALYSIS SPLIT PLOT: VR
Class level information
PG : 50 75 100
PCH : 15 20 25 30
REP : 1 2 3
Number of observations: 36
Analysis of Variance Table
Response: VR
Df Sum Sq Mean Sq F value Pr(>F)
REP 2 8.64 4.319 0.4932 0.6186760
PG 2 522.83 261.414 19.7864 0.0084273 **
Ea 4 52.85 13.212
PCH 3 248.82 82.939 9.4705 0.0005643 ***
PG:PCH 6 100.89 16.816 1.9201 0.1324139
Eb 18 157.64 8.758
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cv(a) = 5.8 %, cv(b) = 4.7 %, Mean = 62.50694
mod.DCA <- aov(VR ~ PG + Error(REP/PG) + PCH + PG:PCH)
summary(mod.DCA)
Error: REP
Df Sum Sq Mean Sq F value Pr(>F)
Residuals 2 8.639 4.319
Error: REP:PG
Df Sum Sq Mean Sq F value Pr(>F)
PG 2 522.8 261.41 19.79 0.00843 **
Residuals 4 52.8 13.21
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Error: Within
Df Sum Sq Mean Sq F value Pr(>F)
PCH 3 248.8 82.94 9.47 0.000564 ***
PG:PCH 6 100.9 16.82 1.92 0.132414
Residuals 18 157.6 8.76
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
resp1 <- aov(VR ~ PG*PCH + REP/PG)
summary(resp1)
Df Sum Sq Mean Sq F value Pr(>F)
PG 2 522.8 261.41 29.850 0.00000192 ***
PCH 3 248.8 82.94 9.470 0.000564 ***
REP 2 8.6 4.32 0.493 0.618676
PG:PCH 6 100.9 16.82 1.920 0.132414
PG:REP 4 52.8 13.21 1.509 0.241618
Residuals 18 157.6 8.76
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
shapiro.test(resp1$res)
Shapiro-Wilk normality test
data: resp1$res
W = 0.95585, p-value = 0.1597
bartlett.test(resp1$res, PG)
Bartlett test of homogeneity of variances
data: resp1$res and PG
Bartlett's K-squared = 1.5316, df = 2, p-value = 0.465
bartlett.test(resp1$res, PCH)
Bartlett test of homogeneity of variances
data: resp1$res and PCH
Bartlett's K-squared = 1.1254, df = 3, p-value = 0.771
bartlett.test(resp1$res, PG:PCH)
Bartlett test of homogeneity of variances
data: resp1$res and PG:PCH
Bartlett's K-squared = 5.3984, df = 11, p-value = 0.9103
Tukey_PG <- HSD.test(VR, PG, DFerror = 4, MSerror = 13.21);Tukey_PG
$statistics
MSerror Df Mean CV MSD
13.21 4 62.50694 5.814644 5.288252
$parameters
test name.t ntr StudentizedRange alpha
Tukey PG 3 5.040241 0.05
$means
VR std r se Min Max Q25 Q50 Q75
100 67.08583 5.092725 12 1.049206 60.51 74.55 62.71 65.820 72.635
50 57.75583 3.649457 12 1.049206 51.96 63.87 55.46 56.895 60.530
75 62.67917 3.529578 12 1.049206 58.19 70.96 59.86 62.700 64.305
$comparison
NULL
$groups
VR groups
100 67.08583 a
75 62.67917 ab
50 57.75583 b
attr(,"class")
[1] "group"
Tukey_PCH <- HSD.test(VR, PCH, DFerror = 18, MSerror = 8.76);Tukey_PCH
$statistics
MSerror Df Mean CV MSD
8.76 18 62.50694 4.735041 3.943325
$parameters
test name.t ntr StudentizedRange alpha
Tukey PCH 4 3.996978 0.05
$means
VR std r se Min Max Q25 Q50 Q75
15 60.85111 2.970524 9 0.9865766 55.78 65.26 59.51 60.51 62.41
20 59.74333 4.304056 9 0.9865766 51.96 64.89 56.79 59.56 62.81
25 62.78000 6.051256 9 0.9865766 53.69 72.77 61.81 62.55 66.93
30 66.65333 6.433426 9 0.9865766 57.00 74.55 62.85 64.11 72.59
$comparison
NULL
$groups
VR groups
30 66.65333 a
25 62.78000 ab
15 60.85111 b
20 59.74333 b
attr(,"class")
[1] "group"
op<-par(mfrow = c(1,2), cex = 1.0, cex.lab = 1.5)
plot(Tukey_PG, xlab = "Cantidad de Agua",variation = "IQR")
plot(Tukey_PCH, xlab = "Temperaturas de Coccion",variation = "IQR")
rm(list = ls())