2025-09-21

Slide 1

This scatter plot examines whether players with higher batting averages tend to drive in more runs.

Slide 2

Here we test whether patient hitters (more walks) also tend to strike out less or more frequently.

Slide 3

Slugging measures power, while batting average measures contact. This plot investigates whether contact hitters also tend to hit for power.

Slide 3a - R Code

The R code used to create Slide 3

ggplot(mlb_df, aes(x=avg, y=slg)) +
  geom_point(color="blue", size=3) +
  geom_text(aes(label=name), vjust=-0.7, size=3) +
  geom_smooth(method="lm", se=FALSE, color="red") +
  labs(title="Batting Average vs Slugging",
       x="Average", y="Slugging")

Slide 4

This chart displays batting average, slugging, and strikeouts simultaneously in 3D enviroment.

Slide 5

Residual plots help check model assumptions. We examine how well the linear model RBI∼AVG fits the data.

Slide 6

We test whether batting average relates to RBI:

\[ H_0:\ \beta_1 = 0 \quad \text{(no relationship)} \]

\[ H_1:\ \beta_1 > 0 \quad \text{(positive relationship)} \]

Model: \[ \text{RBI}_i = \beta_0 + \beta_1 \cdot \text{AVG}_i + \varepsilon_i \]

Slide 7

For the slope \(\beta_1\): \[ t = \frac{\hat\beta_1 - 0}{\operatorname{SE}(\hat\beta_1)} \ \sim\ t_{n-2}\ \text{ under } H_0. \]

One-sided p-value for \(H_1:\ \beta_1>0\): \[ p = \Pr\!\big(T_{n-2} \ge t_{\text{obs}}\big). \]

Slide 8

Here we present the estimated slope, its standard error, the t-statistic, and the one-sided p-value.

## Slope (beta1) = 278.6452
## SE = 76.0426
## t = 3.664
## One-sided p = 0.0003381

Players with higher Batting Averages tend to drive in more runs.