# Illustration of Figure 10.7 in the text CanPrestige1 <- read.table("c:/temp/prestige.txt",header=T) names(CanPrestige1) # make a new education variable CanPrestige1$ed2 <- 2*CanPrestige1$education # center variables CanPrestige1$educationc <- CanPrestige1$education -mean(CanPrestige1$education) CanPrestige1$ed2c <- CanPrestige1$ed2 - mean(CanPrestige1$ed2) CanPrestige1$prestigec <- CanPrestige1$prestige -mean(CanPrestige1$prestige) # coefficients are different summary(lm(prestigec ~ educationc -1, data = CanPrestige1)) summary(lm(prestigec ~ ed2c -1, data = CanPrestige1)) # sums of squares and related quantities are not different anova(lm(prestigec ~ educationc -1, data = CanPrestige1)) anova(lm(prestigec ~ ed2c -1, data = CanPrestige1))