The Energy Benchmarking Law requires the County to make annually reported energy benchmarking information readily available to the public. This dataset reflects data received by the publish date. The dataset contains information from 1430 properties in montgomery county such as natural gas usage, total greenhouse gas emission and electricity usage, as well as building square footage, building type (office, performing center, library, etc.), and location in lat/long format. Some questions I would like to analyze are: Which, and what kind of property generates the most greenhouse gasses? Which, and what kind of property uses the most electricity? Is the size of a building statistically related to the amount of greenhouse gas emitted? Is the amount of natural gas used statistically significant to the amount of greenhouse gas emitted? I will explore the answers to these questions using the “Electricity (kWh)”, “Total GHG Emissions (Metric Tons CO2e)”, and “Natural Gas (therms)” columns for the energy usage totals, and the “Primary Property Type - Self Selected” column for specifying property type. I will also use the “Lat/Long” column to create a map to find where the majority of the documented greenhouse gas emissions are coming from. There is no available information on how the data was collected.
Reducing greenhouse gas emissions and energy use in Montgomery County is an important step toward slowing climate change. Climate change is responsible for extreme weather catastrophes and increase in ocean temperatures. In addition to benefits to the climate, reducing GHG and energy use will also reduce the pollutants in the air. Polluted air is a public health crisis, causing respiratory illnesses and heart disease.
library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.1.4 ✔ readr 2.1.5
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ ggplot2 3.4.4 ✔ tibble 3.2.1
✔ lubridate 1.9.3 ✔ tidyr 1.3.0
✔ purrr 1.0.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(plotly)
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
Rows: 1430 Columns: 28
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (10): Benchmarking Group, Building Name, Montgomery County Building ID, ...
dbl (18): ESPM Property ID, Year Ending, Zip, Year Built, Number of Building...
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
NGEGH <-na.omit(NGEGH)#dataset contained massive amounts of NAs
#Which properties in Montgomery County use the most electricity?MostE <- NGEGH %>%arrange(desc(`Electricity (kWh)`)) %>%slice(1:10)MostE
# A tibble: 10 × 28
`Benchmarking Group` `ESPM Property ID` `Building Name`
<chr> <dbl> <chr>
1 Group 1 1255207 holy cross silver spring-hosp
2 Group 1 4995054 ahc rockville campus
3 Group 2 2641857 silver spring data center
4 Group 2 5831944 montgomery medical center
5 Group 1 12420327 suburban hospital-hospital (general …
6 Group 1 3353569 5600 fishers lane
7 Group 1 3542164 adventist healthcare takoma park
8 Group 1 15043663 white oak medical center
9 Group 1 1190558 7501 wisconsin ave.
10 Group 2 4306718 plaza corporate headquarters
# ℹ 25 more variables: `Montgomery County Building ID` <chr>,
# `Year Ending` <dbl>, `Benchmarking Report Status` <chr>, Address <chr>,
# City <chr>, State <chr>, Zip <dbl>, `Year Built` <dbl>,
# `Number of Buildings` <dbl>, `Primary Property Type - Self Selected` <chr>,
# `Primary Property Type - EPA Calculated` <chr>,
# `Reported Property Gross Floor Area` <dbl>, `ENERGY STAR Score` <dbl>,
# `Electricity (kWh)` <dbl>, …
#Which properties use the most natural gasMostNG <- NGEGH %>%arrange(desc(`Natural Gas (therms)`)) %>%slice(1:10)MostNG
# A tibble: 10 × 28
`Benchmarking Group` `ESPM Property ID` `Building Name`
<chr> <dbl> <chr>
1 Group 1 12420327 suburban hospital-hospital (general …
2 Group 1 4995054 ahc rockville campus
3 Group 1 1255207 holy cross silver spring-hosp
4 County 5244855 public safety headquarters
5 Group 1 15043663 white oak medical center
6 Group 2 5831944 montgomery medical center
7 Group 1 4964473 holy cross germantown-hospital
8 Group 1 3542164 adventist healthcare takoma park
9 Group 2 5903493 the united states pharmacopeial conv…
10 Group 2 4306718 plaza corporate headquarters
# ℹ 25 more variables: `Montgomery County Building ID` <chr>,
# `Year Ending` <dbl>, `Benchmarking Report Status` <chr>, Address <chr>,
# City <chr>, State <chr>, Zip <dbl>, `Year Built` <dbl>,
# `Number of Buildings` <dbl>, `Primary Property Type - Self Selected` <chr>,
# `Primary Property Type - EPA Calculated` <chr>,
# `Reported Property Gross Floor Area` <dbl>, `ENERGY STAR Score` <dbl>,
# `Electricity (kWh)` <dbl>, …
#Which properties generate the most greenhouse gasses?MostGH <- NGEGH %>%arrange(desc(`Total GHG Emissions (Metric Tons CO2e)`)) %>%slice(1:10)MostGH
# A tibble: 10 × 28
`Benchmarking Group` `ESPM Property ID` `Building Name`
<chr> <dbl> <chr>
1 Group 1 1255207 holy cross silver spring-hosp
2 Group 1 4995054 ahc rockville campus
3 Group 1 12420327 suburban hospital-hospital (general …
4 Group 2 5831944 montgomery medical center
5 Group 1 15043663 white oak medical center
6 Group 1 4964473 holy cross germantown-hospital
7 Group 1 3542164 adventist healthcare takoma park
8 County 5244855 public safety headquarters
9 Group 2 4306718 plaza corporate headquarters
10 Group 2 5903493 the united states pharmacopeial conv…
# ℹ 25 more variables: `Montgomery County Building ID` <chr>,
# `Year Ending` <dbl>, `Benchmarking Report Status` <chr>, Address <chr>,
# City <chr>, State <chr>, Zip <dbl>, `Year Built` <dbl>,
# `Number of Buildings` <dbl>, `Primary Property Type - Self Selected` <chr>,
# `Primary Property Type - EPA Calculated` <chr>,
# `Reported Property Gross Floor Area` <dbl>, `ENERGY STAR Score` <dbl>,
# `Electricity (kWh)` <dbl>, …
#We can see that the property types that use the most energy of any type across the board are hospitals, offices, and data centers.NGEGHtop <- NGEGH %>%filter(`Primary Property Type - Self Selected`%in%c("Hospital (General Medical & Surgical)", "Office", "Data Center"))
“Combustion of natural gas and petroleum products for heating and cooking emits carbon dioxide (CO2), methane (CH4), and nitrous oxide (N2O). Emissions from natural gas consumption represent 78% of the direct fossil fuel CO2 emissions from the residential and commercial sector in 2022.” (source: https://www.epa.gov/)
NGEGHtop$`Primary Property Type - Self Selected`<-as.factor(NGEGHtop$`Primary Property Type - Self Selected`)property_colors <-c("blue","purple","yellow")ggplot(NGEGHtop) +aes(x =`Primary Property Type - Self Selected`, y =`Total GHG Emissions (Metric Tons CO2e)`) +geom_boxplot(color = property_colors) +labs(x ="Property Type", y ="Total Greenhouse Gas Emmissions (Metric Tons)", title ="GHG Emissions by Property", caption ="Source: https://data.montgomerycountymd.gov/") +theme_bw()
From this boxplot we can conclude that there is only one data center property, outputting near 5000 metric tons of CO2e. This is more than almost all office buildings, having a mean output near 1000 tons, and many outliers ranging from 2000 to 5000 tons. Ultimately, hospitals still output more greenhouse gasses with a mean of around 8000 metric tons, with the most common values falling between 6500 and 12500 tons.
options(scipen =999)gg <-ggplot(NGEGHtop) +aes(x =`Reported Property Gross Floor Area`, y =`Total GHG Emissions (Metric Tons CO2e)`, color =`Primary Property Type - Self Selected`, text =paste("Building Name:", `Building Name`, "<br>","Gross Floor Area:", `Reported Property Gross Floor Area`, "sqft<br>","Total GHG Emissions:", `Total GHG Emissions (Metric Tons CO2e)`, "Metric Tons<br>","Property Type:", `Primary Property Type - Self Selected`)) +geom_point() +scale_color_manual(values = property_colors) +labs(x ="Gross Floor Area (sqft)", y ="Total GHG Emissions (Metric Tons)", title ="Greenhouse Gas Emission by Property Square Footage", caption ="Source: https://data.montgomerycountymd.gov/") +theme_bw()ggplotly(gg, tooltip ="text")
This scatterplot describes the relationship between greenhouse gas emissions (metric tons), and the overall square footage of the property. This plot shows that the singular data center shown in the previous boxplot outputs more greenhouse gasses than almost all offices, and that hospitals emit more greenhouse gasses than an office of similar size. This plot mainly shows that as the area of the buildings on the property increase, greenhouse gas emissions will increase nearly linearly.
NGEGHtop2 <- NGEGHtop %>%filter(`Primary Property Type - Self Selected`%in%c("Hospital (General Medical & Surgical)", "Office"))ggplot(NGEGHtop2) +aes(x =`Natural Gas (therms)`, y =`Total GHG Emissions (Metric Tons CO2e)`, size =`Reported Property Gross Floor Area`) +geom_point() +labs(x ="Total Natural Gas Usage (Therms)", y ="Total GHG Emissions (Metric Tons)", title ="Does Natural Gas Use Effect Greenhouse Gas Emission?", caption ="Size of plotted points represent property area (sqft) Source: https://data.montgomerycountymd.gov/") +theme_bw() +facet_wrap(~`Primary Property Type - Self Selected`, scales ="free") +guides(size = F)
Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
of ggplot2 3.3.4.
This faceted plot shows how natural gas usage could be effecting greenhouse gas emissions, as well as the square footage of buildings on the plotted properties. the relation between natural gas use and GHG emissions seems to be relatively close to linear. Many office buildings do not use natural gas, but still output anywhere from 0 to 3800 tons of greenhouse gas. The relation between size and GHG emission is inconclusive on this graph, with a relatively smaller office space outputting nearly 5500 tons of GHG and using nearly 875,000 therms of natural gas. (One therm is equal to 100 cubic feet of natural gas at standard temperature and pressure.)
#Bonus map just for funNGEGHtopL <- NGEGHtop %>%separate(`Lat/Long`, into =c("point", "long"), sep =" \\(|\\)", remove =FALSE) %>%separate(long, into =c("lat", "long"), sep =" ", remove =TRUE)
lm <-lm(`Total GHG Emissions (Metric Tons CO2e)`~`Natural Gas (therms)`+`Reported Property Gross Floor Area`, data = NGEGH)summary(lm)
Call:
lm(formula = `Total GHG Emissions (Metric Tons CO2e)` ~ `Natural Gas (therms)` +
`Reported Property Gross Floor Area`, data = NGEGH)
Residuals:
Min 1Q Median 3Q Max
-3286.0 -213.2 -65.9 116.1 4346.4
Coefficients:
Estimate Std. Error t value
(Intercept) 142.6991861 42.7165303 3.341
`Natural Gas (therms)` 0.0083583 0.0002289 36.523
`Reported Property Gross Floor Area` 0.0034240 0.0002253 15.201
Pr(>|t|)
(Intercept) 0.000925 ***
`Natural Gas (therms)` < 0.0000000000000002 ***
`Reported Property Gross Floor Area` < 0.0000000000000002 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 523.7 on 353 degrees of freedom
Multiple R-squared: 0.8912, Adjusted R-squared: 0.8905
F-statistic: 1445 on 2 and 353 DF, p-value: < 0.00000000000000022
Total GHG Emissions (Metric Tons CO2e) = 142.699 + 0.00836 × Natural Gas (therms) + 0.00342 × Reported Property Gross Floor Area
The p-values for the coefficients are highly significant (< 0.001), indicating that both “Natural Gas (therms)” and “Reported Property Gross Floor Area” have a significant impact on predicting GHG emissions. The adjusted R^2 value of 0.8905 suggests that around 89.05% of the variability in GHG emissions can be explained by the natural gas usage and property size. This indicates a strong fit of the model to the data. Overall, the model suggests that both “Natural Gas (therms)” and “Reported Property Gross Floor Area” are important predictors of GHG emissions in the dataset.
plot(NGEGH$`Natural Gas (therms)`, NGEGH$`Total GHG Emissions (Metric Tons CO2e)`, xlab ="Natural Gas (therms)", ylab ="Total GHG Emissions (Metric Tons CO2e)",main ="GHG Emissions by Natural Gas Usage with Linear Regression Line") +abline(lm, col ="red")
Warning in abline(lm, col = "red"): only using the first two of 3 regression
coefficients