Modelling with Linear Regression

Arvind V.

2023-04-13

Slides and Tutorials

Multiple Regression - Forward Selection   Multiple Regression - Backward Selection  

Setting up R Packages

library(tidyverse)
library(ggformula)
library(mosaic)
library(GGally)
library(corrplot)
library(corrgram)
library(ggstatsplot)

Plot Fonts and Theme

Code
library(systemfonts)
library(showtext)
## Clean the slate
systemfonts::clear_local_fonts()
systemfonts::clear_registry()
##
showtext_opts(dpi = 96) # set DPI for showtext
sysfonts::font_add(
  family = "Alegreya",
  regular = "../../../../../../fonts/Alegreya-Regular.ttf",
  bold = "../../../../../../fonts/Alegreya-Bold.ttf",
  italic = "../../../../../../fonts/Alegreya-Italic.ttf",
  bolditalic = "../../../../../../fonts/Alegreya-BoldItalic.ttf"
)

sysfonts::font_add(
  family = "Roboto Condensed",
  regular = "../../../../../../fonts/RobotoCondensed-Regular.ttf",
  bold = "../../../../../../fonts/RobotoCondensed-Bold.ttf",
  italic = "../../../../../../fonts/RobotoCondensed-Italic.ttf",
  bolditalic = "../../../../../../fonts/RobotoCondensed-BoldItalic.ttf"
)
showtext_auto(enable = TRUE) # enable showtext
##
theme_custom <- function() {
  theme_bw(base_size = 10) +

    # theme(panel.widths = unit(11, "cm"),
    #       panel.heights = unit(6.79, "cm")) + # Golden Ratio

    theme(
      plot.margin = margin_auto(t = 1, r = 2, b = 1, l = 1, unit = "cm"),
      plot.background = element_rect(
        fill = "bisque",
        colour = "black",
        linewidth = 1
      )
    ) +

    theme_sub_axis(
      title = element_text(
        family = "Roboto Condensed",
        size = 10
      ),
      text = element_text(
        family = "Roboto Condensed",
        size = 8
      )
    ) +

    theme_sub_legend(
      text = element_text(
        family = "Roboto Condensed",
        size = 6
      ),
      title = element_text(
        family = "Alegreya",
        size = 8
      )
    ) +

    theme_sub_plot(
      title = element_text(
        family = "Alegreya",
        size = 14, face = "bold"
      ),
      title.position = "plot",
      subtitle = element_text(
        family = "Alegreya",
        size = 10
      ),
      caption = element_text(
        family = "Alegreya",
        size = 6
      ),
      caption.position = "plot"
    )
}

## Use available fonts in ggplot text geoms too!
ggplot2::update_geom_defaults(geom = "text", new = list(
  family = "Roboto Condensed",
  face = "plain",
  size = 3.5,
  color = "#2b2b2b"
))
ggplot2::update_geom_defaults(geom = "label", new = list(
  family = "Roboto Condensed",
  face = "plain",
  size = 3.5,
  color = "#2b2b2b"
))

ggplot2::update_geom_defaults(geom = "marquee", new = list(
  family = "Roboto Condensed",
  face = "plain",
  size = 3.5,
  color = "#2b2b2b"
))
ggplot2::update_geom_defaults(geom = "text_repel", new = list(
  family = "Roboto Condensed",
  face = "plain",
  size = 3.5,
  color = "#2b2b2b"
))
ggplot2::update_geom_defaults(geom = "label_repel", new = list(
  family = "Roboto Condensed",
  face = "plain",
  size = 3.5,
  color = "#2b2b2b"
))

## Set the theme
ggplot2::theme_set(new = theme_custom())

## tinytable options
options("tinytable_tt_digits" = 2)
options("tinytable_format_num_fmt" = "significant_cell")
options(tinytable_html_mathjax = TRUE)


## Set defaults for flextable
flextable::set_flextable_defaults(font.family = "Roboto Condensed")

Introduction

One of the most common problems in Prediction Analytics is that of predicting a Quantitative response variable, based on one or more Quantitative predictor variables or features. This is called Linear Regression. We will use the intuitions built up during our study of ANOVA to develop our ideas about Linear Regression.

Suppose we have data on salaries in a Company, with years of study and previous experience. Would we be able to predict the prospective salary of a new candidate, based on their years of study and experience? Or based on the mileage done, could we predict the resale price of a used car? These are typical problems in Linear Regression.

In this tutorial, we will use the Boston housing dataset. Our research question is:

Research Question

How do we predict the price of a house in Boston, based on other parameters Quantitative parameters such as area, location, rooms, and crime-rate in the neighbourhood?

The Linear Regression Model

The premise here is that many common statistical tests are special cases of the linear model.

A linear model estimates the relationship between one continuous or ordinal variable (dependent variable or “response”) and one or more other variables (explanatory variable or “predictors”). It is assumed that the relationship is linear:1

\[ \Large{y_i \sim \beta_1*x_i + \beta_0\\} \tag{1}\]

or

\[ y_1 \sim exp(\beta_1)*x_i + \beta_0 \]

but not:

\[ \color{red}{y_i \sim \beta_1*exp(\beta_2*x_i) + \beta_0\\} \]

or

\[ \color{red}{y_i \sim \beta_1 *x^{\beta_2} + \beta_0} \]

In Equation 1, \(\beta_0\) is the intercept and \(\beta_1\) is the slope of the linear fit, that predicts the value of y based the value of x. Each prediction leaves a small “residual” error between the actual and predicted values. \(\beta_0\) and \(\beta_1\) are calculated based on minimizing the sum of squares of these residuals, and hence this method is called “ordinary least squares” (OLS) regression.

Figure 1: Least Squares

The net area of all the shaded squares is minimized in the calculation of \(\beta_0\) and \(\beta_1\). As per Lindoloev, many statistical tests, going from one-sample t-tests to two-way ANOVA, are special cases of this system. Also see Jeffrey Walker “A linear-model-can-be-fit-to-data-with-continuous-discrete-or-categorical-x-variables”.

Linear Models as Hypothesis Tests

Using linear models is based on the idea of Testing of Hypotheses. The Hypothesis Testing method typically defines a NULL Hypothesis where the statements read as “there is no relationship” between the variables at hand, explanatory and responses. The Alternative Hypothesis typically states that there is a relationship between the variables.

Accordingly, in fitting a linear model, we follow the process as follows:

Modelling Process

With \(y = \beta_0 + \beta_1 *x\)

  1. Make the following hypotheses:

\[ NULL\ Hypothesis\ H_0 => x\ and\ y\ are\ unrelated.\ (\beta_1 = 0) \]

\[ Alternate\ Hypothesis\ H_1 => x\ and\ y\ are\ linearly\ related\ (\beta_1 \ne 0) \]

  1. We “assume” that \(H_0\) is true.
  2. We calculate \(\beta_1\).
  3. We then find probability p(\(\beta_1 = Estimated\ Value\) when the NULL Hypothesis is assumed TRUE). This is the p-value. If that probability is p>=0.05, we say we “cannot reject” \(H_0\) and there is unlikely to be significant linear relationship.
  4. However, if p<= 0.05 can we reject the NULL hypothesis, and say that there could be a significant linear relationship, because the probability p that \(\beta_1 = Estimated\ Value\) by mere chance under \(H_0\) is very small.

A Distribution for a Slope \(\beta_1\)??

Why does the slope have a distribution??? Why is it random? Isn’t it a single number that we calculate? Is there anything that is not random in statistics?

  • Remember, we treat our data as a sample from a population.
  • We estimate the slope \(\beta_1\) from the sample.
  • The sample is random, and hence the slope is also random.
  • If we took another sample, we would get a different slope.
  • So the regression-slope is a random variable, and hence has a distribution.

Assumptions in Linear Models

When does a Linear Model work? We can write the assumptions in Linear Regression Models as an acronym, LINE:
1. L: \(\color{blue}{linear}\) relationship between variables 2. I: Errors are independent (across observations)
3. N: \(y\) is \(\color{red}{normally}\) distributed at each “level” of \(x\).
4. E: \(y\) has the same variance at all levels of \(x\). No heteroscedasticity.

Figure 2: OLS Assumptions

Hence a very concise way of expressing the Linear Model is:

\[ \Large{y \sim N(x_i^T * \beta, ~~\sigma^2)} \tag{2}\]

where \(N(mean, variance)\) is the Normal distribution with given mean

General Linear Models

The target variable \(y\) is modelled as a normally distribute variable whose mean depends upon a linear combination of predictor variables \(x\), and whose variance is \(\sigma^2\).

Linear Model Workflow

OK, on with the computation!

Workflow: Read the Data

Let us now read in the data and check for these assumptions as part of our Workflow.

data("BostonHousing2", package = "mlbench")
housing <- BostonHousing2
skimr::skim(housing)
Data summary
Name housing
Number of rows 506
Number of columns 19
_______________________
Column type frequency:
factor 2
numeric 17
________________________
Group variables None

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
town 0 1 FALSE 92 Cam: 30, Bos: 23, Lyn: 22, Bos: 19
chas 0 1 FALSE 2 0: 471, 1: 35

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
tract 0 1 2700.36 1380.04 1.00 1303.25 3393.50 3739.75 5082.00 ▅▂▂▇▂
lon 0 1 -71.06 0.08 -71.29 -71.09 -71.05 -71.02 -70.81 ▁▂▇▂▁
lat 0 1 42.22 0.06 42.03 42.18 42.22 42.25 42.38 ▁▃▇▃▁
medv 0 1 22.53 9.20 5.00 17.02 21.20 25.00 50.00 ▂▇▅▁▁
cmedv 0 1 22.53 9.18 5.00 17.02 21.20 25.00 50.00 ▂▇▅▁▁
crim 0 1 3.61 8.60 0.01 0.08 0.26 3.68 88.98 ▇▁▁▁▁
zn 0 1 11.36 23.32 0.00 0.00 0.00 12.50 100.00 ▇▁▁▁▁
indus 0 1 11.14 6.86 0.46 5.19 9.69 18.10 27.74 ▇▆▁▇▁
nox 0 1 0.55 0.12 0.38 0.45 0.54 0.62 0.87 ▇▇▆▅▁
rm 0 1 6.28 0.70 3.56 5.89 6.21 6.62 8.78 ▁▂▇▂▁
age 0 1 68.57 28.15 2.90 45.02 77.50 94.07 100.00 ▂▂▂▃▇
dis 0 1 3.80 2.11 1.13 2.10 3.21 5.19 12.13 ▇▅▂▁▁
rad 0 1 9.55 8.71 1.00 4.00 5.00 24.00 24.00 ▇▂▁▁▃
tax 0 1 408.24 168.54 187.00 279.00 330.00 666.00 711.00 ▇▇▃▁▇
ptratio 0 1 18.46 2.16 12.60 17.40 19.05 20.20 22.00 ▁▃▅▅▇
b 0 1 356.67 91.29 0.32 375.38 391.44 396.22 396.90 ▁▁▁▁▇
lstat 0 1 12.65 7.14 1.73 6.95 11.36 16.96 37.97 ▇▇▅▂▁

Data Dictionary

The original data are 506 observations on 14 variables, medv being the target variable:

crim per capita crime rate by town
zn proportion of residential land zoned for lots over 25,000 sq.ft
indus proportion of non-retail business acres per town
chas Charles River dummy variable (= 1 if tract bounds river; 0 otherwise)
nox nitric oxides concentration (parts per 10 million)
rm average number of rooms per dwelling
age proportion of owner-occupied units built prior to 1940
dis weighted distances to five Boston employment centres
rad index of accessibility to radial highways
tax full-value property-tax rate per USD 10,000
ptratio pupil-teacher ratio by town
b \(1000(B - 0.63)^2\) where B is the proportion of Blacks by town
lstat percentage of lower status of the population
medv median value of owner-occupied homes in USD 1000’s

The corrected data set has the following additional columns:

cmedv corrected median value of owner-occupied homes in USD 1000’s
town name of town
tract census tract
lon longitude of census tract
lat latitude of census tract

Our response variable is cmedv, the corrected median value of owner-occupied homes in USD 1000’s. Their are many Quantitative feature variables that we can use to predict cmedv. And there are two Qualitative features, chas and tax.

Workflow: EDA

In order to fit the linear model, we need to choose predictor variables that have strong correlations with the target variable. We will first do this with GGally, and then with the tidyverse itself. Both give us a very unique view into the correlations that exist within this dataset.

Model Building

We will first execute the lm test with code and evaluate the results. Then we will do an intuitive walk through of the process and finally, hand-calculate entire analysis for clear understanding.

Workflow: Model Checking and Diagnostics

We will follow much of the treatment on Linear Model diagnostics, given here on the STHDA website.

A first step of this regression diagnostic is to inspect the significance of the regression beta coefficients, as well as, the R.square that tells us how well the linear regression model fits to the data.

For example, the linear regression model makes the assumption that the relationship between the predictors (x) and the outcome variable is linear. This might not be true. The relationship could be polynomial or logarithmic.

Additionally, the data might contain some influential observations, such as outliers (or extreme values), that can affect the result of the regression.

Therefore, the regression model must be closely diagnosed in order to detect potential problems and to check whether the assumptions made by the linear regression model are met or not. To do so, we generally examine the distribution of residuals errors, that can tell us more about our data.

Workflow: Checks for Uncertainty

Let us first look at the uncertainties in the estimates of slope and intercept. These are most easily read off from the broom::tidy-ed model:

# housing_lm_tidy <-  housing_lm %>% broom::tidy()
housing_lm_tidy

Plotting this is simple too:

Code
ggplot2::theme_set(new = theme_custom())

housing_lm_tidy %>%
  gf_col(estimate ~ term, fill = ~term, width = 0.25) %>%
  gf_hline(yintercept = 0) %>%
  gf_errorbar(conf.low + conf.high ~ term,
    width = 0.1,
    title = "Model Bar Plot for Estimates with Confidence Intervals"
  ) %>%
  gf_theme(theme = theme_custom())
##
housing_lm_tidy %>%
  gf_pointrange(estimate + conf.low + conf.high ~ term,
    title = "Model Point-Range Plot for Estimates with Confidence Intervals"
  ) %>%
  gf_hline(yintercept = 0) %>%
  gf_theme(theme = theme_custom())

The point-range plot helps to avoid what has been called “within-the-bar bias”. The estimate is just a value, which we might plot as a bar or as a point, with uncertainty error-bars.

Values within the bar are not more likely!! This is the bias that the point-range plot avoids.

Checks for Constant Variance/Heteroscedasticity

Linear Modelling makes 4 fundamental assumptions:(“LINE”)

  1. Linear relationship between y and x
  2. Observations are independent.
  3. Residuals are normally distributed
  4. Variance of the y variable is equal at all values of x.

We can check these using checks and graphs: Here we plot the residuals against the independent/feature variable and see if there is a gross variation in their range:

Code
ggplot2::theme_set(new = theme_custom())

housing_lm_augment %>%
  gf_point(.resid ~ .fitted, title = "Residuals vs Fitted") %>%
  gf_smooth(method = "loess")

housing_lm_augment %>%
  gf_hline(yintercept = 0, colour = "grey", linewidth = 2) %>%
  gf_point(.resid ~ cmedv, title = "Residuals vs Target Variable")

housing_lm_augment %>%
  gf_dhistogram(~.resid, title = "Histogram of Residuals") %>%
  gf_fitdistr()

housing_lm_augment %>%
  gf_qq(~.resid, title = "Q-Q Residuals") %>%
  gf_qqline()
(a) Residuals vs Fitted Values
(b) Residuals vs Target Variable
(c) Histogram of Residuals
(d) Q-Q Plot of Residuals
Figure 10: Looking at Residuals

The residuals Figure 10 (a) are not quite “like the night sky”, i.e. not random enough; there seems to be some pattern still in them. These point to the need for a richer model, with more predictors.

The “trend line” of residuals vs predictors Figure 10 (a) shows a U-shaped pattern, indicating significant nonlinearity: there is a curved relationship in the graph. The solution can be a nonlinear transformation of the predictor variables, such as \(\sqrt(X)\), \(log(X)\), or even \(X^2\). For instance, we might try a model for cmedv using \(rm^2\) instead of just rm as we have done. This will still be a linear model!

The Q-Q plot of residuals Figure 10 (d) has significant deviations from the normal quartiles.

Apropos, the r-squared for a model lm(cmedv ~ rm^2) shows some improvement:

[1] 0.5501221

Extras

Using Other Packages

There is a very neat package called ggstatsplot3 that allows us to plot very comprehensive statistical graphs. Let us quickly do this:

ggplot2::theme_set(new = theme_custom())

library(ggstatsplot)
housing_lm %>%
  ggstatsplot::ggcoefstats(
    title = "Linear Model for Boston Housing",
    subtitle = "Using ggstatsplot"
  )

This chart shows the estimates for the intercept and rm along with their error bars, the t-statistic, degrees of freedom, and the p-value.

We can also obtain crisp-looking model tables from the new supernova package 4, which is based on the methods discussed in Judd et al.

library(supernova)
supernova::supernova(housing_lm)
 Analysis of Variance Table (Type III SS)
 Model: cmedv ~ rm

                                SS  df        MS       F   PRE     p
 ----- --------------- | --------- --- --------- ------- ----- -----
 Model (error reduced) | 20643.347   1 20643.347 474.335 .4848 .0000
 Error (from model)    | 21934.392 504    43.521                    
 ----- --------------- | --------- --- --------- ------- ----- -----
 Total (empty model)   | 42577.739 505    84.312                    

This table is very neat in that it gives the Sums of Squares for both the NULL (empty) model, and the current model for comparison. The PRE entry is the Proportional Reduction in Error, a measure that is identical with r.squared, which shows how much the model reduces the error compared to the NULL model(48%). The PRE idea is nicely discussed in Judd et al.

Workflow: Model Diagnostic Plots

Tip

Base R has a crisp command to plot these diagnostic graphs. But we will continue to use ggformula.

plot(housing_lm)
(a) Residuals vs Fitted Values
(b) Normal Q-Q Plot
(c) Scale-Location Plot
(d) Residuals vs Leverage
Figure 11: Using Base R for Model Diagnostics

Tip

One of the ggplot extension packages named {lindia} also has a crisp command to plot these diagnostic graphs.

ggplot2::theme_set(new = theme_bw())

library(lindia)
gg_diagnose(housing_lm,
  mode = "base_r"
) # or "all"
Figure 12: Using the lindia package for Model Diagnostics

Multiple Regression

Multiple Regression

It is also possible that there is more than one explanatory variable: this is multiple regression.

\[ y = \beta_0 + \beta_1*x_1 + \beta_2*x_2 ...+ \beta_n*x_n \tag{10}\]

where each of the \(\beta_i\) are slopes defining the relationship between y and \(x_i\). Note that this is a vector dot-product, or inner-product, taken with a vector of input variables \(x_i\) and a vector of weights, \(\beta_i\). Together, the RHS of that equation defines an n-dimensional hyperplane. The model is linear in the parameters \(\beta_i\), e.g. these are OK:

\[ \color{black}{ \begin{cases} & y_i = \pmb\beta_0 + \pmb\beta_1x_1 + \pmb\beta_2x_1^2 + \epsilon_i\\ & y_1 = \pmb\beta_0 + \pmb\gamma_1\pmb\delta_1x_1 + exp(\pmb\beta_2)x_2+ \epsilon_i\\ \end{cases} } \]

but not, for example, these:

\[ \color{red}{ \begin{cases} & y_i = \pmb\beta_0 + \pmb\beta_1x_1^{\beta_2} + \epsilon_i\\ & y_i = \pmb\beta_0 + exp(\pmb\beta_1x_1) + \epsilon_i\\ \end{cases} } \]

There are three ways5 to include more predictors:

  • Backward Selection: We would typically start with a maximal model6 and progressively simplify the model by knocking off predictors that have the least impact on model accuracy.
  • Forward Selection: Start with no predictors and systematically add them one by one to increase the quality of the model
  • Mixed Selection: Wherein we start with no predictors and add them to gain improvement, or remove them at as their significance changes based on other predictors that have been added.

The first two are covered in the Section 1; Mixed Selection we will leave for a more advanced course. But for now we will first use just one predictor rm(Avg. no. of Rooms) to model housing prices.

Conclusions

We have seen how starting from a basic EDA of the data, we have been able to choose a single Quantitative predictor variable to model a Quantitative target variable, using Linear Regression. As stated earlier, we may have wish to use more than one predictor variables, to build more sophisticated models with improved prediction capability. And there is more than one way of selecting these predictor variables, which we will examine in the Tutorials.

Secondly, sometimes it may be necessary to mathematically transform the variables in the dataset to enable the construction of better models, something that was not needed here.

We may also encounter cases where the predictor variables seem to work together; one predictor may influence “how well” another predictor works, something called an interaction effect or a synergy effect. We might then have to modify our formula to include interaction terms that look like \(predictor1 \times predictor2\).

So our Linear Modelling workflow might look like this: we have not seen all stages yet, but that is for another course module or tutorial!


title: Our Linear Regression Workflow {
  near: top-center
  shape: text
  style: {
    font-size: 29
    bold: true
    underline: true
  }
}
  Data :  {
  style: {
    stroke: "#53C0D8"
    stroke-width: 5
    shadow: true
  }
}
  
  EDA : {
  style: {
    opacity: 0.6
    fill: red
    3d: true
    stroke: black
  }
}
Check Relationships; 
Build Model; 
Transform Variables {shape: cloud}; Try Multiple Regression\n and/or interaction effects {shape: cloud};
Check Model Diagnostics: {shape: diamond}
Check Model Diagnostics: {tooltip: Check R^2 }
Interpret Model
Apply Model {shape: oval}

    Data -> EDA : "inspect"
    Data -> EDA : "ggformula"
    Data -> EDA : "glimpse"
    Data -> EDA : "skim"
    EDA --> Check Relationships : "corrplot"
    EDA --> Check Relationships : "corrgram"
    EDA -> Check Relationships : "ggformula + purrr"
    EDA -> Check Relationships : "cor.test"
    Check Relationships --> Simple or\nComplex Model Decision
    Simple or\nComplex Model Decision -> Is the Model Possible?
    Is the Model Possible? -> Build Model
    Build Model -> Check Model Diagnostics
    Check Model Diagnostics -> Interpret Model : "All Good"
    Check Model Diagnostics -> Transform Variables : "Inadequate" {

          source-arrowhead.label: 1
          style.stroke: red
          target-arrowhead: {
          shape: diamond
          style.filled: true
          label: 1
          }
    }
    Check Model Diagnostics -> Try Multiple Regression\n and/or interaction effects : " Still Inadequate" {
          source-arrowhead.label: 2
          style.stroke: red
          target-arrowhead: {
          shape: diamond
          style.filled: true
          label: 2
          }
    }
    Transform Variables ->  Build Model {style.stroke: red }
     Try Multiple Regression\n and/or interaction effects ->  Build Model {style.stroke: red }
    Interpret Model -> Apply Model
    
  

References

  1. https://mlu-explain.github.io/linear-regression/
  2. The Boston Housing Dataset, corrected version. StatLib @ CMU, lib.stat.cmu.edu/datasets/boston_corrected.txt
  3. https://feliperego.github.io/blog/2015/10/23/Interpreting-Model-Output-In-R
  4. Andrew Gelman, Jennifer Hill, Aki Vehtari. Regression and Other Stories, Cambridge University Press, 2023.Available Online
  5. Michael Crawley.(2013). The R Book,second edition. Chapter 11.
  6. Gareth James, Daniela Witten, Trevor Hastie, Robert Tibshirani, Introduction to Statistical Learning, Springer, 2021. Chapter 3. https://www.statlearning.com/
  7. David C Howell, Permutation Tests for Factorial ANOVA Designs
  8. Marti Anderson, Permutation tests for univariate or multivariate analysis of variance and regression
  9. http://r-statistics.co/Assumptions-of-Linear-Regression.html
  10. Judd, Charles M., Gary H. McClelland, and Carey S. Ryan. 2017. “Introduction to Data Analysis.” In, 1–9. Routledge. https://doi.org/10.4324/9781315744131-1. Also see http://www.dataanalysisbook.com/index.html
  11. Patil, I. (2021). Visualizations with statistical details: The ‘ggstatsplot’ approach. Journal of Open Source Software, 6(61), 3167,https://doi:10.21105/joss.03167
R Package Citations
Package Version Citation
broom 1.0.10 Robinson, Hayes, and Couch (2025)
corrgram 1.14 Wright (2021)
corrplot 0.95 Wei and Simko (2024)
geomtextpath 0.2.0 Cameron and van den Brand (2025)
GGally 2.4.0 Schloerke et al. (2025)
ggstatsplot 0.13.3 Patil (2021)
ISLR 1.4 James et al. (2021)
janitor 2.2.1 Firke (2024)
lindia 0.10 Lee and Ventura (2023)
reghelper 1.1.2 Hughes and Beiner (2023)
supernova 3.0.0 Blake et al. (2024)
Blake, Adam, Jeff Chrabaszcz, Ji Son, and Jim Stigler. 2024. supernova: Judd, McClelland, & Ryan Formatting for ANOVA Output. https://doi.org/10.32614/CRAN.package.supernova.
Cameron, Allan, and Teun van den Brand. 2025. geomtextpath: Curved Text in ggplot2. https://doi.org/10.32614/CRAN.package.geomtextpath.
Firke, Sam. 2024. janitor: Simple Tools for Examining and Cleaning Dirty Data. https://doi.org/10.32614/CRAN.package.janitor.
Hughes, Jeffrey, and David Beiner. 2023. reghelper: Helper Functions for Regression Analysis. https://doi.org/10.32614/CRAN.package.reghelper.
James, Gareth, Daniela Witten, Trevor Hastie, and Rob Tibshirani. 2021. ISLR: Data for an Introduction to Statistical Learning with Applications in r. https://doi.org/10.32614/CRAN.package.ISLR.
Lee, Yeuk Yu, and Samuel Ventura. 2023. lindia: Automated Linear Regression Diagnostic. https://doi.org/10.32614/CRAN.package.lindia.
Patil, Indrajeet. 2021. Visualizations with statistical details: The ggstatsplot approach.” Journal of Open Source Software 6 (61): 3167. https://doi.org/10.21105/joss.03167.
Robinson, David, Alex Hayes, and Simon Couch. 2025. broom: Convert Statistical Objects into Tidy Tibbles. https://doi.org/10.32614/CRAN.package.broom.
Schloerke, Barret, Di Cook, Joseph Larmarange, Francois Briatte, Moritz Marbach, Edwin Thoen, Amos Elberg, and Jason Crowley. 2025. GGally: Extension to ggplot2. https://doi.org/10.32614/CRAN.package.GGally.
Wei, Taiyun, and Viliam Simko. 2024. R Package corrplot: Visualization of a Correlation Matrix. https://github.com/taiyun/corrplot.
Wright, Kevin. 2021. corrgram: Plot a Correlogram. https://doi.org/10.32614/CRAN.package.corrgram.