open-navigator / examples /POLITICAL_INFLUENCE_INTEGRATION.md
jcbowyer's picture
Clean HuggingFace deployment without binary files
61d29fc

Political Influence Analysis - Complete Data Integration

The Complete Picture

This integration combines 4 major data sources to reveal political connections in civic engagement and grant funding:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        DATA ECOSYSTEM                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                     β”‚
β”‚  1. IRS FORM 990           2. FEC CONTRIBUTIONS                    β”‚
β”‚  ───────────────           ───────────────────                     β”‚
β”‚  β€’ Nonprofit orgs          β€’ Political donations                   β”‚
β”‚  β€’ Officer names           β€’ Contributor employer ─────┐           β”‚
β”‚  β€’ Compensation            β€’ Donation amounts          β”‚           β”‚
β”‚  β€’ Revenue sources         β€’ Recipients (candidates)   β”‚           β”‚
β”‚                                                        β”‚           β”‚
β”‚  3. GRANTS.GOV             4. VOTER DATA               β”‚           β”‚
β”‚  ───────────────           ────────────                β”‚           β”‚
β”‚  β€’ Available grants        β€’ Party affiliation         β”‚           β”‚
β”‚  β€’ Deadlines               β€’ Elected officials         β”‚           β”‚
β”‚  β€’ Award amounts           β€’ Turnout patterns          β”‚           β”‚
β”‚  β€’ Eligibility             β€’ Demographics          ────┴───┐       β”‚
β”‚                                                            β”‚       β”‚
β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚       β”‚
β”‚                    β”‚  ANALYSIS QUESTIONS   β”‚ <β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β”‚                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚
β”‚                                                                     β”‚
β”‚  β€’ Political influence on grant awards?                            β”‚
β”‚  β€’ Partisan patterns in oral health funding?                       β”‚
β”‚  β€’ Advocacy networks and donor circles?                            β”‚
β”‚  β€’ Timeline: Donation β†’ Policy β†’ Grant?                            β”‚
β”‚                                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Source Comparison

What Each Source Provides

Data Source What You Get Key Value
IRS 990 (existing) Nonprofit finances, officers, grants received WHO got funded, HOW MUCH
Grants.gov (new) Available grant opportunities, deadlines WHAT'S available NOW
FEC (new) Political donations by individuals WHO donated to WHOM
Voter Data (new) Jurisdiction politics, elected officials POLITICAL CONTEXT

Combined Insights

When you integrate all four:

EXAMPLE: Massachusetts Dental Health Clinic

IRS 990:
β”œβ”€ Organization: MA Dental Health Clinic (EIN: 12-3456789)
β”œβ”€ Executive Director: Dr. Jane Smith
β”œβ”€ Compensation: $150,000/year
β”œβ”€ Revenue: $2M total
β”‚  β”œβ”€ Government grants: $800,000 (40%)
β”‚  β”œβ”€ Program service: $1M (50%)
β”‚  └─ Donations: $200,000 (10%)

FEC Contributions:
β”œβ”€ Dr. Jane Smith
β”‚  β”œβ”€ $2,500 β†’ Senator Elizabeth Warren (D-MA) - 2024-03-15
β”‚  β”œβ”€ $1,000 β†’ Rep. Joe Kennedy (D-MA-04) - 2024-06-01
β”‚  └─ Total: $3,500 in 2024 cycle
β”‚
└─ Board Member: Dr. John Doe
   β”œβ”€ $5,000 β†’ HCFP PAC (Health Care for People) - 2024-02-10
   └─ Total: $5,000

Grants.gov:
β”œβ”€ HRSA Oral Health Workforce Grant
β”‚  β”œβ”€ Opportunity: HRSA-24-123
β”‚  β”œβ”€ Posted: 2024-07-15
β”‚  β”œβ”€ Deadline: 2024-12-31
β”‚  β”œβ”€ Award: $500k-$2M
β”‚  └─ Eligible: Community health centers (MATCH!)

Voter Data:
β”œβ”€ Location: Boston, MA (Congressional District 4)
β”œβ”€ District: D+15 (strong Democratic)
β”œβ”€ Representative: Joe Kennedy (D) - recipient of Dr. Smith's donation
β”œβ”€ Senator: Elizabeth Warren (D) - recipient of Dr. Smith's donation
└─ State Legislature: Democratic majority

TIMELINE ANALYSIS:
β”œβ”€ 2024-03-15: Dr. Smith donates to Sen. Warren
β”œβ”€ 2024-06-01: Dr. Smith donates to Rep. Kennedy
β”œβ”€ 2024-07-15: HRSA grant posted (eligible for clinic)
β”œβ”€ 2024-09-01: Clinic receives $500k HRSA grant (hypothetical)
└─ 2025-03-01: IRS 990 reports $800k government grants

QUESTIONS:
β€’ Correlation or causation?
β€’ Is this normal civic engagement?
β€’ Does political activity predict grant success?
β€’ Are there partisan patterns in health funding?

Analysis Examples

1. Political Influence on Grant Awards

Research Question: Do nonprofits with politically active leadership receive more federal grants?

# Load all data
nonprofits = pd.read_parquet("data/gold/states/MA/nonprofits_organizations.parquet")
officers = pd.read_parquet("data/gold/states/MA/nonprofits_officers.parquet")
grants = pd.read_parquet("data/gold/states/MA/grants_revenue_sources.parquet")
contributions = pd.read_parquet("data/gold/fec/political_contributions.parquet")

# Merge everything
full_data = (
    nonprofits
    .merge(officers, on='EIN', how='left')
    .merge(grants, on='EIN', how='left')
    .merge(contributions, left_on='person_name', right_on='contributor_name', how='left')
)

# Compare groups
politically_active = full_data[full_data['contribution_amount'].notna()]
not_active = full_data[full_data['contribution_amount'].isna()]

print(f"Politically active orgs: Avg grant = ${politically_active['government_grants'].mean():,.0f}")
print(f"Not active orgs: Avg grant = ${not_active['government_grants'].mean():,.0f}")

# Statistical test
from scipy import stats
t_stat, p_value = stats.ttest_ind(
    politically_active['government_grants'].dropna(),
    not_active['government_grants'].dropna()
)
print(f"p-value: {p_value:.4f}")

2. Partisan Patterns in Oral Health Funding

Research Question: Do Democratic or Republican areas get more oral health grants?

# Enrich nonprofits with political context
from discovery.voter_data_integration import PoliticalContextEnricher

enricher = PoliticalContextEnricher()
enriched = enricher.add_political_context_to_nonprofits(
    nonprofits_df=nonprofits,
    contributions_df=contributions,
    legislators_df=legislators
)

# Group by party control
by_party = enriched.groupby('state_legislature_control').agg({
    'government_grants': 'mean',
    'EIN': 'count'
}).rename(columns={'EIN': 'org_count'})

print("Average Government Grants by State Legislature Control:")
print(by_party)

# Visualization
import matplotlib.pyplot as plt
by_party['government_grants'].plot(kind='bar')
plt.title("Avg Federal Grants: Democratic vs Republican States")
plt.ylabel("Average Grant Amount ($)")
plt.show()

3. Donor Networks in Health Policy

Research Question: Which candidates receive the most from health sector?

# Health sector contributions
health_contribs = contributions[
    contributions['contributor_employer'].str.contains(
        'health|dental|clinic|hospital',
        case=False,
        na=False
    )
]

# Top recipients
top_recipients = health_contribs.groupby('committee_name').agg({
    'contribution_amount': 'sum',
    'contributor_name': 'count'
}).sort_values('contribution_amount', ascending=False).head(10)

print("Top 10 Recipients of Health Sector Donations:")
print(top_recipients)

# Network analysis
import networkx as nx

# Build graph: Donors β†’ Candidates
G = nx.Graph()
for _, row in health_contribs.iterrows():
    donor = row['contributor_name']
    recipient = row['committee_name']
    amount = row['contribution_amount']
    G.add_edge(donor, recipient, weight=amount)

# Find central candidates (most donors)
centrality = nx.degree_centrality(G)
print("\nMost Connected Candidates:")
for candidate, score in sorted(centrality.items(), key=lambda x: x[1], reverse=True)[:5]:
    print(f"  {candidate}: {score:.3f}")

4. Timeline Analysis: Donation β†’ Grant

Research Question: How long between political donation and grant award?

# Merge contributions with grants by EIN
timeline_data = contributions.merge(
    grants,
    left_on='nonprofit_ein',
    right_on='ein',
    how='inner'
)

# Convert dates
timeline_data['contribution_date'] = pd.to_datetime(timeline_data['contribution_date'])
timeline_data['grant_date'] = pd.to_datetime(timeline_data['grant_award_date'])

# Calculate time difference
timeline_data['days_to_grant'] = (
    timeline_data['grant_date'] - timeline_data['contribution_date']
).dt.days

# Filter to positive (donation before grant)
before_grant = timeline_data[timeline_data['days_to_grant'] > 0]

print(f"Donations made BEFORE grant award: {len(before_grant):,}")
print(f"Average time: {before_grant['days_to_grant'].mean():.0f} days")
print(f"Median time: {before_grant['days_to_grant'].median():.0f} days")

# Histogram
before_grant['days_to_grant'].hist(bins=50)
plt.title("Time from Political Donation to Grant Award")
plt.xlabel("Days")
plt.ylabel("Frequency")
plt.show()

Dashboard Features

Political Connections Widget

Add to nonprofit profile pages:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MA Dental Health Clinic                   β”‚
β”‚  EIN: 12-3456789                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  πŸ’° Political Connections                  β”‚
β”‚                                            β”‚
β”‚  Leadership Political Activity:            β”‚
β”‚  β€’ 2 officers made political donations     β”‚
β”‚  β€’ Total: $8,500 (2024 cycle)             β”‚
β”‚                                            β”‚
β”‚  Federal Grant Awards:                     β”‚
β”‚  β€’ $800,000 government grants (2023)      β”‚
β”‚  β€’ HRSA Oral Health Workforce Grant       β”‚
β”‚                                            β”‚
β”‚  Political Context:                        β”‚
β”‚  β€’ District: MA-04 (D+15)                 β”‚
β”‚  β€’ Representative: Joe Kennedy (D)         β”‚
β”‚  β€’ Senator: Elizabeth Warren (D)           β”‚
β”‚                                            β”‚
β”‚  [View Full Disclosure] [Timeline Chart]   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Transparency Report

Public disclosure page:

Political Finance Transparency Report
Massachusetts Oral Health Organizations
─────────────────────────────────────────

Summary:
β€’ 145 health nonprofits in database
β€’ 23 have politically active leadership (16%)
β€’ $456,000 in political donations (2024)
β€’ $45M in federal grants received (2023)

Top Donors (by organization):
1. MA Dental Association - $125,000
2. Community Health Network - $89,500
3. Boston Medical Center - $67,200

Top Recipients (candidates/committees):
1. Elizabeth Warren (D-MA) - $234,000
2. Ed Markey (D-MA) - $156,000
3. Various House candidates - $66,000

Partisan Breakdown:
β€’ Democratic candidates: 78%
β€’ Republican candidates: 18%
β€’ Non-partisan: 4%

[Download Full Data] [Methodology]

Ethical Considerations

Important Disclaimers

  1. Correlation β‰  Causation

    • Political donations don't prove quid pro quo
    • Many factors influence grant awards
    • Present data, not conclusions
  2. Personal vs. Institutional

    • Officers donate as individuals, not on behalf of nonprofits
    • Political views are personal
    • Don't attribute individual actions to organizations
  3. Context is Critical

    • Civic engagement is protected speech
    • Political donations are legal and transparent
    • Focus on patterns, not individuals
  4. Fairness and Balance

    • Present all sides
    • Avoid partisan framing
    • Let users draw own conclusions

Best Practices

βœ… DO:

  • Present data transparently
  • Provide full methodology
  • Allow users to verify
  • Show aggregate patterns
  • Respect privacy laws

❌ DON'T:

  • Imply wrongdoing without evidence
  • Selectively present data
  • Use partisan language
  • Focus on individuals
  • Draw unsupported conclusions

Implementation Checklist

  • Get FEC API key (https://api.data.gov/signup/)
  • Run FEC integration demo
  • Match FEC data to your nonprofit officers
  • Combine with Grants.gov data
  • Add voter/political context
  • Build analysis queries
  • Create dashboard widgets
  • Write transparency methodology
  • Review for ethical concerns
  • Launch with clear disclaimers

ROI Summary

Data Collection Effort

Data Source Setup Time Cost Maintenance
IRS 990 βœ… Done Free Automatic
Grants.gov 5 min Free Daily cron
FEC API 5 min (signup) Free Weekly batch
Voter Data Varies $-$$$ Monthly

Total: 10-30 minutes + optional vendor costs

Value Delivered

For Transparency:

  • Public disclosure of political-financial connections
  • Trust through openness
  • Accountability for nonprofits and officials

For Analysis:

  • Understand influence patterns
  • Track money in politics
  • Identify advocacy networks
  • Research civic engagement

For Advocacy:

  • Strategic political engagement
  • Optimize advocacy efforts
  • Learn from successful orgs
  • Navigate political landscape

Differentiation:

  • Unique feature - no one else combines these
  • Media interest - compelling stories
  • Academic value - research partnerships
  • Impact - better democracy

Example Queries

Save these for your analysis toolkit:

-- 1. Which nonprofits have politically active leaders?
SELECT 
    n.organization_name,
    COUNT(DISTINCT c.contributor_name) as donor_count,
    SUM(c.contribution_amount) as total_donated,
    n.government_grants
FROM nonprofits n
JOIN officers o ON n.ein = o.ein
JOIN contributions c ON o.person_name = c.contributor_name
GROUP BY n.ein
ORDER BY total_donated DESC;

-- 2. Partisan breakdown by state
SELECT 
    state,
    party_lean,
    COUNT(*) as org_count,
    AVG(government_grants) as avg_grants
FROM nonprofits
GROUP BY state, party_lean;

-- 3. Timeline: Donation to grant
SELECT 
    c.contribution_date,
    c.contributor_name,
    c.contribution_amount,
    g.grant_award_date,
    g.grant_amount,
    DATEDIFF(g.grant_award_date, c.contribution_date) as days_between
FROM contributions c
JOIN grants g ON c.nonprofit_ein = g.ein
WHERE g.grant_award_date > c.contribution_date
ORDER BY days_between;

Next Steps

  1. Get API Keys:

  2. Run Demos:

    python examples/demo_political_influence.py --api-key YOUR_FEC_KEY
    
  3. Generate Full Dataset:

    • Match all officers to FEC contributions
    • Combine with Grants.gov opportunities
    • Add voter/political context
  4. Build Features:

    • Political connections widget
    • Transparency report page
    • Timeline visualizations
    • Network graphs
  5. Launch with Context:

    • Write clear methodology
    • Add ethical disclaimers
    • Provide full data downloads
    • Allow verification

The bottom line: This creates the most comprehensive view of political influence in civic engagement available anywhere. Use it responsibly! 🎯