Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We have shown how BB and singles have similar predictive power for scoring runs. Another way to compare the usefulness of these baseball metrics is

We have shown how BB and singles have similar predictive power for scoring runs. Another way to compare the usefulness of these baseball metrics is by assessing how stable they are across the years.Because we have to pick players based on their previous performances, we will prefer metrics that are more stable. In these exercises, we will compare the stability of singles and BBs.

Before we get started, we want to generate two tables: one for 2002 and another for the average of 1999-2001 seasons. We want to define per plate appearance statistics, keeping only players with more than 100 plate appearances. Here is how we create the 2002 table:

library(Lahman) bat_02 <- Batting %>% filter(yearID == 2002) %>% mutate(pa = AB + BB, singles = (H - X2B - X3B - HR)/pa, bb = BB/pa) %>% filter(pa >= 100) %>% select(playerID, singles, bb) 

Question 9

Now compute a similar table but with rates computed over 1999-2001. Keep only rows from 1999-2001 where players have 100 or more plate appearances, calculate each player's single rate and BB rate per stint (where each row is one stint - a player can have multiple stints within a season), then calculate the average single rate (mean_singles) and average BB rate (mean_bb) per player over the three year period.

How many players had a single ratemean_singlesof greater than 0.2 per plate appearance over 1999-2001?

How many players had a BB ratemean_bbof greater than 0.2 per plate appearance over 1999-2001?

Question 10

Useinner_join()to combine thebat_02table with the table of 1999-2001 rate averages you created in the previous question.

What is the correlation between 2002 singles rates and 1999-2001 average singles rates?

What is the correlation between 2002 BB rates and 1999-2001 average BB rates?

Question 12

Fit a linear model to predict 2002singlesgiven 1999-2001mean_singles.

What is the coefficient ofmean_singles, the slope of the fit?

Fit a linear model to predict 2002bbgiven 1999-2001mean_bb.

What is the coefficient ofmean_bb, the slope of the fit?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals of Cost Accounting

Authors: William Lanen, Shannon Anderson, Michael Maher

3rd Edition

9780078025525, 9780077517359, 77517350, 978-0077398194

Students also viewed these Mathematics questions