plots               package:agricolae               R Documentation

_D_a_t_a _f_o_r _a_n _a_n_a_l_y_s_i_s _i_n _s_p_l_i_t-_p_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     Experimental data in blocks, factor A in plots and factor B in
     sub-plots.

_U_s_a_g_e:

     data(plots)

_F_o_r_m_a_t:

     A data frame with 18 observations on the following 5 variables.

     '_b_l_o_c_k' a numeric vector

     '_p_l_o_t' a factor with levels 'p1' 'p2' 'p3' 'p4' 'p5' 'p6'

     '_A' a factor with levels 'a1' 'a2'

     '_B' a factor with levels 'b1' 'b2' 'b3'

     '_y_i_e_l_d' a numeric vector

_S_o_u_r_c_e:

     International Potato Center. CIP

_E_x_a_m_p_l_e_s:

     library(agricolae)
     data(plots)
     str(plots)
     plots[,1] <-as.factor(plots[,1])
     # split-plot analysis
     model <- aov(yield ~ block + A + Error(plot)+ B + A:B, data=plots)
     summary(model)
     attach(plots)
     b<-nlevels(B)
     a<-nlevels(A)
     r<-nlevels(block)
     dfa <- df.residual(model$plot)
     Ea <-deviance(model$plot)/dfa
     dfb <- df.residual(model$Within)
     Eb <-deviance(model$Within)/dfb
     Eab <- (Ea +(b-1)*Eb)/(b*r)
     # Satterthwaite
     dfab<-(Ea +(b-1)*Eb)^2/(Ea^2/dfa +((b-1)*Eb)^2/dfb)
     # Comparison A, A(b1), A(b2), A(b3)
     comparison1 <-LSD.test(yield,A,dfa,Ea)
     comparison2 <-LSD.test(yield[B=="b1"],A[B=="b1"],dfab,Eab)
     comparison3 <-LSD.test(yield[B=="b2"],A[B=="b2"],dfab,Eab)
     comparison4 <-LSD.test(yield[B=="b3"],A[B=="b3"],dfab,Eab)
     # Comparison B, B(a1), B(a2)
     comparison5 <-LSD.test(yield,B,dfb,Eb)
     comparison6 <-LSD.test(yield[A=="a1"],B[A=="a1"],dfb,Eb)
     comparison7 <-LSD.test(yield[A=="a2"],B[A=="a2"],dfb,Eb)
     detach(plots)

