ic <- read.csv("http://www.stat.ufl.edu/~winner/data/icecream_sensory.csv") attach(ic); names(ic) mod0 <- lm(DOLtexture ~ sweetness) summary(mod0) plot(DOLtexture ~ sweetness) abline(mod0) mod1 <- lm(DOLtexture ~ sweetness + I(sweetness^2)) summary(mod1) mod2 <- lm(DOLtexture ~ crystals + I(crystals^2)) summary(mod2) mod3 <- lm(DOLtexture ~ doughy + I(doughy^2)) summary(mod3) mod4 <- lm(DOLtexture ~ creamy + I(creamy^2)) summary(mod4) par(mfrow=c(2,2)) x <- seq(0,14,.01) plot(DOLtexture ~ sweetness, xlim=c(0,14), ylim=c(1,9), xlab="sweetness", ylab="Degree of Likeness - Texture") lines(x,predict(mod1,list(sweetness=x))) plot(DOLtexture ~ crystals, xlim=c(0,14), ylim=c(1,9), xlab="crystals", ylab="Degree of Likeness - Texture") lines(x,predict(mod2,list(crystals=x))) plot(DOLtexture ~ doughy, xlim=c(0,14), ylim=c(1,9), xlab="doughy", ylab="Degree of Likeness - Texture") lines(x,predict(mod3,list(doughy=x))) plot(DOLtexture ~ creamy, xlim=c(0,14), ylim=c(1,9), xlab="creamy", ylab="Degree of Likeness - Texture") lines(x,predict(mod4,list(creamy=x)))