# R code for the Labov et al. (2006) atlas data on LOT ~ THOUGHT, from 
# Gorman and Johnson in press

source('ky.R')
library(plyr)
library(ggplot2)

anae <- read.csv('ANAE.csv')

# plot Euclidean distance vs. Pillai score
png('ANAE.png', width=7, height=6.5, units='in', res=600)
qplot(Euclid, Pillai, shape=Production, ylim=c(0, 1), alpha=I(1/2), xlab='Euclidean distance', ylab='Pillai score', main='Distance metrics for LOT ~ THOUGHT', data=subset(anae, !FullRegion %in% c('Transient', 'New York City'))) + facet_wrap(~FullRegion) + scale_shape_manual(value=c(1, 3, 4)) + theme_bw()
dev.off()
