Tuesday, January 11, 2011

The market for used iPhones

This beanplot shows the distribution of prices for which used 32GB 3GS iPhones were sold on eBay. A beanplot shows "a density trace, which is mirrored to form a polygon shape." Overlaid is "a one-dimensional scatter plot show[ing] all the individual measurements." When two phones were sold for the same price, the line is twice as wide, and so on.

Here's the R code that produced the plot


price_and_shipping=read.table("iphoneListingsPricesOnly.txt")
allprices= price_and_shipping
$V1+ price_and_shipping$V2
allprices=sort
(allprices)
outlierCount=round
(length(allprices)*.05,0)
prices=allprices
[(outlierCount+1):(length(allprices)-outlierCount)]
library
(beanplot)
png
(filename = "priceDistribution.png")
beanplot
(prices,method="stack",axes=TRUE,what=c(0,1,0,1),log="",main="Beanplot distribution of prices")
dev.off
()

code formatting kludged together from output from Pretty R at inside-R.org -- i had to hack at it to get it to work on blogspot, and that made it uglier than it should be. normally they make (as per the name) pretty stuff.

2 comments:

Pewtherer said...

You should redo this analysis with fun beanplot a few more times as we go through the AT&T-Verizon transition. How much work is it? Cool stuff.

Manduca said...

Billy - I knew you'd like it. It's not really automated. Probably 20 min?