seedrates                package:DAAG                R Documentation

_B_a_r_l_e_y _S_e_e_d_i_n_g _R_a_t_e _D_a_t_a

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

     The 'seedrates' data frame has 5 rows and 2 columns on  the effect
     of seeding rate of barley on yield.

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

     seedrates

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

     This data frame contains the following columns:

     _r_a_t_e the seeding rate

     _g_r_a_i_n the number of grain per head of barley

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

     McLeod, C.C. 1982. Effect of rates of seeding on barley grown for
     grain. New Zealand  Journal of Agriculture 10: 133-136.

_R_e_f_e_r_e_n_c_e_s:

     Maindonald J H 1992. Statistical design, analysis and presentation
     issues. New Zealand Journal of Agricultural Research 35: 121-141.

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

     plot(grain~rate,data=seedrates,xlim=c(50,180),ylim=c(15.5,22),axes=FALSE)
     new.df<-data.frame(rate=(2:8)*25)
     seedrates.lm1<-lm(grain~rate,data=seedrates)
     seedrates.lm2<-lm(grain~rate+I(rate^2),data=seedrates)
     hat1<-predict(seedrates.lm1,newdata=new.df,interval="confidence")
     hat2<-predict(seedrates.lm2,newdata=new.df,interval="confidence")
     axis(1,at=new.df$rate); axis(2); box()
     z1<-spline(new.df$rate, hat1[,"fit"]); z2<-spline(new.df$rate,   
     hat2[,"fit"])
     rate<-new.df$rate; lines(z1$x,z1$y)
     lines(spline(rate,hat1[,"lwr"]),lty=1,col=3)
     lines(spline(rate,hat1[,"upr"]),lty=1,col=3)
     lines(z2$x,z2$y,lty=4)
     lines(spline(rate,hat2[,"lwr"]),lty=4,col=3)
     lines(spline(rate,hat2[,"upr"]),lty=4,col=3)

