SLID1 <- read.table("c:/temp/SLID-Ontario.txt",sep = "\t",header=F,skip=1) names(SLID1) <- c("age","sex","wages","yearsed") SLID1$male <- as.numeric(SLID1$sex == "Male") library(car) # plotting the log-likelihood function for the Box-Cox transformation # start with a broader range SLID1BC <- boxCox(wages ~ male +age +yearsed, data=SLID1, lambda = seq(-2.00, 2.00, length = 10)) # zoom in for a closer look SLID1BC <- boxCox(wages ~ male +age +yearsed, data=SLID1, lambda = seq(-.25, .25, length = 10)) # the function boxCoxVariable in the car package creates the constructed variable SLID1.lm1BC <- lm(wages ~ male +age +yearsed +boxCoxVariable(wages), data=SLID1) av.plots(SLID1.lm1BC,"boxCoxVariable(wages)")