Cathedrals <- read.table('http://math.uttyler.edu/nathan/classes/statistics/data/cathedrals.data',header=TRUE) Cathedrals[1:10,] attach(Cathedrals) plot(x,y,type='n',main='Cathedrals',xlab='height',ylab='length') points(x[style=='r'],y[style=='r'],pch='r') points(x[style=='g'],y[style=='g'],pch='g') abline(lm(y~x),col='yellow') abline(lm(y[style=='r']~x[style=='r']),col='pink',lty=2) abline(lm(y[style=='g']~x[style=='g']),col='pink',lty=2) goth = ifelse(style=='g',1,0) m1 <- lm(y~x+goth+x*goth) summary(m1) # slopes same m2 <- lm(y ~ x +goth) summary(m2) hot.dogs <- read.table('http://math.uttyler.edu/nathan/classes/statistics/data/hotdogs.data',header=TRUE) hot.dogs