# open fan price data # assuming you have already made Desktop the root directory for R gameprice <- read.table("fandata.txt") gameprice colnames(gameprice) <- c("team", "Adult", "Child", "Parking", "Soda") gameprice child <- gameprice[,3] adult <- gameprice[,2] child adult # create a linear model using the lm() command # then run a scatterplot with model # line on the plot # make child the y or response variable # and call the model pricemodel1 pricemodel1 <- lm(child~adult) plot(adult,child) abline(pricemodel1) # save residuals and make residual plot # plot x axis on plot residual1 <- resid(pricemodel1) plot(adult,residual1) abline(0,0) # make summary of model summary(pricemodel1)