Code accompanying the BSc thesis:
Artūrs Jānis Ņikitins and Tatsiana Paulouskaya Stockholm School of Economics in Riga, 2023
This project studies how public emotion shaped private donations to Ukraine during the first year of Russia's full-scale invasion.
The analysis combines transaction-level donation data with measures of war intensity, social- and traditional-media activity, and emotions expressed in Twitter content. Donation behaviour is studied separately for Ukrainian, foreign-currency, and cryptocurrency donations, using both daily and intraday variation.
The empirical analysis includes seemingly unrelated regressions (SUR) of daily donation flows and event-based / difference-in-differences analyses of hourly donation responses around major war events and bilateral-aid announcements.
The repository contains code developed for the main stages of the project:
- collection and processing of fiat and cryptocurrency donation data;
- collection and processing of Twitter, news, conflict, casualty, air-raid, and aid-event data;
- storage and processing of the Twitter dataset using MongoDB;
- dictionary-based text analysis and transformer-based emotion classification;
- construction of daily and hourly analysis datasets;
- SUR and event-based / difference-in-differences estimation;
- descriptive statistics, figures, and LaTeX regression tables.
The project primarily uses R, with Python for transformer-based emotion classification and additional JavaScript, shell, MongoDB, and Docker tooling for parts of the data pipeline.
src/api/— data acquisition, processing, and construction of the combined research datasetssrc/db/— MongoDB setup and utilities used for the Twitter datasrc/sentiment/— tweet processing and emotion classificationsrc/models/— econometric analysis, including daily SUR and hourly event / DiD specificationssrc/plots/— code for selected figuressrc/latex/— LaTeX wrappers used for regression-output documents
This repository preserves the research code developed for the thesis substantially in its original form. It is provided as documentation of the empirical workflow rather than as a maintained software package or a replication archive.
The underlying research data are not distributed with the repository.
Several additional inputs were obtained from external APIs, public databases, web sources, and manually assembled event datasets. Some of the APIs and services used during the original 2022–2023 research period have since changed or may no longer be available in the same form.
Individual scripts may therefore depend on the original research environment, private data, or historical external services and should not be expected to execute end-to-end in a current environment.
For a full description of the data, methodology, variable definitions, and empirical results, see the accompanying thesis.
Nikitins, A. J. and Paulouskaya, T. (2023). Fuelling Hope: How Public Emotion Shapes Donations to Ukraine. Stockholm School of Economics in Riga.