R
What is R?
R is a programming language and software environment for statistical computing and graphics. To find out more check out the R FAQ or see What is R?.
How do I get R?
Getting R is easy - it's available on all major platforms. This link checks what operating system you have running and offers a direct download of the latest version of R.
If you'd like you can instead head to the Comprehensive R Archive Network and download it directly from there.
Getting started with R
There are many, many, many guides and resources on the internet for getting started with R. Some good ones:
- An Introduction to R
- simpleR - Using R for Introductory Statistics
- Using R for Data Analysis and Graphics
- Abbreviations of R Commands Explained: 250+ R Abbreviations
- If you're already familiar with Matlab here's a guide that lists equivalent functionality.
- See what's being done with R over at R-bloggers.
- Quick-R has a nice summary and examples of how basic methods work.
- Learning R gives really detailed examples.
Graphics in R
R can make some pretty amazing graphics. See the following links for instructions and examples.
- The ggplot2 package, is pretty much the gold standard for plotting in R. It takes care of many of the fiddly details and provides a powerful model of graphics that makes it easy to produce complex multi-layered graphics.
- The R Graph Gallery has a bunch of examples of the kinds of plots you can make with R (including source code).
R and Google Visualisations
Intrigued by this article in the SMH, I went and got some data from the RBA and the RBNZ. Using the googleVis package, available on CRAN, I made this chart to compare the value each person holds on average:
Free books on R
Avril Coghlan, a lecturer at University College Cork in Ireland, has written and made available for free three books for students or practitioners new to R who want to use it for multivariate analysis, time series analysis or biomedical statistics. Each book begins with practical advice for installing and using R in general, before diving into their specialized topics:
- A Little Book of R for Multivariate Analysis (pdf) is a simple introduction to multivariate analysis using the R statistics software. It covers topics such as reading and plotting multivariate data, principal components analysis, and linear discriminant analysis.
- A Little Book of R for Biomedical Statistics (pdf) is a simple introduction to biomedical statistics using the R statistics software, with sections on relative risks and odds ratios, dose-response analysis, clinical trial design and meta-analysis.
- A Little Book of R for Time Series (pdf) is a simple introduction to time series analysis using the R statistics software. It includes instruction on how to read and plot time series, time series decomposition, forecasting, and ARIMA models.
Pn, a robust scale estimator in R
This R code implements the basic form of the robust estimator of scale, Pn, outlined in Tarr, G., Müller, S. and Weber, N.C., (2012). A robust scale estimator based on pairwise means. Journal of Nonparametric Statistics, 24(1) 187-19. DOI: 10.1080/10485252.2011.621424
Econometrics in R
There is a growing community of Econometricians using R.
- Econometrics in R is an excellent resource for basic Econometrics and some Financial Time Series.
- The AER package is useful, particularly for instrumental variables.
Why not Excel?
I came across this journal article recently. It provides some interesting results that may help inform your decision about whether or not to use Excel and some background as to why you should use dedicated statistical software such as R.
The last paragraph:
"Finally, as a rule of the thumb, every user should be aware that spreadsheets have serious limitations. Other platforms are advisable, being currently R the most dependable FLOSS (Free/Libre Open Source Software, see Almiron et al. 2009)."
M. G. Almiron, B. Lopes, A. L. C. Oliveira, A. C. Medeiros, and A. C. Frery. On the numerical accuracy of spreadsheets. Journal of Statistical Software, 34(4):1-29, 4 2010.