Publications by Michael Toth
Plotting the Evolution of the U.S. Treasury Yield Curve
Last week I came across a graphic that plots changes in the treasury yield curve from 1982 through 2012. For those unfamiliar, the yield curve shows the level of interest rates available to investors at a series of times to maturity or terms. I won’t go into too much detail here, but for more information you may find the Yield Curve page on Wiki...
3073 sym R (1913 sym/1 pcs) 2 img
Analyzing Historical Default Rates of Lending Club Notes
In case you’re unfamiliar, Lending Club is the world’s largest peer-to-peer lending company, offering a platform for borrowers and lenders to work directly with one another, eliminating the need for a financial intermediary like a bank. Removing the middle-man generally allows both borrowers and lenders to benefit from better interest rates t...
13172 sym R (8761 sym/6 pcs) 32 img
How to write an R Data Frame to an SQL Table
Frequently I find I need to perform an analysis that requires querying some values in a database table based on a series of IDs that might vary depending on some input. As an example, assume we have the following: A table that contains historical stock prices for 2000 stocks for the last 30 years Some input that contain’s a user’s portfolio ...
2534 sym R (644 sym/3 pcs)
Installing and Running Shiny Server from Source on 32-bit Ubuntu
I recently migrated this site from a shared web hosting service to DigitalOcean because I was interested in learning about how to host my own site and how web servers work. I also wanted to play with and host shiny applications on my own site, rather than relying on a third-party service provider. In this post I’ll talk about the steps I follo...
5269 sym Python (2501 sym/8 pcs)
Popularity of Baby Names Since 1880
A while back I spent some time figuring out how to serve interactive shiny apps through my website, but I haven’t had a chance to build anything until recently. I set out to create a few simple shiny apps in R that I could use as a sort of test run, and I’m writing those up here. In this post I’m going to be analyzing some open data provide...
4658 sym R (1747 sym/1 pcs) 2 img
How to Write Pelican Blog Posts using RMarkdown & Knitr
In this post I’m going to be talking about how to easily modify your Pelican blog configuration to let you directly publish blog posts using RMarkdown. I’m assuming you already have a Pelican blog set up, so I won’t be covering that in today’s post. If you’re interested but haven’t yet set up a blog for yourself, it’s quite straight...
4143 sym R (1479 sym/7 pcs) 2 img
Sentiment Analysis of Warren Buffett’s Letters to Shareholders
Last week, I was reading through Warren Buffett’s most recent letter to Berkshire Hathaway shareholders. Every year, he writes a letter that he makes publicly available on the Berkshire Hathaway website. In the letters he talks about the performance of Berkshire Hathaway and their portfolio of businesses and investments. But he also talks about...
6248 sym 6 img
How to Write Pelican Blog Posts using RMarkdown & Knitr, 2.0
Back in January I wrote a post discussing how to get RMarkdown and Pelican to work together to make the R analysis > blog post workflow a bit easier. While I had high hopes, I was never really happy with the setup I put together then, so I set out to update it. In this post I’m going to talk about my new, improved way of publishing Pelican blo...
4399 sym R (1301 sym/1 pcs)
You Need to Start Branding Your Graphs. Here’s How, with ggplot!
In today’s post I want to help you incorporate your company’s branding into your ggplot graphs. Why should you care about this? I’m glad you asked! Have you ever seen a graph that looks like this? Of course you have! This is the default ggplot theme, and these graphs are everywhere. Now, look–I like the way this graph looks. The base ggp...
6725 sym 12 img
How to Create a Bar Chart Race in R – Mapping United States City Population 1790-2010
In my corner of the internet, there’s been an explosion over the last several months of a style of graph called a bar chart race. Essentially, a bar chart race shows how a ranked list of something–largest cities, most valuable companies, most-followed Youtube channels–evolves over time. Maybe you’ve been following this trend with the same...
5797 sym R (3154 sym/6 pcs) 4 img