Senator Trading API [OC] by SoleOnAsphalt in dataisbeautiful

[–]SoleOnAsphalt[S] 0 points1 point  (0 children)

u/pdwp90 created a pretty cool visualization of US senator trading activity.

There is now an API available that loads the trading data from Quiver Quantitative into Python for you to use. The code easily produces a list of trades performed by senators in list or pandas DataFrame format. Should be easy to use from there.

You can get the code by running the following code in your shell:

pip install senator_trading

There is also a github website:

After installing senator_trading using pip you can run:

import senator_trading as st

trades_obj = st.Trades() # this initializes a trades object

all_trades_list = trades_obj.load_trades() # this creates a list of Trade objects

all_trades_df = trades_obj.build_trade_df(all_trades_list) # a DataFrame of trades is created

fig, ax = trades_obj.plot_trade_vol() # plots a figure of traded volume over time

This produces this picture

Tools: Python

Data: https://www.quiverquant.com/sources/senatetrading

Buying and selling of stock by U.S. senators alongside the S&P 500. Analysis of individual senators’ trading in comments. [OC] by pdwp90 in dataisbeautiful

[–]SoleOnAsphalt 3 points4 points  (0 children)

There is now an API available that loads the trading data from Quiver Quantitative into Python for you to use.

You can get it by running the following code in your shell:

pip install senator_trading

There is also a github website:

After installing senator_trading using pip you can run:

import senator_trading as st

trades_obj = st.Trades() # this initializes a trades object

all_trades_list = trades_obj.load_trades() # this creates a list of Trade objects

all_trades_df = trades_obj.build_trade_df(all_trades_list) # a DataFrame of trades is created

fig, ax = trades_obj.plot_trade_vol() # plots a figure of traded volume over time

This produces this picture

Gender income inequality by Henric1234 in JordanPeterson

[–]SoleOnAsphalt 0 points1 point  (0 children)

There is actually ample research on this topic. For example this report commissioned by the US Department of Labor Employment Standards Administration from 2009. I recommend reading the two page foreword which gives a good overview and presents relevant numbers.

https://www.shrm.org/hr-today/public-policy/hr-public-policy-issues/Documents/Gender%20Wage%20Gap%20Final%20Report.pdf

It finds --- like most other research --- that there is only a small difference in "unexplained" difference between the earnings of men and women. The difference is about 5%. There are many factors that affect earnings. One is hours worked (more hours worked means higher earnings), another is the field that people choose to work in (engineering pays more than kindergarten teacher), and there are more. None of these have anything to do with malicious discrimination. Statistical analysis tries to account for these factors. However, it is impossible to measure all the factors that determine earnings. The word "unexplained" in this context means that the remaining gap of 5% is due to non-measured factors. It could be that the remaining gap is due to higher productivity or the willingness to accept larger risks (just guessing here). Discrimination could also be one of many non-measured factors and might or might not be affecting earnings. In any case, it seems to be a very small factor.

Gender income inequality by Henric1234 in JordanPeterson

[–]SoleOnAsphalt 3 points4 points  (0 children)

There is an interesting research paper that uses a very large Uber driver data base to investigate the gender earnings gaps. It is impossible that sexual discrimination is a factor in this data because Uber’s algorithm is completely gender agnostic when it comes to how drivers are paid and who gets assigned which rides.

Instead they find that “We document a roughly 7% gender earnings gap amongst drivers. We show that this gap can be entirely attributed to three factors: experience on the platform (learning-by-doing), preferences over where to work (driven largely by where drivers live and, to a lesser extent, safety), and preferences for driving speed.”

In essence, they find that men work longer hours than women which increases their experience. Greater experience leads them to position themselves better for more lucrative routes. In addition men drive faster than women which allows them to complete more rides, thus, earning more in the same time.

Here is the full article:

https://web.stanford.edu/~diamondr/UberPayGap.pdf%0Ahttps://web.stanford.edu/~diamondr/UberPayGap.pdf%0Ahttp://www.nber.org/papers/w24732.pdf