Quantitative Economics With R: A Data Science Approach

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This book provides a contemporary treatment of quantitative economics, with a focus on data science. The book introduces the reader to R and RStudio, and uses expert Hadley Wickham’s tidyverse package for different parts of the data analysis workflow. After a gentle introduction to R code, the reader’s R skills are gradually honed, with the help of “your turn” exercises. At the heart of data science is data, and the book equips the reader to import and wrangle data, (including network data). Very early on, the reader will begin using the popular ggplot2 package for visualizing data, even making basic maps. The use of R in understanding functions, simulating difference equations, and carrying out matrix operations is also covered. The book uses Monte Carlo simulation to understand probability and statistical inference, and the bootstrap is introduced. Causal inference is illuminated using simulation, data graphs, and R code for applications with real economic examples, covering experiments, matching, regression discontinuity, difference-in-difference, and instrumental variables. The interplay of growth related data and models is presented, before the book introduces the reader to time series data analysis with graphs, simulation, and examples. Lastly, two computationally intensive methods—generalized additive models and random forests (an important and versatile machine learning method)—are introduced intuitively with applications. The book will be of great interest to economists—students, teachers, and researchers alike—who want to learn R. It will help economics students gain an intuitive appreciation of applied economics and enjoy engaging with the material actively, while also equipping them with key data science skills.

Author(s): Vikram Dayal
Edition: 1st Edition
Publisher: Springer
Year: 2020

Language: English
Pages: XV, 326
Tags: Game Theory, Economics, Social And Behav. Sciences, Quantitative Economics

Acknowledgements......Page 6
Contents......Page 7
About the Author......Page 13
Part I Introduction to the Book and the Data Software......Page 14
1.1 A Data Science Approach......Page 15
1.2.3 Part 3: Mathematical Preliminaries for Data Analysis......Page 16
1.2.7 Part 7: Introduction to Statistical/Machine Learning from Data......Page 17
1.6 An Overview of Typical R Code......Page 18
1.7 Resources......Page 20
2.2 R and RStudio......Page 21
2.4 Use a Script......Page 22
2.5.1 Vectors......Page 23
2.5.2 Matrices......Page 25
2.5.4 Lists......Page 26
2.6 Toy Example: Net Present Value......Page 27
2.7.1 Data Analysis Workflow......Page 28
2.7.3 Input and Wrangle Synthetic Data......Page 29
2.7.4 Five Data Verbs......Page 32
2.7.5 Graphs......Page 35
2.7.6 Linear Model......Page 36
2.8 Resources......Page 38
Part II Managing and Graphing Data......Page 40
3.2 Data in R or a Package......Page 41
3.3 Data in a csv File......Page 43
3.4 Data in a Stata File......Page 44
3.5 Data from the World Development Indicators......Page 45
3.6 Resources......Page 46
4.2 Example: Anscombe's Synthetic Data......Page 47
4.3 Example: Carbon and Livelihoods Data......Page 50
4.4.1 Getting the Data......Page 56
4.4.2 Graphing the Data......Page 58
4.4.3 Mapping the Data......Page 61
4.5 Resources......Page 64
5.2 Simple Example with Synthetic Data......Page 70
5.3 Example: Medici Network......Page 75
5.4 Example: Bali Terrorist Network......Page 77
5.5 Simulating Network Formation......Page 79
5.6 Example: Electrical Automotive Goods Production Network......Page 82
5.7 Resources......Page 87
Part III Mathematical Preliminaries for Data Analysis......Page 90
6.2 Making Your Own Functions in R......Page 91
6.3 Plotting Functions with the Curve Function......Page 92
6.4 Statistical Loss Functions......Page 93
6.5 Supply and Demand......Page 94
6.6 Cobb–Douglas Production Function......Page 95
6.7 Resources......Page 99
7.2 Simple Toy Example......Page 101
7.3 Example: Global Carbon Stocks......Page 102
7.4.1 Numerical Simulation......Page 104
7.4.2 Example: North Sea Herring......Page 106
7.5.1 Commodity Residual Transformation Function......Page 109
7.5.2 Stock Pollutant......Page 110
7.5.3 Firm's Choice of Commodity Q Given a Tax on Waste S......Page 111
7.5.4 What Is the Optimal Tax?......Page 112
7.6 Resources......Page 113
8.2 Simple Statistics with Vectors......Page 117
8.3 Matrix Operations......Page 119
8.4 Example: Poverty Rate and Relative Income......Page 120
8.5 Resources......Page 123
Part IV Inference from Data......Page 124
9.2.1 Sample......Page 125
9.2.2 Binomial Distribution......Page 127
9.2.3 Function for Binomial Distribution......Page 130
9.3 Sampling Distribution......Page 131
9.3.1 Six-Sided Dice Simulation......Page 132
9.3.2 Function for Sampling Distribution......Page 135
9.3.3 Sampling Distribution for the T-Statistic......Page 136
9.3.4 Inference from One Sample......Page 138
9.3.5 Confidence Intervals......Page 139
9.4 Bootstrap......Page 142
9.4.1 Function to Understand Bootstrap......Page 145
9.5 Permutation Tests......Page 147
9.6 Example: Verizon......Page 151
9.6.1 Permutation Test......Page 153
9.6.2 Bootstrapping Confidence Intervals......Page 154
9.7 Cautionary Example with Synthetic Data......Page 156
9.8 Resources......Page 157
10.2 Causal Graphs and Potential Outcomes......Page 158
10.2.1 Simple Example with Synthetic Data......Page 159
10.2.2 Randomized Assignment of Treatment (Causal Graphs)......Page 161
10.2.3 Randomized Assignment of Treatment (Potential Outcomes)......Page 162
10.2.4 Covariate Adjustment......Page 165
10.2.5 Selecting Regressors by Statistical Significance......Page 168
10.3.1 Example: Anchoring......Page 170
10.3.2 Example: Women as Policymakers......Page 174
10.3.3 Example: Educational Programme......Page 177
10.3.4 Example: Star......Page 180
10.4 Matching......Page 183
10.4.1 Simple Example with Synthetic Data......Page 184
10.4.2 Example: Labour Training Programme......Page 188
10.4.3 Sensitivity Analysis......Page 192
10.4.4 Example: Lead Exposure......Page 195
10.4.5 Example: Compensation for Injury......Page 197
10.5.1 Simple Example with Synthetic Data......Page 202
10.5.2 Example: Minimum Legal Drinking Age (MLDA)......Page 203
10.6.1 Example: Scrap Rate and Training......Page 207
10.6.2 Simulation......Page 208
10.6.3 Example: Banks in Business......Page 211
10.7 Example: Manski Bounds for Crime and Laws......Page 213
10.7.1 Bounds with Maryland as Counterfactual......Page 215
10.7.2 Bounds Based on Difference-in-Difference......Page 217
10.8.1 Simulation......Page 220
10.8.2 Example: Demand for Cigarettes......Page 223
10.9 Resources......Page 227
Part V Accessing, Analysing and Interpreting Growth Data......Page 229
11.2 Example: Growth......Page 230
11.3 Example: Production Model and Crosscountry Data......Page 233
11.4 Solow Model Simulation......Page 235
11.5 Romer Model Simulation......Page 238
11.6 Example: Growth in Recent Decades......Page 239
11.7 Resources......Page 246
12.1 Introduction (Institutions and Growth Example)......Page 248
12.2 Geography and Growth......Page 252
12.3 Exclusion Restriction Simulation......Page 255
12.5 Resources......Page 257
Part VI Time Series Data......Page 259
13.2 Simple Example with Synthetic Data......Page 260
13.3 Example: Air Passengers......Page 261
13.4 Example: Stock Market Volatility......Page 262
13.5 Example: Inflation and Unemployment......Page 264
13.6 Example: Historical Unemployment Data......Page 267
13.7 Resources......Page 270
14.2.1 White Noise......Page 273
14.2.2 Autoregressive Model......Page 277
14.2.3 Random Walk......Page 280
14.2.4 Moving Average......Page 281
14.2.5 Autoregressive Moving Average......Page 282
14.3 Example: Forecasting Inflation......Page 285
14.4.1 Simulating Spurious Regression......Page 292
14.4.2 Simulating Cointegration......Page 293
14.4.3 Example: Federal Funds and Bond Rate......Page 296
14.5 Example: Dynamic Causal Effects of Weather......Page 298
14.6 Resources......Page 299
Part VII Introduction to Statistical/Machine Learning from Data......Page 302
15.2 Simple Example with Synthetic Data......Page 303
15.3 Example: GAMS with Wages Data......Page 305
15.4 Example: Housing in Texas......Page 308
15.5 Resources......Page 311
16.2 Simple Tree Example with Synthetic Data......Page 312
16.3 Example: Arsenic in Wells in Bangladesh......Page 315
16.4 Example: Home Mortgage Disclosure Act......Page 319
16.5 Resources......Page 323