O'Reilly logo

Learning Bayesian Models with R by Dr. Hari M. Koduvely

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Regression of energy efficiency with building parameters

In this section, we will do a linear regression of the building's energy efficiency measure, heating load (Y1) as a function of the building parameters. It would be useful to do a preliminary descriptive analysis to find which building variables are statistically significant. For this, we will first create bivariate plots of Y1 and all the X variables. We will also compute the Spearman correlation between Y1 and all the X variables. The R script for performing these tasks is as follows:

>library(ggplot2) >library(gridExtra) >df <- read.csv("ENB2012_data.csv",header = T) >df <- df[,c(1:9)] >str(df) >df[,6] <- as.numeric(df[,6]) >df[,8] <- as.numeric(df[,8]) >attach(df) >bp1 <- ggplot(data ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required