plot of chunk plot-ggplot

For a d3 bar plot visit http://www.jaredlander.com/plots/PizzaPollPlot.html.



I finally compiled the data from all the pizza polling I’ve been doing at the New York R meetups. The data are available as json at http://www.jaredlander.com/data/PizzaPollData.php.

This is easy enough to plot in R using ggplot2.

require(rjson)
require(plyr)
pizzaJson <- fromJSON(file = "http://jaredlander.com/data/PizzaPollData.php")
pizza <- ldply(pizzaJson, as.data.frame)
head(pizza)
##   polla_qid      Answer Votes pollq_id                Question
## 1         2   Excellent     0        2  How was Pizza Mercato?
## 2         2        Good     6        2  How was Pizza Mercato?
## 3         2     Average     4        2  How was Pizza Mercato?
## 4         2        Poor     1        2  How was Pizza Mercato?
## 5         2 Never Again     2        2  How was Pizza Mercato?
## 6         3   Excellent     1        3 How was Maffei's Pizza?
##            Place      Time TotalVotes Percent
## 1  Pizza Mercato 1.344e+09         13  0.0000
## 2  Pizza Mercato 1.344e+09         13  0.4615
## 3  Pizza Mercato 1.344e+09         13  0.3077
## 4  Pizza Mercato 1.344e+09         13  0.0769
## 5  Pizza Mercato 1.344e+09         13  0.1538
## 6 Maffei's Pizza 1.348e+09          7  0.1429
require(ggplot2)
ggplot(pizza, aes(x = Place, y = Percent, group = Answer, color = Answer)) + 
    geom_line() + theme(axis.text.x = element_text(angle = 46, hjust = 1), legend.position = "bottom") + 
    labs(x = "Pizza Place", title = "Pizza Poll Results")

plot of chunk plot-ggplot

But given this is live data that will change as more polls are added I thought it best to use a plot that automatically updates and is interactive. So this gave me my first chance to need rCharts by Ramnath Vaidyanathan as seen at October’s meetup.

require(rCharts)
pizzaPlot <- nPlot(Percent ~ Place, data = pizza, type = "multiBarChart", group = "Answer")
pizzaPlot$xAxis(axisLabel = "Pizza Place", rotateLabels = -45)
pizzaPlot$yAxis(axisLabel = "Percent")
pizzaPlot$chart(reduceXTicks = FALSE)
pizzaPlot$print("chart1", include_assets = TRUE)

Unfortunately I cannot figure out how to insert this in WordPress so please see the chart at http://www.jaredlander.com/plots/PizzaPollPlot.html. Or see the badly sized one below.

There are still a lot of things I am learning, including how to use a categorical x-axis natively on linecharts and inserting chart titles. I found a workaround for the categorical x-axis by using tickFormat but that is not pretty. I also would like to find a way to quickly switch between a line chart and a bar chart. Fitting more labels onto the x-axis or perhaps adding a scroll bar would be nice too.

2013

2013

Continuing the annual tradition of Pi Cakes from Chrissie Cook we have gotten another Pi Cake!  This year we let Drew Conway’s wife pick the flavors and she went with vanilla and red velvet (the blue color is to cause some cognitive dissonance).  Looking forward to enjoying this tonight after some pizza.

Previous cakes in the gallery after the break.

Continue reading

How was Pizza 33?

  • Good (50%, 3 Votes)
  • Excellent (17%, 1 Votes)
  • Average (17%, 1 Votes)
  • Poor (17%, 1 Votes)
  • Never Again (0%, 0 Votes)

Total Voters: 6

Loading ... Loading …

 

Aggregated results.

Results from individual previous polls are below.

Continue reading

Taking a break from my normal exposition on stats, New York or pizza I’d like to espouse the wonders of baking soda and vinegar!

My sink was clogged, not with anything specific, but just years worth of gunk.  So after scraping out what I could with my hands and a wire hanger–and wanting to avoid caustic chemicals like Drano–I searched the Internet to see if Listerene or Coca-Cola might do the trick.  But extensive searching led me to baking soda and vinegar.

It’s very simple:  Stuff a half cup of baking soda into the train then pour a half cup of vinegar down it, return the sink stopper and wait 15 minutes.  Then pour down another half cup of vinegar, close the stopper and wait another 15 minutes.  After that pour a gallon (a tea kettle’s worth) of boiling water down the drain and you’re done!  Not only will it unclog your drain, it leaves all the chrome shining like new!

For those of us who never got to make a model volcano in science class it was really awesome watching the baking soda and vinegar react

Pi Day Celebrants

As mentioned earlier, yesterday was Pi Day so a bunch of statisticians and other such nerds celebrated at the new(ish) Artichoke Basille near the High Line.  We had three pies:  the signature Artichoke, the Margherita and the Anchovy, which was delicious but only some of us ate.  And of course we had our custom cake from Chrissie Cook.

The photos were taken by John.

Pi Cake 2011
NYC Data Mafia

NYC Data Mafia

Pi CakeHappy Pi Day everybody!  I’ll be out celebrating with the rest of the NYC Data Mafia eating pizza and devouring the above Pi Cake, custom baked by Chrissie Cook.

Today is also Albert Einstein’s birthday so there are plenty of reasons to have fun.

The cake below was my first ever Pi Cake in what is sure to become an annual tradition.

Pi Cake 2009

Update: Drew Conway does far more justice to our fair, irrational, transcendental number.

Update 2:  Engadget posted this awesome video of “What Pi Sounds Like.

Last Wednesday I made a trip to Di Fara in Midwood, Brooklyn.  Since that place is well covered and lauded I won’t talk about the pizza, as amazing as it is. 

I gave Dom a copy of my thesis (pdf) on NYC pizza and he loved that his place was one of the few pizzerias mentioned by name (along with Lombardi’s and Otto Enoteca, two of my favorites) in the paper.  My friend captured these great photos and I’m extremely thankful to Dom for letting me in his kitchen. 

And to make the trip all the more surreal, Avenue J was lined with lulav and etrog vendors trying to clear out stock before Sukkot started.  The juxtaposition of Di Fara and the surrounding Orthodox neighborhood was striking and really shows the beauty of New York City. 

Gallery of photos below.

After years of waiting a new Artichoke Basilles our dreams have been answered.  The new spot, which hasn’t even been updated on the website yet, is at 17th and 10th opened this weekend.  Unlike the original location this one has seats and wait service and only sells pies, albeit smaller than the originals.  There is a side shop where they sell slices, but I didn’t venture in there.

The pie, seen below in the blurry iPhone shot, is just a smaller version of the pies at the original shop and were just as tasty.  One pie was too much food for a friend and me, so figure one pie ($17) for 2.5 to 3 people.

Additionally, they have a larger selection of pies and non-pizza food, such as salad and the sorts.  They don’t have beer or liquor yet, but should soon.

Updated (September 29th, 6:27 PM):  Slice Review.

Last week Slice ran a post about a tomato taste test they conducted with Scott Wiener (of Scott’s NYC Pizza Tours), Brooks Jones, Jason Feirman, Nick Sherman and Roberto Caporuscio from Keste.  While the methods used may not be rigorous enough for definitive results, I took the summary data that was in the post and performed some simple analyses.

The first thing to note is that there are only 16 data points, so multiple regression is not an option.  We can all thank the Curse of Dimensionality for that.  So I stuck to simpler methods and visualizations.  If I can get the raw data from Slice, I can get a little more advanced.

For the sake of simplicity I removed the tomatoes from Eataly because their price was such an outlier that it made visualizing the data difficult.  As usual, most of the graphics were made using ggplot2 by Hadley Wickham.  The coefficient plots were made using a little function I wrote.  Here is the code.  Any suggestions for improvement are greatly appreciated, especially if you can help with increasing the left hand margin of the plot.  And as always, all the work was done in R.

The most obvious relationship we want to test is Overall Quality vs. Price.  As can be seen from the scatterplot below with a fitted loess curve, there is not a linear relationship between price and quality.

More after the break. Continue reading