Update README.md
Browse files
README.md
CHANGED
|
@@ -1,143 +1,238 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
- name: lname
|
| 17 |
-
dtype: string
|
| 18 |
-
- name: ffname
|
| 19 |
-
dtype: string
|
| 20 |
-
- name: fname
|
| 21 |
-
dtype: string
|
| 22 |
-
- name: mname
|
| 23 |
-
dtype: string
|
| 24 |
-
- name: title
|
| 25 |
-
dtype: string
|
| 26 |
-
- name: suffix
|
| 27 |
-
dtype: string
|
| 28 |
-
- name: party
|
| 29 |
-
dtype: string
|
| 30 |
-
- name: state
|
| 31 |
-
dtype: string
|
| 32 |
-
- name: seat
|
| 33 |
-
dtype: string
|
| 34 |
-
- name: district
|
| 35 |
-
dtype: string
|
| 36 |
-
- name: distcyc
|
| 37 |
-
dtype: string
|
| 38 |
-
- name: ico.status
|
| 39 |
-
dtype: string
|
| 40 |
-
- name: cand.gender
|
| 41 |
-
dtype: string
|
| 42 |
-
- name: recipient.cfscore
|
| 43 |
-
dtype: float64
|
| 44 |
-
- name: recipient.cfscore.dyn
|
| 45 |
-
dtype: float64
|
| 46 |
-
- name: contributor.cfscore
|
| 47 |
-
dtype: float64
|
| 48 |
-
- name: dwdime
|
| 49 |
-
dtype: float64
|
| 50 |
-
- name: dwnom1
|
| 51 |
-
dtype: float64
|
| 52 |
-
- name: dwnom2
|
| 53 |
-
dtype: float64
|
| 54 |
-
- name: ps.dwnom1
|
| 55 |
-
dtype: float64
|
| 56 |
-
- name: ps.dwnom2
|
| 57 |
-
dtype: float64
|
| 58 |
-
- name: irt.cfscore
|
| 59 |
-
dtype: float64
|
| 60 |
-
- name: composite.score
|
| 61 |
-
dtype: float64
|
| 62 |
-
- name: num.givers
|
| 63 |
-
dtype: int64
|
| 64 |
-
- name: num.givers.total
|
| 65 |
-
dtype: int64
|
| 66 |
-
- name: total.receipts
|
| 67 |
-
dtype: float64
|
| 68 |
-
- name: total.disbursements
|
| 69 |
-
dtype: float64
|
| 70 |
-
- name: total.indiv.contribs
|
| 71 |
-
dtype: float64
|
| 72 |
-
- name: total.unitemized
|
| 73 |
-
dtype: float64
|
| 74 |
-
- name: total.pac.contribs
|
| 75 |
-
dtype: float64
|
| 76 |
-
- name: total.party.contribs
|
| 77 |
-
dtype: float64
|
| 78 |
-
- name: total.contribs.from.candidate
|
| 79 |
-
dtype: float64
|
| 80 |
-
- name: ind.exp.support
|
| 81 |
-
dtype: float64
|
| 82 |
-
- name: ind.exp.oppose
|
| 83 |
-
dtype: float64
|
| 84 |
-
- name: prim.vote.pct
|
| 85 |
-
dtype: float64
|
| 86 |
-
- name: pwinner
|
| 87 |
-
dtype: string
|
| 88 |
-
- name: gen.vote.pct
|
| 89 |
-
dtype: float64
|
| 90 |
-
- name: gwinner
|
| 91 |
-
dtype: string
|
| 92 |
-
- name: s.elec.stat
|
| 93 |
-
dtype: string
|
| 94 |
-
- name: r.elec.stat
|
| 95 |
-
dtype: string
|
| 96 |
-
- name: district.pres.vs
|
| 97 |
-
dtype: float64
|
| 98 |
-
- name: fec.cand.status
|
| 99 |
-
dtype: string
|
| 100 |
-
- name: recipient.type
|
| 101 |
-
dtype: string
|
| 102 |
-
- name: igcat
|
| 103 |
-
dtype: string
|
| 104 |
-
- name: comtype
|
| 105 |
-
dtype: string
|
| 106 |
-
- name: ICPSR
|
| 107 |
-
dtype: string
|
| 108 |
-
- name: ICPSR2
|
| 109 |
-
dtype: string
|
| 110 |
-
- name: Cand.ID
|
| 111 |
-
dtype: string
|
| 112 |
-
- name: FEC.ID
|
| 113 |
-
dtype: string
|
| 114 |
-
- name: NID
|
| 115 |
-
dtype: string
|
| 116 |
-
- name: before.switch.ICPSR
|
| 117 |
-
dtype: float64
|
| 118 |
-
- name: after.switch.ICPSR
|
| 119 |
-
dtype: float64
|
| 120 |
-
- name: party.orig
|
| 121 |
-
dtype: string
|
| 122 |
-
- name: nimsp.party
|
| 123 |
-
dtype: string
|
| 124 |
-
- name: nimsp.candidate.ICO.code
|
| 125 |
-
dtype: string
|
| 126 |
-
- name: nimsp.district
|
| 127 |
-
dtype: string
|
| 128 |
-
- name: nimsp.office
|
| 129 |
-
dtype: string
|
| 130 |
-
- name: nimsp.candidate.status
|
| 131 |
-
dtype: string
|
| 132 |
-
splits:
|
| 133 |
-
- name: train
|
| 134 |
-
num_bytes: 245924928
|
| 135 |
-
num_examples: 479502
|
| 136 |
-
download_size: 53812799
|
| 137 |
-
dataset_size: 245924928
|
| 138 |
-
configs:
|
| 139 |
-
- config_name: default
|
| 140 |
-
data_files:
|
| 141 |
-
- split: train
|
| 142 |
-
path: data/train-*
|
| 143 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: other
|
| 3 |
+
task_categories:
|
| 4 |
+
- tabular-classification
|
| 5 |
+
- tabular-regression
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- political-science
|
| 10 |
+
- campaign-finance
|
| 11 |
+
- ideology-scores
|
| 12 |
+
- elections
|
| 13 |
+
- united-states
|
| 14 |
+
size_categories:
|
| 15 |
+
- 100K<n<1M
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
+
|
| 18 |
+
# DIME Recipients Database with Campaign Finance Ideology Scores
|
| 19 |
+
|
| 20 |
+
## Dataset Description
|
| 21 |
+
|
| 22 |
+
This dataset contains comprehensive information about political recipients (candidates and committees) in the United States from 1980-2024, including their campaign finance-based ideology scores from the Database on Ideology, Money in Politics, and Elections (DIME).
|
| 23 |
+
|
| 24 |
+
### Key Features
|
| 25 |
+
|
| 26 |
+
- **479,502 recipients** across 1980-2024
|
| 27 |
+
- **Campaign Finance (CF) ideology scores** for ideological positioning
|
| 28 |
+
- **Multiple office levels**: Federal (House, Senate), State, Local
|
| 29 |
+
- **Party affiliations** with cleaned coding
|
| 30 |
+
- **Financial data**: Receipts, contributions, expenditures
|
| 31 |
+
|
| 32 |
+
## Dataset Source
|
| 33 |
+
|
| 34 |
+
- **Original Source**: Stanford University - Adam Bonica
|
| 35 |
+
- **Website**: https://data.stanford.edu/dime
|
| 36 |
+
- **Primary Citation**: Bonica, Adam. 2014. "Mapping the Ideological Marketplace." American Journal of Political Science 58(2): 367-386.
|
| 37 |
+
|
| 38 |
+
## Dataset Structure
|
| 39 |
+
|
| 40 |
+
### Basic Statistics
|
| 41 |
+
|
| 42 |
+
- **Total Records**: 479,502
|
| 43 |
+
- **Unique Recipients**: 216,371
|
| 44 |
+
- **Time Coverage**: 1980-2024
|
| 45 |
+
- **Total Receipts**: $1,114,933,155,977
|
| 46 |
+
- **Individual Contributions**: $573,053,829,718
|
| 47 |
+
|
| 48 |
+
### Key Columns
|
| 49 |
+
|
| 50 |
+
#### Identifiers
|
| 51 |
+
- `bonica.rid`: Unique recipient identifier (primary key)
|
| 52 |
+
- `name`: Recipient name (candidate or committee)
|
| 53 |
+
- `bonica.cid`: Contributor identifier (for matching with contributions)
|
| 54 |
+
|
| 55 |
+
#### Political Information
|
| 56 |
+
- `party`: Party code (100=Democrat, 200=Republican, 328=Independent)
|
| 57 |
+
- `recipient.cfscore`: **Campaign Finance ideology score** (-2 to +2, negative=liberal, positive=conservative)
|
| 58 |
+
- `nimsp.office`: Office sought (house, senate, state:lower, local:council, etc.)
|
| 59 |
+
- `state`: State abbreviation
|
| 60 |
+
- `district`: Congressional district (for House candidates)
|
| 61 |
+
|
| 62 |
+
#### Financial Data
|
| 63 |
+
- `total.receipts`: Total money raised
|
| 64 |
+
- `total.indiv.contribs`: Individual contribution amounts
|
| 65 |
+
- `total.pac.contribs`: PAC contribution amounts
|
| 66 |
+
- `num.givers`: Number of contributors
|
| 67 |
+
|
| 68 |
+
#### Additional Scores
|
| 69 |
+
- `recipient.cfscore.dyn`: Dynamic CF score (time-varying)
|
| 70 |
+
- `dwnom1`: DW-NOMINATE score (for legislators)
|
| 71 |
+
- `composite.score`: Composite ideology measure
|
| 72 |
+
|
| 73 |
+
### Data Distribution
|
| 74 |
+
|
| 75 |
+
#### Party Distribution
|
| 76 |
+
- I: 173,888 (36.3%)
|
| 77 |
+
- D: 154,373 (32.2%)
|
| 78 |
+
- R: 149,643 (31.2%)
|
| 79 |
+
- O: 1,036 (0.2%)
|
| 80 |
+
- L: 226 (0.0%)
|
| 81 |
+
|
| 82 |
+
#### Office Distribution
|
| 83 |
+
- : 169,451
|
| 84 |
+
- house: 115,899
|
| 85 |
+
- senate: 42,089
|
| 86 |
+
- local:other: 16,436
|
| 87 |
+
- local:council: 15,877
|
| 88 |
+
|
| 89 |
+
#### CF Score Distribution
|
| 90 |
+
- **Mean**: 0.171
|
| 91 |
+
- **Std Dev**: 1.020
|
| 92 |
+
- **Range**: -6.864 to 6.714
|
| 93 |
+
- **Median**: 0.074
|
| 94 |
+
|
| 95 |
+
## Usage Examples
|
| 96 |
+
|
| 97 |
+
### Basic Loading
|
| 98 |
+
|
| 99 |
+
```python
|
| 100 |
+
from datasets import load_dataset
|
| 101 |
+
import pandas as pd
|
| 102 |
+
|
| 103 |
+
# Load full dataset
|
| 104 |
+
dataset = load_dataset("mliliu/dime-recipients")
|
| 105 |
+
df = dataset['train'].to_pandas()
|
| 106 |
+
|
| 107 |
+
print(f"Dataset shape: {df.shape}")
|
| 108 |
+
print(f"CF scores available: {df['recipient.cfscore'].notna().sum():,}")
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
### Filtering Examples
|
| 112 |
+
|
| 113 |
+
```python
|
| 114 |
+
# Recent federal candidates only
|
| 115 |
+
federal_recent = df[
|
| 116 |
+
(df['cycle'] >= 2016) &
|
| 117 |
+
(df['nimsp.office'].isin(['house', 'senate'])) &
|
| 118 |
+
(df['recipient.type'] == 'cand')
|
| 119 |
+
]
|
| 120 |
+
|
| 121 |
+
# Major party candidates with CF scores
|
| 122 |
+
major_parties = df[
|
| 123 |
+
df['party'].isin(['100', '200']) & # Dem/Rep
|
| 124 |
+
df['recipient.cfscore'].notna()
|
| 125 |
+
]
|
| 126 |
+
|
| 127 |
+
# Senate candidates by ideology
|
| 128 |
+
senate_liberal = df[
|
| 129 |
+
(df['nimsp.office'] == 'senate') &
|
| 130 |
+
(df['recipient.cfscore'] < -0.5)
|
| 131 |
+
]
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
### Ideology Analysis
|
| 135 |
+
|
| 136 |
+
```python
|
| 137 |
+
import matplotlib.pyplot as plt
|
| 138 |
+
|
| 139 |
+
# Plot ideology distribution by party
|
| 140 |
+
dem_scores = df[df['party'] == '100']['recipient.cfscore'].dropna()
|
| 141 |
+
rep_scores = df[df['party'] == '200']['recipient.cfscore'].dropna()
|
| 142 |
+
|
| 143 |
+
plt.hist(dem_scores, alpha=0.7, label='Democrats', bins=50)
|
| 144 |
+
plt.hist(rep_scores, alpha=0.7, label='Republicans', bins=50)
|
| 145 |
+
plt.xlabel('CF Score (Liberal ← → Conservative)')
|
| 146 |
+
plt.ylabel('Frequency')
|
| 147 |
+
plt.legend()
|
| 148 |
+
plt.show()
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
## Pre-processed Versions Available
|
| 152 |
+
|
| 153 |
+
This dataset has been optimized and filtered into several versions:
|
| 154 |
+
|
| 155 |
+
- **`dime_recent.parquet`**: Records from 2010+ (277,297 rows)
|
| 156 |
+
- **`dime_federal_candidates.parquet`**: House + Senate candidates (157,988 rows)
|
| 157 |
+
- **`dime_house_candidates.parquet`**: House candidates only (115,899 rows)
|
| 158 |
+
- **`dime_senate_candidates.parquet`**: Senate candidates only (42,089 rows)
|
| 159 |
+
- **`dime_major_parties.parquet`**: Democrat + Republican only (304,016 rows)
|
| 160 |
+
|
| 161 |
+
## Data Quality Notes
|
| 162 |
+
|
| 163 |
+
### Missing Data Rates
|
| 164 |
+
- cf_score: 0.0% missing
|
| 165 |
+
- party: 0.0% missing
|
| 166 |
+
- state: 0.0% missing
|
| 167 |
+
- district: 0.0% missing
|
| 168 |
+
|
| 169 |
+
### Data Cleaning Applied
|
| 170 |
+
- Party codes standardized (100→D, 200→R, 328→I, etc.)
|
| 171 |
+
- CF scores converted to numeric format
|
| 172 |
+
- Office types extracted from NIMSP data
|
| 173 |
+
- Decade groupings added for temporal analysis
|
| 174 |
+
|
| 175 |
+
## Methodology: Campaign Finance Scores
|
| 176 |
+
|
| 177 |
+
The CF scores are estimated using a Bradley-Terry model applied to campaign contribution patterns:
|
| 178 |
+
|
| 179 |
+
1. **Contributors** make donations reflecting ideological preferences
|
| 180 |
+
2. **Recipients** receive donations from ideologically-aligned contributors
|
| 181 |
+
3. **Scaling algorithm** positions recipients on liberal-conservative dimension
|
| 182 |
+
4. **Scores** range from -2 (very liberal) to +2 (very conservative)
|
| 183 |
+
|
| 184 |
+
**Key advantages**:
|
| 185 |
+
- Covers candidates, PACs, and committees
|
| 186 |
+
- Available for all time periods
|
| 187 |
+
- Not dependent on roll-call votes
|
| 188 |
+
- Captures fundraising-based ideology
|
| 189 |
+
|
| 190 |
+
## Licensing and Citation
|
| 191 |
+
|
| 192 |
+
### Usage Rights
|
| 193 |
+
- ✅ **Academic Research**: Permitted
|
| 194 |
+
- ❓ **Redistribution**: Contact original authors
|
| 195 |
+
- ❓ **Commercial Use**: Requires permission
|
| 196 |
+
|
| 197 |
+
### Required Citation
|
| 198 |
+
|
| 199 |
+
```bibtex
|
| 200 |
+
@article{bonica2014mapping,
|
| 201 |
+
title={Mapping the ideological marketplace},
|
| 202 |
+
author={Bonica, Adam},
|
| 203 |
+
journal={American Journal of Political Science},
|
| 204 |
+
volume={58},
|
| 205 |
+
number={2},
|
| 206 |
+
pages={367--386},
|
| 207 |
+
year={2014}
|
| 208 |
+
}
|
| 209 |
+
```
|
| 210 |
+
|
| 211 |
+
### Additional References
|
| 212 |
+
|
| 213 |
+
For methodology details:
|
| 214 |
+
- Bonica, Adam. 2016. "Avenues of influence: on the political expenditures of corporations and their directors and executives." *Business and Politics* 18(4): 367-394.
|
| 215 |
+
|
| 216 |
+
## Technical Details
|
| 217 |
+
|
| 218 |
+
### File Formats
|
| 219 |
+
- **Parquet**: 37.2 MB (recommended for analysis)
|
| 220 |
+
- **CSV.gz**: 28.8 MB (human-readable)
|
| 221 |
+
- **Sharded**: Available for distributed processing
|
| 222 |
+
|
| 223 |
+
### Performance Benchmarks
|
| 224 |
+
- **Loading time**: ~3-5 seconds for full dataset
|
| 225 |
+
- **Memory usage**: ~500MB RAM for full dataset in pandas
|
| 226 |
+
- **Query performance**: Optimized with column indices
|
| 227 |
+
|
| 228 |
+
## Contact
|
| 229 |
+
|
| 230 |
+
For questions about this dataset preparation:
|
| 231 |
+
- Dataset processing: Created for academic research
|
| 232 |
+
- Original data: Contact Adam Bonica (Stanford)
|
| 233 |
+
- Usage questions: See DIME project documentation
|
| 234 |
+
|
| 235 |
+
---
|
| 236 |
+
|
| 237 |
+
*Data card generated on 2025-08-03*
|
| 238 |
+
*Processing pipeline version: 1.0*
|