Math 455 – Statistics
After typing/cutting and pasting each command, explain in a sentence or two what the command is actually doing You may include a graph, etc. if appropriate. For example, the first command is importing the data into r. (Your first command will be different as you will have saved the file to a different location, initially.)
Ch08_Roller_coaster <- read.csv("/Volumes/LBARTON/2013 -2014/Statistics/r/Data sets from Stats textbook/Ch08_Roller_coaster.csv")
View(Ch08_Roller_coaster)
This command…..
plot(Ch08_Roller_coaster$Drop,Ch08_Roller_coaster$Duration)
This command…..
plot(Ch08_Roller_coaster$Drop,Ch08_Roller_coaster$Duration,xlab="Drop in feet",ylab="Duration in seconds",main="Roller Coaster")
This command…..
lm(Ch08_Roller_coaster$Duration~Ch08_Roller_coaster$Drop)
This command…..
abline(lm(Ch08_Roller_coaster$Duration~Ch08_Roller_coaster$Drop),col="blue")
This command….
regdrop=lm(Ch08_Roller_coaster$Duration~Ch08_Roller_coaster$Drop)
This command…..
regdrop
This command…..
summary(regdrop)
This command…..
data.frame(Ch08_Roller_coaster$Duration,Ch08_Roller_coaster$Drop,fitted.value=fitted(lm(Ch08_Roller_coaster$Duration~Ch08_Roller_coaster$Drop)),residual=resid(lm(Ch08_Roller_coaster$Duration~Ch08_Roller_coaster$Drop)))
This command…..
fitdrop=fitted(regdrop)
This command…..
residdrop=resid(regdrop)
This command…..
plot(fitdrop,residdrop)
This command…..
plot(fitdrop,residdrop,xlab="fitted duration",ylab="residual")
This command…..
abline(0,0)
This command…..
Attendance 2006
The data below provides information about various baseball teams in 2006, their number of wins and home game attendance.
Team / Wins / Runs / Home AttendanceMinnesota Twins / 96 / 801 / 28210
New York Yankees / 97 / 930 / 51858
Toronto Blue Jays / 87 / 809 / 28422
Cleveland Indians / 78 / 870 / 24667
Chicago White Sox / 90 / 868 / 36511
Texas Rangers / 80 / 835 / 29490
Baltimore Orioles / 70 / 768 / 26583
Los Angeles Angels / 89 / 766 / 42059
Detroit Tigers / 95 / 822 / 32048
Seattle Mariners / 78 / 756 / 30626
Kansas City Royals / 62 / 757 / 17158
Boston Red Sox / 86 / 820 / 36182
Oakland Athletics / 93 / 771 / 24402
Tampa Bay Devil Rays / 61 / 689 / 16901
- Create a scatterplot of “Home Attendance” (y) vs. “wins” (x)
- Create and display the LSRL
- Create a residual plot (predicted values on the x – axis and residuals on the y-axis.
- Draw the line y = 0 on your residual plot.
- Display the regression analysis.
- Based upon your work thus far, do you think a linear model is appropriate here? Explain.
- Interpret the meaning of the slope.
- Interpret the meaning of
- On your residual graph, the point in the upper right represents the Yankees. What can you say about the residual for the Yankees?
- What is the correlation between wins and average attendance?
- What would you predict about the average attendance for a team that is 2 standard deviations about the average in wins?
- If a team is 1 standard deviation below average in attendance, what would you predict about the number of games the team has won?
Homework: page 192 – 195 # 5, 7, 16, 17, 22, 34