Skip to content

Instantly share code, notes, and snippets.

@johnmyleswhite
Created June 22, 2010 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnmyleswhite/447830 to your computer and use it in GitHub Desktop.
Save johnmyleswhite/447830 to your computer and use it in GitHub Desktop.
counts <- read.csv('counts.csv', header = TRUE, sep = '\t')
counts <- transform(counts, logCount = log(Count))
ggplot(counts, aes(x = Length, y = logCount)) +
geom_point() +
geom_smooth(method = 'lm') +
xlab('Length of Entire Word') +
ylab('Log Number of Occurrences of Spelling') +
opts(title = 'How Many O\'s Does It Take to Make a GOL?')
# C = a * e ^ l
# => log(C) = log(a) + l
lm.fit <- lm(logCount ~ Length, data = counts)
summary(lm.fit)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment