forked from datasci-harris/DAP2-final-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwriteup.Rmd
More file actions
138 lines (109 loc) · 6.79 KB
/
writeup.Rmd
File metadata and controls
138 lines (109 loc) · 6.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
title: "writeup"
author: "Rizka Nugrahaeni"
date: "`r Sys.Date()`"
output:
word_document: default
pdf_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## ### Write-up for Final Project: Exploring Financing and Climate Outcomes in Asia
#### **Research Question**
The primary aim of this research is to explore the relationship between financing commitments and their impact on renewable energy adoption and CO2 emissions in Asia. Key questions include:
- How do financing commitments influence renewable energy consumption?
- Is there a measurable relationship between financing and a country’s share of global CO2 emissions?
#### **Data and Methods**
##### **Data Sources**
1. **ADB Climate Change Financing Data (2020):** Provides details on financing commitments by country and sector.
2. **World Bank Data (2021):** Includes renewable energy consumption and CO2 emissions from the power industry.
3. **Worldometers (2021):** Offers global CO2 emission shares for each country, retrieved via web scraping.
#### Data Wrangling: Libraries and Functions Used
1. **Data Wrangling Libraries:**
- `tidyverse`: For data manipulation and visualization.
- `rvest`: For web scraping the CO2 emission data.
- `stringr`: For text cleaning and formatting.
- `httr`: For managing HTTP requests.
2. **Key Functions:**
- `read_csv()`: Import datasets from CSV files.
- `mutate()` and `select()`: Transform and extract relevant columns.
- `pivot_wider()` and `pivot_longer()`: Reshape datasets for analysis.
- `inner_join()` and `left_join()`: Merge datasets.
- `replace_na()`: Handle missing values.
- `html_node()` and `html_table()`: Extract and clean web-scraped tables.
- `str_to_title()` and `trimws()` to align country names across datasets..
##### **Analysis Approach**
1. **Data Visualization:** Created grouped bar plots and scatter plots to examine the relationship between financing, renewable energy adoption, CO2 emissions, and global emission shares.
2. **Regression Analysis:** Fitted linear models to evaluate the relationships:
- Financing commitments vs. renewable energy adoption.
- Financing commitments vs. CO2 emissions.
3. **Interactive Visualizations:** Developed two Shiny apps:
- A choropleth map for visualizing emission shares and financing commitments.
- A dynamic bar plot comparing financing, renewable energy, and emissions by country.
#### **Results**
##### **Static Figures**
1. **Bar Plots:**
- Countries with higher financing commitments (e.g., China and India) have significant renewable energy and CO2 emissions contributions, but the relationship isis inconsistent.
- The share of global emissions for smaller countries is often negligible, overshadowing their renewable energy progress.
- Grouped bar plots compare financing commitments, renewable energy consumption, and CO2 emissions.
2. **Scatter Plot (Financing vs. CO2 Emissions):**
- Scatter plots highlight relationships between financing and global CO2 emission shares.
- A weak correlation is observed, with outliers like China contributing disproportionately to global emissions despite large financing.
3. **Choropleth Map:**
- A geospatial map visualizes the share of global CO2 emissions, highlighting regional disparities.
- Visualizes regional disparities, emphasizing China's dominance in both financing and emissions contributions.
4. **Sentiment Analysis**
The project includes a sentiment analysis of an article from AsianInvestor.net about climate finance. Using the `tidytext` library, key positive and negative terms were identified, revealing public perceptions of climate finance.
- Positive sentiments in the article highlight themes like "support," "sustainable," and "innovative."
- Negative sentiments focus on risks and delays, indicating skepticism about the efficiency of climate finance mechanisms.
##### **Regression Analysis**
1. **Renewable Energy Model:**
\[
\text{Renewable Energy} = \beta_0 + \beta_1 \times \text{Total Financing} + \epsilon
\]
Where:
- \(\beta_0\): Intercept (base level of renewable energy with zero financing)
- \(\beta_1\): Effect of total financing on renewable energy consumption
- \(\epsilon\): Error term
2. **CO2 Emissions Model:**
\[
\text{CO2 Emissions} = \beta_0 + \beta_1 \times \text{Total Financing} + \epsilon
\]
Similarly, the coefficients \(\beta_0\) and \(\beta_1\) describe the relationship between financing and CO2 emissions.
### **Output**
Two linear models were developed:
1. **Renewable Energy Consumption:**
- Dependent Variable: Renewable energy consumption percentage.
- Independent Variable: Total financing commitments.
- Result: Weak positive relationship with limited explanatory power (Adjusted R²: 0.0059).
2. **CO2 Emissions:**
- Dependent Variable: CO2 emissions.
- Independent Variable: Total financing commitments.
- Result: Minimal relationship, suggesting the need for additional explanatory variables.
##### **Shiny Applications**
##### **Shiny App 1: Bar Plot Comparison**
- **How to Use:**
- **Variable Selection:** Users can select one or more variables (e.g., financing commitments, renewable energy consumption, share of global CO2 emissions) using checkboxes.
- **Country Filter:** A dropdown menu allows filtering by specific countries of interest.
- The results are displayed as a grouped bar plot, enabling direct comparisons across countries and variables.
##### **Shiny App 2: Choropleth Map**
- **How to Use:**
- **Variable Selection:** Users can toggle between viewing "Share of World Emissions (%)" and "Total Financing Commitments."
- **Opacity Slider:** Adjust the map's visual opacity to customize viewing preferences.
- Hover over a country to display detailed values for the selected variable.
#### **Challenges**
- **Data Limitations:**
- The dataset is limited to single-year observations, constraining trend analysis.
- Missing data for some countries required imputation or exclusion.
- **Explanatory Power:**
- The models show weak relationships, highlighting the need for additional explanatory variables (e.g., GDP, energy mix).
- **Web Scraping Challenges:**
- Differences in country names across datasets required manual correction.
#### **Conclusion and Next Steps**
- Financing commitments demonstrate a limited direct impact on renewable energy adoption and emissions reductions.
- The weak correlations underscore the importance of policy frameworks, technological advancements, and country-specific contexts in driving climate outcomes.
- Future research should:
- Expand the dataset to cover multiple years for a longitudinal analysis.
- Include additional variables like GDP, energy policy indices, and energy mix.
- Explore advanced modeling techniques to better capture country-specific effects.