Stima causale (controllo sintetico) dell'impatto di un'organizzazione sulla popolazione locale. Data una variabile che rappresenta il cambiamento nella popolazione locale, si stimano gli effetti per dati presenti nel dataset. Sono attualmente supportate le analisi su Comuni.
I requisiti si possono trovare in requirements.
pip install git+https://github.com/FluveFV/synthdid.py.git Il dataset principale è stato composto da IRVAPP, che ha estratto da ISTAT e da dati del Family Audit. Sono attualmente supportati i dati del Family Audit. Nella tabella seguente le principali informazioni sul dataset.
| Unità di analisi | Periodo storico | Luogo | Come è rappresentato | Variabili in uso |
|---|---|---|---|---|
| Comune | 1992-2022 | Provincia Autonoma di Trento | Dataset longitudinale |
|
Attualmente, è possibile ottenere stime causali separate sull'impatto delle azioni di un'organizzazione su due variabili: natalità e migrazione.
Il codice in StimaImpattoComuni.py è basato sul design del progetto di IRVAPP per la stima di effetti causali nella pianificazione Family Audit e Family in Trentino, ed è stato tradotto in Python da R utilizzando il metodo di stima synthetic difference in differences, controllo sintetico delle differenze. Per maggiori informazioni su come vengono prodotti i pesi e le stime si prega di leggere Synthetic Difference in Differences (Arkhangelsky et al., 2021, arXiv) e la sua implementazione in Python da synthdid.
Per tutte le organizzioni coinvolte:
- selezione di una organizzazione certificata e selezione di tutte le organizzazioni non certificate
- creazione del controllo sintetico tramite le organizzazioni non certificate
- salvataggio delle stime dell'organizzazione.
🚩Parallelizzazione del codice🚩
Su dati del Family Audit, su ogni Comune una CPU da portatile impiega attualmente circa sinthdid. La soluzione attualmente più efficace è quella di parallelizzare i calcoli. Cio è possibile perche la stima di impatto di un Comune certificato, in questo modello di valutazione, è indipendente da quella degli altri Comuni certificati.
Con un sistema CPU multi-core con processori Intel® Xeon® Gold 5215, 40 logical cores (velocità di orologio: da base
Dopo aver prodotto i risultati, il codice in AzioniImpattanti.py seleziona i dati con impatto positivo e statisticamente significativi, per
Esempio di grafico: divergenza post e pre trattamento con controllo sintentico per il Comune di Giustino. La linea verticale tratteggiata segna pre e post certificazione Family Audit.
Di seguito, le prime tre voci della tassonomia più impattanti sulle **nascite** per frequenza. La lista di Comuni è troncata per sintesi.| Voce della tassonomia | Frequenza | Comuni che ne hanno fatto uso |
|---|---|---|
| 30 | 129 | Giustino, Canal San Bovo, Bondone, ... |
| 29 | 81 | Castel Condino, Bocenago, Pieve Tesino ... |
| 132 | 79 | Canal San Bovo, Bondone, Castel Condino ... |
🇺🇸-🏴 ENGLISH
You can find them in requirements.
pip install git+https://github.com/FluveFV/synthdid.py.git The main dataset was built by IRVAPP, extracted from ISTAT and Family Audit data. Currenlty, only data from Family Audit is supported. In the following table, the main informations over the dataset:
| Unit of Analysis | Time period | Place | How it is represented | Variables in use |
|---|---|---|---|---|
| Municipality | 1992-2022 | Autonomous Province of Trento | Panel data |
|
Currently, it's possible to obtain causal estimates in a separate manner on the impact of an organization's actions over two variables: births and migration.
Code in StimaImpattoComuni.py is based on the project design from IRVAPP to estimate causal effects in the Family Audit planning and Family in Trentino, and it has been translated from R to Python using the estimate method synthetic difference in differences. For more information on how weights are produced and thus the effects please read Synthetic Difference in Differences (Arkhangelsky et al., 2021, arXiv) and its Python implementation synthdid.
For all participating (certified) organizations:
- the certified organization's data is selected and so is the data from organizations that are not certified.
- a synthetic control is created through all non certified organizations
- the estimates from the synthetic control is logged
🚩 Code parallelization 🚩
On Family Audit data, each Municipality on a laptop's CPU's process takes about synthdid library. The most efficient solution is to parallelize calculation on CPU. This is possible because the estimate of one certified Municipality, in this model of evaluation, is independent of the other certified Municipalities.
All computations were performed on a multi-core CPU system featuring an processor. The machine has 40 logical cores (2 sockets × 10 cores × 2 threads per core) with a base clock of 2.50 GHz and a turbo boost up to 3.40 GHz.
After having produced the results, the code in AzioniImpattanti.py selects the data with a positive impact that is statistically significant for
Graphic example: positive divergence between before and after treatment with synthetic control for the Municipality of Giustino. The vertical dotted line separates before and after the Family Audit certification - the treatment.
Following, the most common three voices of the taxonomy associated with high impact Municipalities on the births. The list of municipalities is truncated.| Taxonomy's ID | Frequency | Municipalities that used it |
|---|---|---|
| 30 | 129 | Giustino, Canal San Bovo, Bondone, ... |
| 29 | 81 | Castel Condino, Bocenago, Pieve Tesino ... |
| 132 | 79 | Canal San Bovo, Bondone, Castel Condino ... |