R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DAAG)
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DAAG/seedrates.Rd_%03d_medium.png", width=480, height=480)
> ### Name: seedrates
> ### Title: Barley Seeding Rate Data
> ### Aliases: seedrates
> ### Keywords: datasets
>
> ### ** Examples
>
> 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)
>
>
>
>
> dev.off()
null device
1
>