Published
Edited
Sep 23, 2022
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
shillerData = shillerCSV.map(csvRow => {
let year = parseInt(csvRow["Date"])
let month = parseFloat(csvRow["Date"]) * 100 % 100
return {
date: new Date(`${year}-${month}-01`),
//origDate: csvRow["Date"],
price: parseFloat(csvRow["S&P Comp. P"]),
dividend: parseFloat(csvRow["Dividend D"]),
earnings: parseFloat(csvRow["Earnings E"]),
cpi: parseFloat(csvRow[" Consumer Price Index CPI"]),
gs10: parseFloat(csvRow["Long Interest Rate GS10"]),
realPrice: parseFloat(csvRow["Real Price"]),
realDividend: parseFloat(csvRow["Real Dividend"]),
realEarnings: parseFloat(csvRow["Real Earnings"]),
realTotalReturnPrice: parseFloat(csvRow[" Real Total Return Price "]),
cape: parseFloat(csvRow["Cyclically Adjusted Price Earnings Ratio P/E10 or CAPE"]),
trCape: parseFloat(csvRow["Cyclically Adjusted Total Return Price Earnings Ratio TR P/E10 or TR CAPE"]),
excessCapeYield: parsePercent(csvRow["Excess CAPE Yield"]),
monthlyTotalBondReturn: parseFloat(csvRow["Monthly Total Bond Returns"]),
realTotalBondReturn: parseFloat(csvRow["Real Total Bond Returns"]),
tenYearAnnualizedRealStockReturn: parsePercent(csvRow["10 Year Annualized Stock Real Return"]),
tenYearAnnualizedRealBondReturn: parsePercent(csvRow["10 Year Annualized Bonds Real Return"]),
tenYearRealAnnualizedExcessReturn: parsePercent(csvRow["Real 10 Year Excess Annualized Returns"]),
}
})
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more