Data4Democracy / just-politics

Identifying vulnerable house and senate seats in the 2018 midterm elections
12 stars 5 forks source link

Create dataset of representative voting records #1

Open gati opened 7 years ago

gati commented 7 years ago

This dataset will list how each congressional representative and senator voted in the house and senate, respectively.

Ultimately, the goal is to see how each candidate's voting record syncs with public opinion, and whether or not that's a useful signal in determining the vulnerability of a house or senate seat in midterm elections.

milafrerichs commented 7 years ago

So I found a very good source. ProPublica has adopted a project from Sunlight Foundation. They have an API where you can get the votes on all bills.

For example: https://api.propublica.org/congress/v1/115/senate/sessions/1/votes/17.json will get you the details of the bill A concurrent resolution setting forth the congressional budget for the United States Government for fiscal year 2017 and setting forth the appropriate budgetary levels for fiscal years 2018 through 2026.", with all votes:

"positions": [{
                    "member_id": "A000360",
                    "vote_position": "Yes",
                    "dw_nominate": ""
                }, {
                    "member_id": "B001230",
                    "vote_position": "No",
                    "dw_nominate": ""
                },
...
gati commented 7 years ago

This is awesome! Is there an endpoint to tie member_id to their real-life name?

What do you think would be next steps for tying bill contents to public opinion (ideally from their district) about the bill?

Good find!

milafrerichs commented 7 years ago

Yes, there is: https://api.propublica.org/congress/v1/115/senate/members.json The documentation can be found here: https://propublica.github.io/congress-api-docs

The next step would be to find bills where there was an opinion poll done by a research institute, find the data behind and tie it to a bill and the vote.

gati commented 7 years ago

oh nice. yes that's a good way to limit the scope. are you up for pursuing that? maybe we could go through that process once, see how hard it is to match an opinion poll and a bill, then decide how hard it'd be to scale that up to all bills in the ProPublica database?

milafrerichs commented 7 years ago

yes, that sounds like a plan. Not sure where I would find representative opinion polls, but I will research that a bit.

gati commented 7 years ago

It might be a little manual, but Pew breaks down their polling/analysis by topic. http://www.pewresearch.org/topics/. Also I know one of the data scientists there, so if that looks fruitful, we might have an in for direct access to datasets. Just let me know!