Here are the
- First, download the latest version of R at: http://cran.r-project.org/. At the top of the page, click on your operating system. If you use Windows, click "base" on the next screen, and then "R-2.6.0-win32.exe" on the final screen. If you use Mac, I think "R-2.6.0.dmg" will serve your needs. Note: The number in the filename will increase as new versions are released. If you use Linux, please see my page on using the Ubuntu operating system as a scientific working environment.
- Second, after you install R with the program you have downloaded, install the following packages: car, RWinEdt (if you have WinEdt already installed), MASS, and foreign. To do this, enter into the R command prompt: install.packages("packageName"), where the double quotes are included and packageName will be replaced by the individual, case-sensitive names of each of these four packages. You may be prompted to select a cran mirror, any of which should be suitable.
- Finally, download the files below--RIntro.pdf and the relevant data files--into a folder you want to work in as you learn R.
- Note: If you ever update your version of R, this is done by downloading and re-installing the newest version, as just described. The major downside of this is the loss of previously installed packages.
Install_Packages_Post_Update.Ris a program by Evan Parker-Stephen that installs commonly-used packages, so it can save you some time after installing R for the first time or re-installing the latest edition.
- The R website, http://www.r-project.org/, which is helpful for downloading R, installing packages, and finding help. Under "Manuals," the document entitled "An Introduction to R" is particularly useful.
notes to my short courseat the Odum Institute. Some examples use human rights data in either Stataor ASCIIformat. My thanks to Luke Keele & Evan Parker-Stephen for sharing earlier notes that contributed heavily to this file.
- An R
- For a more detailed introduction, John Fox's
Introduction to Statistical Computing in Ris excellent.
- For continuing questions about R,
R-Seekand R Wikiare useful online sources.
- If you have the option to submit your R code as a batch to a Linux-based computing cluster, you may find this useful if your code either requires more memory than a desktop computer or if the code runs very slowly.
- Bev Wilson has written a
cheat sheetbased on his use of UNC's Emerald cluster. It explains the commands to use at the terminal to successfully submit your R program.
introductionto graphics in R written by Evan Parker-Stephen.
- Bill Jacoby's website for Blalock Lectures on statistical graphics using the "lattice" package.
- A website with a number of tips and tricks.
Rcolor.pdf& ColorChart.pdfvisually display all of the colors available in R.
- Marco Steenbergen's notes on programming MLE in
Rand Stata. I personally find R more elegant on MLE, but either program can do it. mle_plotting.RThis is example code for deriving an MLE estimator in R and for creating simple graphs, including predicted probabilities of a logit model. teach_figures.RExample code on programming MLE, using the "glm" command, and plotting model output.
- "effects" which John Fox has written several papers about, posted at the following links:
"nlme"Linear and Nonlinear Mixed Effects Models, which performs hierarchical modeling nicely.
"pscl"Political Science Computational Laboratory for Bayesian statistics, particularly ideological scaling.
"MCMCpack"also for Bayesian statistics, offering Bayesian solutions to a wide range of models.
- For time series analysis, Shumway and Stoffer now have a book out entitled
"Time Series Analysis and Its Applications With R Examples".
- The following link offers several
free R books.