febrero 16, 2013

Análisis de varianza para un diseño balanceado lattice de 4 x 4 (en R)

Tabla 2.10 Número de cultivadores por metro cuadrado de 16 tratamientos de fertilizante examinados en un diseño balanceado lattice de 4 X 4. (Fuente: paginas 39–52 en Statistical Procedures for Agricultural Research. 1984. Gómez, K.A.; Gómez, A.A. Segunda Edición; IRRI—John Wiley & Sons.)

Bloque Número
Cultivador, no./m2
Bloque Total (B)
Bloque Número
Cultivador, no./m2
Bloque Total (B)
Rep. I
Rep. II
(1)
(2)
(3)
(4)
(1)
(5)
(9)
(13)
1
147
152
167
150
616
5
140
165
182
152
639
(5)
(6)
(7)
(8)
(10)
(2)
(14)
(6)
2
127
155
162
172
616
6
97
155
192
142
586
(9)
(10)
(11)
(12)
(7)
(15)
(3)
(11)
3
147
100
192
177
616
7
155
182
192
192
721
(13)
(14)
(15)
(16)
(16)
(8)
(12)
(4)
4
155
195
192
205
747
8
182
207
232
162
783
Rep. total R1
2595
Rep. total R2
2729
Rep. III
Rep. IV
(1)
(6)
(11)
(16)
(1)
(14)
(7)
(12)
9
155
162
177
152
646
13
220
202
175
205
802
(5)
(2)
(15)
(12)
(13)
(2)
(11)
(8)
10
182
130
177
165
654
14
205
152
180
187
724
(9)
(14)
(3)
(8)
(5)
(10)
(3)
(16)
11
137
185
152
152
626
15
165
150
200
160
675
(13)
(10)
(7)
(4)
(9)
(6)
(15)
(4)
12
185
122
182
192
681
16
155
177
185
172
689
Rep. total R3
2607
Rep. total R4
2890
Rep. V
(1)
(10)
(15)
(8)
17
147
112
177
147
583
(9)
(2)
(7)
(16)
18
180
205
190
167
742
(13)
(6)
(3)
(12)
19
172
212
197
192
773
(5)
(14)
(11)
(4)
20
177
220
205
225
827
Rep. total R5
2925










# Inicia sintaxis de Lattice 4X4 
# Lattice 4X4

# Tabla 2.10 Número de cultivadores por metro cuadrado de 16 tratamientos de fertilizante examinados en un diseño balanceado lattice de 4 X 4

# cargando datos
lattice4X4 = read.csv("C:/Users/Administrator/Desktop/tabla2.10.csv", header = T)
str(lattice4X4)
'data.frame':   80 obs. of  4 variables:
 $ bloque: int  1 1 1 1 2 2 2 2 3 3 ...
 $ rep   : int  1 1 1 1 1 1 1 1 1 1 ...
 $ trt   : int  1 2 3 4 5 6 7 8 9 10 ...
 $ yield : int  147 152 167 150 127 155 162 172 147 100 ...

# paquetes requeridos
require(agricolae)
Loading required package: agricolae
require(MASS)     # metodo = VC in PBIB.test
Loading required package: MASS
require(lme4)     # metodo = REML or LM in PBIB.test
Loading required package: lme4
Loading required package: Matrix
Loading required package: lattice
Attaching package: 'lme4'
The following object is masked from 'package:stats':

AIC, BIC

# ejecutando modelo
attach(lattice4X4)
model <- PBIB.test(bloque, trt, rep, yield, k=4, method="VC", group= F, test="lsd")

ANALYSIS PBIB:  yield 

Class level information
bloque : 20 
trt : 16

Number of observations:  80 

Estimation Method:  Variances component model 

Analysis of Variance Table

Response: yield
           Df Sum Sq Mean Sq F value  Pr(>F)    
rep         4   5946    1487    4.60  0.0034 ** 
trt.unadj  15  26994    1800    5.57 3.4e-06 ***
bloque/rep 15  11382     759    2.35  0.0138 *  
Residual   45  14533     323                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

coefficient of variation: 10.5 %
yield Means: 171.8 

Parameters PBIB
             .
trt         16
bloque size  4
bloque/rep   4
rep          5

Efficiency factor 0.8 

Comparison test lsd 

Comparison between treatments means and its name

<<< to see the objects: means, comparison and groups. >>>
model <- PBIB.test(bloque, trt, rep, yield, k=4, method="REML", group= F, test="lsd")

ANALYSIS PBIB:  yield 

Class level information
bloque : 20 
trt : 16

Number of observations:  80 

Estimation Method:  Residual (restricted) maximum likelihood 

Parameter Estimates
           Variance
bloque:rep   136.20
rep           38.67
Residual     322.96

                      Fit Statistics
-2 Res Log Likelihood          596.1
AIC                            636.1
BIC                            683.7

Analysis of Variance Table

Response: yield
          Df Sum Sq Mean Sq F value  Pr(>F)    
trt       15  20988    1399    4.33 6.5e-05 ***
Residuals 45  14533     323                    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

coefficient of variation: 10.5 %
yield Means: 171.8 

Parameters PBIB
             .
trt         16
bloque size  4
bloque/rep   4
rep          5

Efficiency factor 0.8 

Comparison test lsd 

Comparison between treatments means and its name

<<< to see the objects: means, comparison and groups. >>>
Resultado de F-calculada mostrado en página 51.

# comparacion de medias de tratamientos
model$means
   yield trt mean.adj    SE r std.err Min. Max.
1  161.8   1    165.8 9.372 5  14.742  140  220
2  158.8   2    161.0 9.372 5  12.391  130  205
3  181.6   3    183.9 9.372 5   9.416  152  200
4  180.2   4    175.7 9.372 5  13.147  150  225
5  163.2   5    162.9 9.372 5   9.646  127  182
6  169.6   6    173.8 9.372 5  12.011  142  212
7  172.8   7    168.4 9.372 5   6.398  155  190
8  173.0   8    176.9 9.372 5  11.113  147  207
9  160.2   9    163.0 9.372 5   8.963  137  182
10 116.2  10    118.8 9.372 5   9.552   97  150
11 189.2  11    188.2 9.372 5   4.994  177  205
12 194.2  12    190.5 9.372 5  11.616  165  232
13 173.8  13    169.5 9.372 5   9.825  152  205
14 198.8  14    197.2 9.372 5   5.962  185  220
15 182.6  15    185.7 9.372 5   2.804  177  192
16 173.2  16    167.8 9.372 5   9.356  152  205
model$comparison
        Difference stderr   pvalue
1 - 2       4.7231  12.15 0.699416
1 - 3     -18.1559  12.15 0.142222
1 - 4      -9.9137  12.15 0.419008
1 - 5       2.8862  12.15 0.813378
1 - 6      -8.0585  12.15 0.510716
1 - 7      -2.6716  12.15 0.827020
1 - 8     -11.1569  12.15 0.363556
1 - 9       2.7631  12.15 0.821198
1 - 10     46.9426  12.15 0.000358
1 - 11    -22.4317  12.15 0.071546
1 - 12    -24.7752  12.15 0.047418
1 - 13     -3.7434  12.15 0.759516
1 - 14    -31.4717  12.15 0.012910
1 - 15    -19.9097  12.15 0.108388
1 - 16     -2.0162  12.15 0.868994
2 - 3     -22.8790  12.15 0.066268
2 - 4     -14.6368  12.15 0.234802
2 - 5      -1.8369  12.15 0.880552
2 - 6     -12.7816  12.15 0.298606
2 - 7      -7.3947  12.15 0.545988
2 - 8     -15.8800  12.15 0.198020
2 - 9      -1.9600  12.15 0.872614
2 - 10     42.2195  12.15 0.001148
2 - 11    -27.1548  12.15 0.030488
2 - 12    -29.4983  12.15 0.019294
2 - 13     -8.4665  12.15 0.489656
2 - 14    -36.1948  12.15 0.004662
2 - 15    -24.6328  12.15 0.048652
2 - 16     -6.7393  12.15 0.582006
3 - 4       8.2422  12.15 0.501174
3 - 5      21.0421  12.15 0.090268
3 - 6      10.0974  12.15 0.410504
3 - 7      15.4842  12.15 0.209226
3 - 8       6.9989  12.15 0.567602
3 - 9      20.9190  12.15 0.092108
3 - 10     65.0985  12.15 0.000002
3 - 11     -4.2758  12.15 0.726640
3 - 12     -6.6194  12.15 0.588720
3 - 13     14.4124  12.15 0.241942
3 - 14    -13.3158  12.15 0.279112
3 - 15     -1.7539  12.15 0.885912
3 - 16     16.1397  12.15 0.190920
4 - 5      12.7999  12.15 0.297922
4 - 6       1.8552  12.15 0.879370
4 - 7       7.2420  12.15 0.554276
4 - 8      -1.2433  12.15 0.918984
4 - 9      12.6768  12.15 0.302538
4 - 10     56.8563  12.15 0.000026
4 - 11    -12.5180  12.15 0.308562
4 - 12    -14.8616  12.15 0.227806
4 - 13      6.1703  12.15 0.614180
4 - 14    -21.5580  12.15 0.082888
4 - 15     -9.9961  12.15 0.415182
4 - 16      7.8975  12.15 0.519158
5 - 6     -10.9447  12.15 0.372672
5 - 7      -5.5579  12.15 0.649682
5 - 8     -14.0432  12.15 0.254034
5 - 9      -0.1231  12.15 0.991962
5 - 10     44.0563  12.15 0.000734
5 - 11    -25.3179  12.15 0.042964
5 - 12    -27.6615  12.15 0.027668
5 - 13     -6.6297  12.15 0.588142
5 - 14    -34.3579  12.15 0.006992
5 - 15    -22.7960  12.15 0.067222
5 - 16     -4.9025  12.15 0.688608
6 - 7       5.3869  12.15 0.659750
6 - 8      -3.0985  12.15 0.799946
6 - 9      10.8216  12.15 0.378026
6 - 10     55.0011  12.15 0.000044
6 - 11    -14.3732  12.15 0.243206
6 - 12    -16.7168  12.15 0.175834
6 - 13      4.3151  12.15 0.724238
6 - 14    -23.4132  12.15 0.060400
6 - 15    -11.8513  12.15 0.334752
6 - 16      6.0423  12.15 0.621528
7 - 8      -8.4853  12.15 0.488698
7 - 9       5.4347  12.15 0.656924
7 - 10     49.6142  12.15 0.000180
7 - 11    -19.7601  12.15 0.110992
7 - 12    -22.1036  12.15 0.075642
7 - 13     -1.0718  12.15 0.930124
7 - 14    -28.8001  12.15 0.022164
7 - 15    -17.2381  12.15 0.163010
7 - 16      0.6554  12.15 0.957236
8 - 9      13.9200  12.15 0.258162
8 - 10     58.0995  12.15 0.000020
8 - 11    -11.2748  12.15 0.358558
8 - 12    -13.6183  12.15 0.268478
8 - 13      7.4135  12.15 0.544974
8 - 14    -20.3148  12.15 0.101592
8 - 15     -8.7528  12.15 0.475174
8 - 16      9.1407  12.15 0.455946
9 - 10     44.1795  12.15 0.000712
9 - 11    -25.1948  12.15 0.043942
9 - 12    -27.5383  12.15 0.028332
9 - 13     -6.5065  12.15 0.595070
9 - 14    -34.2348  12.15 0.007182
9 - 15    -22.6728  12.15 0.068658
9 - 16     -4.7793  12.15 0.696022
10 - 11   -69.3743  12.15 0.000000
10 - 12   -71.7178  12.15 0.000000
10 - 13   -50.6860  12.15 0.000136
10 - 14   -78.4143  12.15 0.000000
10 - 15   -66.8523  12.15 0.000002
10 - 16   -48.9588  12.15 0.000214
11 - 12    -2.3435  12.15 0.847976
11 - 13    18.6883  12.15 0.131162
11 - 14    -9.0400  12.15 0.460894
11 - 15     2.5220  12.15 0.836564
11 - 16    20.4155  12.15 0.099958
12 - 13    21.0318  12.15 0.090420
12 - 14    -6.6965  12.15 0.584400
12 - 15     4.8655  12.15 0.690830
12 - 16    22.7590  12.15 0.067650
13 - 14   -27.7283  12.15 0.027314
13 - 15   -16.1663  12.15 0.190202
13 - 16     1.7272  12.15 0.887634
14 - 15    11.5620  12.15 0.346564
14 - 16    29.4555  12.15 0.019460
15 - 16    17.8935  12.15 0.147938




No hay comentarios.: