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") SLID1$log2wages <- log2(SLID1$wages) # --------- try a regression with the log base 2 data ----------------- SLID1.lm2 <- lm(log2wages ~ male +age +yearsed, data=SLID1) # automatically generates several useful plots par(mfrow=c(2,2)) plot(SLID1.lm2) par(mfrow=c(1,1)) # --------------------------------------------------------------------- # Create the partial residual plots # --------------------------------------------------------------------- library(car) cr.plots(SLID1.lm2,variable="age") cr.plots(SLID1.lm2,variable="yearsed") # ------- here the two plots are in the same figure ------------------- par(mfrow=c(1,2)) cr.plots(SLID1.lm2,variable="age") cr.plots(SLID1.lm2,variable="yearsed") par(mfrow=c(1,1))