top of page

Yujin Kim, PhD

The aim of this task is to predict the annual cooling degree days (CDDs) in the UK, using the R programming language [1] in RStudio [2]. A simple linear regression model was built to represent the relationship between the CDDs and annual count of hot summer days. A multiple linear regression model was also created to estimate the correlation between CDDs, hot summer days and latitudes. Same dataset from Section - ArcGIS was used for this task.

Prediction Using R Programming Language

R – Linear Regression Modelling

Aim

R Code

Fig. 1.1 displays code that I wrote to build linear regression models by referencing the R manuals [3].

# Estimate a coefficient for Hot_summer (an independent variable) and COOLING (a dependent variable).

# Build a simple linear regression model.
# Represent a summary of the model.

# Represent a Residual Standard Error (RSE).

# Plot the graph - simple linear regression model.

# R-squared value of the simple linear regression model.

# Estimate the coefficient of Latitude (an independent variable) and COOLING (the dependent variable).

# Build a multiple linear regression model using Hot_summer and Latitude (the independent variables), as well as COOLING (the dependent variable).

# Represent a Residual Standard Error (RSE).

# R-squared value of the multiple linear regression model.

Fig. 1.1. R code for linear regression models.

References

[1] The R Project for Statistical Computing,
https://www.r-project.org/.

[2] RStudio Desktop,
https://posit.co/download/rstudio-desktop/.

[3] The R Manual,
https://cran.r-project.org/manuals.html.

bottom of page