Cwomen1 <- read.table("c:/temp/BFox.txt",header=F,skip=1) names(Cwomen1) <- c("year","participation","tfr","menWages","womenWages","debt","parttime") Cwomen1$tfr <- Cwomen1$tfr*(Cwomen1$year != 1973) +1931*(Cwomen1$year == 1973) Cwomen1.lm1 <- lm(participation ~ tfr +menWages +womenWages +debt +parttime +year, data=Cwomen1) # A ridge regression function is available in the MASS library library(MASS) Cwomen.lmridge <- lm.ridge(participation ~ tfr +menWages +womenWages +debt +parttime +year, data=Cwomen1,lambda = seq(0,0.2,0.005)) plot(Cwomen.lmridge,lambda = seq(0,0.2,0.005)) Cwomen.lmridge$kHKB Cwomen.lmridge$kLW Cwomen.lmridge$GCV plot(Cwomen.lmridge$GCV)