#creating the variables ffev1a = ffev1/100 and mfev1ma = mfev1/100. lung$ffev1a <- lung$ffev1/100 lung$mfev1a <- lung$mfev1a/100 #Fitting the regression. lm1 <- lm(ffev1a ~ fheight, lung, na.action=na.exclude) print(lm1) #predicting the fitted values. lung$p <- predict(lm1) #fig. 6.1, p. 87. plot(lung$fheight, lung$ffev1a, xlab="FHEIGHT", ylab="FFEV1", pch=5, xlim=c(60, 75), ylim=c(2, 6)) lines(lung$fheight, lung$p) #Test of correlation. cor.test(lung$fheight, lung$ffev1a) #table 6.2, p. 101. aov1 <- aov(ffev1a~fheight, lung) summary(aov1)