Are Accounts Receivables Correlated With Revenue?

Import the Calcbench Client

In [1]:
import calcbench as cb #https://github.com/calcbench/python_api_client
%pylab inline
Populating the interactive namespace from numpy and matplotlib

Get tickers in the S&P 500

In [2]:
tickers = cb.tickers(index="SP500")

Get quarterly data from Calcbench and compute the correlation between accounts receivable and revenue.

In [3]:
quarterly_data = cb.normalized_data(tickers, ['revenue', 'accountsreceivable'], 2008, 1, 2014, 3)
quarter_corr = quarterly_data['accountsreceivable'].corrwith(quarterly_data['revenue'])
quarter_corr.hist(bins=50, figsize=(15, 10))
Out[3]:
<matplotlib.axes.AxesSubplot at 0xaa4d4f0>
In [6]:
quarterly_data.columns
Out[6]:
MultiIndex(levels=[['accountsreceivable', 'revenue'], ['A', 'AA', 'AAPL', 'ABBV', 'ABC', 'ABT', 'ACE', 'ACN', 'ACT', 'ADBE', 'ADI', 'ADM', 'ADP', 'ADS', 'ADSK', 'ADT', 'AEE', 'AEP', 'AES', 'AET', 'AFL', 'AGN', 'AIG', 'AIV', 'AIZ', 'AKAM', 'ALL', 'ALLE', 'ALTR', 'ALXN', 'AMAT', 'AME', 'AMG', 'AMGN', 'AMP', 'AMT', 'AMZN', 'AN', 'ANTM', 'AON', 'APA', 'APC', 'APD', 'APH', 'ARG', 'ATI', 'AVB', 'AVGO', 'AVP', 'AVY', 'AXP', 'AZO', 'BA', 'BAC', 'BAX', 'BBBY', 'BBT', 'BBY', 'BCR', 'BDX', 'BEN', 'BFB', 'BHI', 'BIIB', 'BK', 'BLK', 'BLL', 'BMY', 'BRCM', 'BRKA', 'BSX', 'BWA', 'BXP', 'C', 'CA', 'CAG', 'CAH', 'CAM', 'CAT', 'CB', 'CBG', 'CBS', 'CCE', 'CCI', 'CCL', 'CELG', 'CERN', 'CF', 'CFN', 'CHK', 'CHRW', 'CI', 'CINF', 'CL', 'CLX', 'CMA', 'CMCSA', 'CME', 'CMG', 'CMI', ...]],
           labels=[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, ...]],
           names=['metric', 'ticker'])

Do the same for annual data.

In [24]:
annual_data = cb.normalized_data(tickers, ['revenue', 'accountsreceivable'], 2008, 0, 2014, 0)
annual_corr = annual_data['accountsreceivable'].corrwith(annual_data['revenue'])
annual_corr.hist(bins=50, figsize=(15, 10))
Out[24]:
<matplotlib.axes.AxesSubplot at 0x90a0170>

YUM is an example of a company with negative quarterly correlation.

In [28]:
quarterly_data['revenue']['YUM'].plot(figsize=(10, 6))
quarterly_data['accountsreceivable']['YUM'].plot(secondary_y=True)
Out[28]:
<matplotlib.axes.AxesSubplot at 0x8dd27d0>

But YUM's correlation is positive on an annual basis.

In [19]:
annual_data['revenue']['YUM'].plot(figsize=(10, 6))
annual_data['accountsreceivable']['YUM'].plot(secondary_y=True)
Out[19]:
<matplotlib.axes.AxesSubplot at 0x90a61f0>