2026-02-08

Introduction of Concepts and Dataset

This set of data involves the relationships between the heights and weights of adult women. In this case, it will be used to demonstrate the concept of simple linear regression in statistics.

The model, also known as the line of best fit, is given by

\[ \text{Weight} = \beta_0 + \beta_1\cdot\text{Height} + \varepsilon \] where \(\beta_0\) is the intercept, \(\beta_1\) is the slope, and \(\varepsilon\) is the error.

Women Dataset

The dataset being used throughout this presentation is the “women” dataset, built into base R.

data(women)
head(women)
  height weight
1     58    115
2     59    117
3     60    120
4     61    123
5     62    126
6     63    129

Scatter Plot Representation

The plot below showcases the data in a way that improves interpretation of the relationship between height and weight. It shows a strong positive linear relationship, as seen by the accompanying linear regression line.

Residual Analysis

The concept of a residual revolves around how well the line fits individual data points. Although the plot seems to show a slight curving trend, the visual below seems to further support the strong linear model. The residual formula is \(r = x - x_0\).

Two Previous Plots’ Code

Regression Plot:

plot = ggplot(women, aes(x = height, y = weight)) + geom_point() +
  geom_smooth(methods="lm")

Residual Plot:

women$residuals = residuals(model)

plot = ggplot(women, aes(x = height, y = residuals)) + geom_point()

Interactive Plotly Visualization

The below plot shows a 2D Interactive Plotly model for the given data set. It shows the scatter plot of data in addition to the regression line.

Conclusion

  • The relationship between the height and weight of adult women can be represented by a linear regression model with the given dataset
  • The given relationship is strong, linear, and positive, which shows that height and weight of adult women go hand in hand
  • Linear regression models can be created using plotly and ggplot2 within an ioslides presentation