# p.249
alice.g <- alice.growth@data$data par(mfrow = c(2,2), bg = "white") plot(log(alice.g$Tokens), log(alice.g$Types)) #
alice.g.lm <- lm( log(alice.g$Types) ~ log(alice.g$Tokens)) abline(alice.g.lm , col = "darkgrey")
# r <- round(summary(alice.g.lm)$adj.r.squared,dig = 3) mtext(expression(paste(R^2, "= 0.998"))) plot(log(alice.g$Tokens), resid(alice.g.lm)) abline(h= 0) mtext("Residuals")
z <- zipf.fnc(alice, plot = T) plot(log(z$rank), log(z$frequency), type = "S") z.lm <- lm(log(z$frequency) ~ log(z$rank)) abline(z.lm, col= "darkgrey") plot( log(z$rank), resid(z.lm)) abline(h= 0) mtext("Residuals")