question archive Assessment: Linear Models (Verified Leamers only) a Bookmark this page Assessment due Nov 21, 2021 IST This assessment has 6 multi-part questions that will all use the setup below
Subject:StatisticsPrice:14.99 Bought3
a Bookmark this page
Assessment due Nov 21, 2021 IST
This assessment has 6 multi-part questions that will all use the setup below.
Game attendance in baseball varies partly as a function of how well a team is playing.
Load the Lahman library. The Teams data frame contains an attendance column. This is the total attendance for the season. To calculate average attendance, divide by the number of games played, as follows:
I i brary (broom)
I i bra ry (Lahman)
Teams_small <- Teams fi ter (yearlD %inz 1961:2ØØ1)
mutate(avg_attendance = attendance/G)
use linear models to answer the following 3-part question about Teams_small.
10/2.0 points (graded)
Use runs ( R ) per game to predict average attendance-
For every 1 run scored per game, average attendance increases by how much?
4117
4117
Use home runs ( SR ) per game to predict average attendance.
For every 1 home run hit per game, gverage ettendence increases b}' how much?
6000
6000
Submit You have used 10 of IC attempts Sh ow answer
0_012.0 goinlg (graded)
Use number of wins to predict average attendance; do not normalize far number of games.
For every game won in a season, how much does average attendance increase?
-7213
—7213
Suppose a team zero games in a Season,
Predict the average attenda nce.
-7213
-7213
Question lc
0 041.0 point (graded) use year to predict average attendance.
How much does average attendance increase each year?
7213 |
x
7213
You have used 3 of 10 attempts
Stratify Teams_small by wins: divide number Of Wins by 10 and then round to the nearest integer. Keep only strata 5 through 10, which have 20 or more data points.
Use the stratified dataset to answer this three-part question.
0 0/1.0 point (graded)
How many observations are in the 8 win strata?
(Note that due division and rounding, 75-85 wins.)
5
You have used I of 10 attempts
Question 3b
shß? |
00/3.0 points (graded)
Fit a multivariate regression determining the effects of runs per game, home runs per game, wins, and year on average attendance. use the original wins column, not the win strata from question 3.
What is the estimate of the effect of runs per game on average attendance?
1000 |
x
1000
What is the estimate of the effect of home runs per game on average attendance?
1000 |
x
1000
What is the estimate of the effect of number of wins in a season on average attendance?
1000 |
x
1000
10 |
attempts |
Question 5
0 0/2.0 points (graded)
Use the multivariate regression model from Question 4. Suppose a team averaged 5 runs per game, 1.2 home runs per game, and won 80 games in a season.
What would this team's average attendance be in 2002?
1000
1000
What would this team's average attendance be in 1960?
1000
1000
You have used I of 10 attempts
0.0/1.0 point (graded)
Use your model from Question 4 to predict average attendance for teams in 2002 in the original data frame.
What is the correlation between the predicted attendance and actual attendance?