Comments (14)
@JeffreyBLewis How is this field calculated?
from webvoteview.
The formula is:
pr_i(Vote = Yea) = \Phi(u_ijyt - u_ijnt)
where u_ijyt and u_ijnt are the deterministic portion of the utility to legislator i to vote yea or nay (respectively) on rollcall j in congress t, and \Phi is the standard normal CDF. Furthermore,
u_ijyt = \beta exp(-1/2 (d^2_ij1yt + w^2 d^2_ij2yt))
where w is the dimension weight (1 for the first dim and ~0.4 for the second dim), \beta is the estimated \beta parameter, and d_ijkyt is the squared distance between legislator i's position on dimension k in congress t and the yea outcome point on rollcall j on dimension k in congress t (e.g. (X_ikt - O_jkyt)^2).
I will implement this in python and we can figure out where to put it, Adam. Jeff, please confirm this equation.
from webvoteview.
I've implemented this in /usr/scripts/rollcallEdits/voteProb.py and I saw the equations in Jeff's pynominate.py code as well so I'm pretty certain it is working correctly. The correlation between prob yea and actual yea votes is very strong for votes with clear cutlines and weak for rollcalls that look less predictable.
@adamboche, we need to figure out where this goes in the process. Currently I don't ingest, just compute the probabilities and print them/get correlations with actual votes.
from webvoteview.
If you guys could ingest into the old schema before we do the schema switchover, that'd be great. At least for a few votes so I can make sure the display code is working well and looks OK. Maybe all votes from the 114th? Also I am expecting 0-100 probabilities rather than 0-1. Let me know if you'd rather change it.
from webvoteview.
Ok, so I have produced these probabilities for the 114th in the old voteview database (and thus in the old schema) which are good for testing purposes.
We can easily switch this over to the new schema by uncommenting and deleting some lines in /usr/scripts/rollcallEdits/voteProb.py. Then the code can be run to populate the whole db in the new schema. However, because this is quite slow, it should probably be merged with Adam's populating of the icpsr and cast_codes in votes for each rollcall.
Nonetheless, this issue should be consider closed and when the schema are switched (Issue #22 ) we should resolve this problem.
from webvoteview.
@JeffreyBLewis, if a member votes "absent" they shouldn't get a vote probability, correct?
I've also been experimenting with unanimous and near-unanimous votes. Almost all produced vote probabilities are >99.9. I'll keep exploring this somewhat.
from webvoteview.
We don't have a model of abstention, so I don't have a probability of not voting. It might interesting to add information on the hypothetical probability of a yea vote for abstentions which we could show as greyed out in the table. What do you think?
from webvoteview.
I think it is a fair idea. One worry is that it may be too much information when people try to parse that column. They see numbers that mean probability of the vote the member actually made, which users then have to scan two columns to the left to see as well as numbers that are greyed out which mean hypothetical yea vote probabilities.
I'll implement it and see what it looks like.
from webvoteview.
It's mostly a UI problem, right? We could tool-tip or asterisk the hypothetical yea probabilities for abstentions.
from webvoteview.
I've implemented this for the person pages: http://128.97.229.160/person/21199
I think it looks fine but Aaron the tooltip might need a little work. I'm trying to think about how to deal with this with the sorting on the vote page. Because we are sorting least likely to most likely, how should we treat the abstainers? My thinking is that they should be thrown at the end as a new section and sorted from most to least likely to vote yea.
from webvoteview.
The tooltip sucks (not your fault, bootstrap's tooltip code is pretty bad--I will poke at this), but the column style is OK I think! :)
from webvoteview.
This is done for the vote table on the vote page now.
The title for the absent voters might need some work, but feel free to edit that if something better comes to mind.
Next I will work on vote probabilities when they are undefined so that we are robust to that problem. This is somewhat low priority as we should have probabilities for all vote rollcalls (as I'm working on producing those for rollcalls that don't have parameters). Otherwise I would close this issue.
from webvoteview.
I fixed the tooltip up so it looks clearer. @lukesonnet Are there any outstanding issues here?
from webvoteview.
No, I think it is fine. Tooltip is much better now. I was trying not to write a huge tooltip but I think it is worth it.
from webvoteview.
Related Issues (20)
- Congress page doesn't load HOT 1
- Parties at a glance should hide minor parties by default
- Fix party page for party 328 (independent) -- JS error [python3 only]
- Add congress codes to metadata
- Brush to select on Congress DW-NOMINATE plot shows NaN when selecting far-right
- Wikipedia key vote not an option on search facets
- Check or update service dates HOT 1
- Rewrite JS in modern-ish (ES6 or newer) Javascript
- Better link previews for rollcall votes
- Party bios should support HTML
- Trump vote on Gorsuch may be wrong
- Map download colors missing HOT 1
- Bulk vote download problem
- More friendly 500 error page
- Downloading zoomed map HOT 1
- Data downloads all 404 HOT 4
- Show member departures
- Add issue codes to csv files
- Scalia confirmation vote
- Load 97th Congress bill numbers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webvoteview.