pdf("C:\\Rmisc\\rpd.prob.1.9a.pdf") x <- c(29.7,68.4,120.7,217.2,313.5,419.1,535.9,641.5) y <- c(16.6,49.1,121.7,219.6,375.5,570.8,648.2,755.6) xy <- data.frame(x,y) attach(xy) xy # print the xy dataframe xy.reg <- lm(y~x) # Fit the regression (lm=linear model) summary(xy.reg) # Print out estimates, t-tests anova(xy.reg) # Print out ANOVA table xy.reg0 <- lm(y~x -1) # Fits regression thru Origin summary(xy.reg0) # Print out estimates, t-tests anova(xy.reg0) # Print out ANOVA table plot(x,y,xlab="Solar Radiation",ylab="Plant Biomass",main="RPD-Problem 1.9", xlim=c(0,675),ylim=c(-100,900)) abline(xy.reg,lty=1) abline(xy.reg0,lty=2) dev.off()