Prestige1 <- read.table("c:/temp/Duncan.txt",header=T) names(Prestige1) # the forward package is loaded library(forward) fwdpresreg <- fwdlm(prestige ~ income + education, data = Prestige1) plot(fwdpresreg) # cool, many plots # the following statements produce a plot like Figure 11.9 in the text plot(3:45,fwdpresreg$Coefficients[,3],type="b",col="red",ylim=c(.30,1.0), ylab="Regression Coefficient",xlab="Number of Observations in Subset") lines(3:45,fwdpresreg$Coefficients[,2],type="b",col="blue") title("The forward search with the Prestige data") text(21,.37,expression(B[Education]),col="red") text(21,.91,expression(B[Income]),col="blue")