# Statistics and Programming Tutorials

From my point of view I am only interested in three languages for stats, R, Python and Excel. Excel I won’t cover here, but there are many fine books on it on Amazon.

R and Python are free open source languages. R is a language for statistics, whilst Python is a more general purpose programming language.

I prefer the syntax of Python over R any day, but for statistical modelling and making pretty graphs, R has a great mindshare.

## Books about Python and statistics

Think Bayes – *Think Bayes* is an introduction to Bayesian statistics using computational methods. This version of the book is a rough draft. The author is making the draft available for comments, but it comes with the warning that it is probably full of errors.

Think Stats: Probability and Statistics for Programmers – *Think Stats* emphasizes simple techniques you can use to explore real data sets and answer interesting questions. *Think Stats* is based on a Python library for probability distributions (PMFs and CDFs). Many of the exercises use short programs to run experiments and help readers develop understanding. Most introductory books don’t cover Bayesian statistics, but *Think Stats* is based on the idea that Bayesian methods are too important to postpone. By taking advantage of the PMF and CDF libraries, it is possible for beginners to learn the concepts and solve challenging problems.

Think Python: How to Think Like a Computer Scientist – *Think Python* is an introduction to Python programming for beginners.

## R

R is used a lot in academia and science. A lot of online stats courses use R for teaching statistics.

A Crash Course in R | (R news & tutorials)– *single program with many examples of syntax*

Getting staRted with R. | (R news & tutorials) – *lots of links to good tutorials*

twotorials by anthony damico – *excellent tutorial screencasts on R*

Flowingdata Tutorials – *Flowing data is a great site, not just for R, but statistics and presentation in general*

The Guerilla Guide to R – *It’s basically a number of Stack Overflow links organized and ordered in a way to help R programmers learn their way to the next level. If you are proficient in R, I hope these resources will help you get closer to being amazing. If you are just getting started with R, I’d suggest adding this page to your bookmarks and returning when you are familiar with the basics of R programming.*

*This “book” essentially writes itself since most of the experts (and peer-reviewers) are answering the questions. Most of the questions are “real-world” and are asked by novice or intermediate programmers.*

### Books

IPSUR – Introduction to Probability and Statistics Using R – *a textbook written for an undergraduate course in probability and statistics.*

Learning Statistics with R | Computational Cognitive Science Lab – *A free book form the university of Adelaide, designed for an introductory statistics class for psychology students, using the R statistical package as the primary tool *

Introduction to Data Science – *This book provides non-technical readers with a gentle introduction to essential concepts and activities of data science. For more technical readers, the book provides explanations and code for a range of interesting applications using the open source R language for statistical computing and graphics.*

*Available in PDF and ibook format *

# Python 2.7.3

I am now relearning statistics, oh what an exciting life I lead.

Since no learning is complete without procrastination, I though I would learn Python first.

Python is actually related b/c it is an ideal vehicle to screen scrape websites to get data for statistical analysis. And if you are so inclined you can use python for stats itself (SciPy, NumPy) as well as making pretty graphs.

Anyway, the latest version of Python is 2.7.3 and yes I am aware of version 3, but a lot of the popular modules still do not with with version 3.

Mac OS X 10.7.8 Mountain Lion comes with Python 2.7.2, to upgrade to 2.7.3 I used the following to help:

http://superuser.com/questions/388854/the-suggested-way-to-handle-pipeasy-install-with-homebrew

http://www.insomnihack.com/?p=442

http://www.insomnihack.com/?p=421 (old version of the link above)

http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/

Once I get confident with Python, I might just reinstall everything, but this time using a virtual environment for Python.