Created
June 22, 2010 02:18
-
-
Save johnmyleswhite/447830 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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