This scatter plot examines whether players with higher batting averages tend to drive in more runs.
2025-09-21
This scatter plot examines whether players with higher batting averages tend to drive in more runs.
Here we test whether patient hitters (more walks) also tend to strike out less or more frequently.
Slugging measures power, while batting average measures contact. This plot investigates whether contact hitters also tend to hit for power.
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")
This chart displays batting average, slugging, and strikeouts simultaneously in 3D enviroment.
Residual plots help check model assumptions. We examine how well the linear model RBI∼AVG fits the data.
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 \]
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). \]
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.