Question
This assessment has multi-part questions that will all use the setup below. Game attendance in baseball varies partly as a function of how well a
This assessment has 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 theLahmanlibrary.
TheTeamsdata frame contains anattendancecolumn. This is the total attendance for the season. To calculate average attendance, divide by the number of games played, as follows:
library(tidyverse)
library(broom)
library(Lahman)
Teams_small <- Teams %>%
filter(yearID %in% 1961:2001) %>%
mutate(avg_attendance = attendance/G)
Use linear models to answer the following 3-part question aboutTeams_small.
Question
Fit a multivariate regression determining the effects of runs per game, home runs per game, wins, and year on average attendance. Use the originalTeams_smallwins column.
- What is the estimate of the effect of runs per game on average attendance?
- What is the estimate of the effect of home runs per game on average attendance?
- What is the estimate of the effect of number of wins in a season on average attendance?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started