The Dynamic Effects of Weather Shocks on Agricultural Production

Authors
Affiliations

Cédric Crofils

LEDa, Paris-Dauphine & PSL Universities

Ewen Gallic

Aix-Marseille School of Economics, Aix-Marseille Université

Gauthier Vermandel

CMAP, Ecole polytechnique, Institut Polytechnique de Paris

Published

July 16, 2024

Introduction

This ebook is the online supplementary materials for the article titled “The Dynamic Effects of Weather Shocks on Agricultural Production”.

The document is divided in five parts.

  1. The first part provides the codes for downloading the agricultural production data, weather data, and additional data such as map backgrounds (Chapters 1  Weather Data to 4  Other Data). It concludes with the formatting and presentation of the dataset used in the subsequent parts (Chapters 5  Merging the files and 6  Descriptive Statistics).
  2. The second part provides the codes for replicating the local projections (Chapters 7  The Dynamic Effects of Weather Shocks, 8  Quadratic Terms, and 9  Time-varying exposure to weather shocks), and the codes for replicating the results of the vector autoregressive model (Chapter 10  From Regional to Aggregate Fluctuations).
  3. The third part provides an analysis to examine the impacts of using quarterly data instead of monthly data in the local projections (Chapters 11  Merging: quarterly data and 13  Quarterly Agricultural Production (LP)).
  4. The fourth part provides a robustness check when using an alternative dataset for precipitation data, to study the response of agricultural production following a weather shock (Chapter 16  Agricultural Production (LP)) and aggregate fluctuations (Chapter 17  Aggregate Fluctuations).
  5. The fifth part considers alternative definitions of weather shocks, to account for positive vs. negative surprise shocks (Chapter 18  Agricultural Production: Positive vs. Negative Surprise Shocks (LP)). It also considers removing the last year from the data (Chapter 19  Agricultural Production (LP): without 2015 data).
Warning

The following ebook does not provide interpretations of the results. The interpretations are given in the article.

Estimation of the models only

The second, third and fourth parts, where we provide the scripts to run the estimations, can be evaluated without completing the first one, as the final dataset obtained at the end of the first part, dataset_2001_2015.rda, is provided in the data/output folder (see below).

Replication Codes

The codes presented in this ebook are available in the R folder. The functions that are sourced within those R scripts are defined the weatherperu/R folder (the weatherperu is our R package that helps us create and document the functions used to perform the analysis). This package does not need to be installed.

The following tree architecture is adopted:

Supplementary-materials
├ ── README.txt
├ ── Replication_book
├ ── R
│   └── data-weather.R
│   └── data-agriculture-calendar.R
│   └── data-agriculture.R
│   └── data-macro.R
│   └── data-other.R
│   └── data-merge.R
│   └── data-desc-stats.R
│   └── local_proj_linear.R
│   └── local_proj_quadratic.R
│   └── local_proj_seasonal.R
│   └── aggregate_fluctuations.R
│   └── robustness-data-merge-quarter.R
│   └── robustness-data-merge-annual.R
│   └── robustness-local_proj_linear_quarter.R
│   └── robustness-local_proj_linear_annual.R
│   └── robustness-local_proj_comparison.R
│   └── robustness-local_proj_linear_chirps.R
│   └── robustness-aggregate_fluctuations_chirps.R
│   └── robustness-local_proj_linear_surprise.R
│   └── robustness-local_proj_until_2014.R
├ ── data
│   └── output
|   |   └── dataset_2001_2015.rda
│   └── raw
├ ── weatherperu
│   └── R
  • Replication_book: folder that contains the codes to produce this ebook.
  • R: folder that contains the R scripts that allow to create the datasets and estimate the models.
  • data: folder that contains data (raw data in raw and processed data on output).
  • weatherperu: useful functions used in the R codes, made available as an R package (the functions are defined in the R subfolder).

Note that if you run the codes, the estimation results will be saved in the R/output/ folder.

Raw Data

To be able to reproduce the results from the article, we provide all the R codes. The user is kindly invited to download the raw data themselves.

The codes are divided in three parts. The first part contains the code used to obtain the dataset used in the estimations. The second part contains the codes that allow to estimate the local projections and the results obtained with the vector autoregressive model. The third part explores how are the results from the local projections impacted when using quarterly data instead of monthly data.

  1. Preparing the data

  2. Replication of the estimations

  3. Robustness checks: Data Frequency

    • robustness-data-merge-quarter.R: Merging the datasets to produce the one used in the local projections estimations using quarterly data (Chapter 11  Merging: quarterly data)
    • robustness-data-merge-annual.R: Merging the datasets to produce the one used in the local projections estimations using annual data (Chapter 12  Merging: annual data)
    • robustness-local_proj_linear_quarter.R: Agricultural production response to a weather shock (using Local Projections) with quarterly data (Chapter 13  Quarterly Agricultural Production (LP))
    • robustness-local_proj_linear_annual.R: Agricultural production response to a weather shock (using Local Projections) with annual data (Chapter 13  Quarterly Agricultural Production (LP))
    • robustness-local_projections-comparisons.R: Comparison of agricultural response to a weather shock (using Local Projections) according to the data frequency of the agricultural production.
  4. Robustness checks: CHIRPS Data

  5. Robustness Check: Other