Statistical programs in PH250B

There is no requirement to use or download a statistical program for 250B. The Stata and R labs are provided solely as a supplimentary learning resource; sometimes concepts are better understood when applying them to real data. Also, many other public health classes, and GSR positions, require the use of Stata or R, the earlier the introduction, the better. Even if you don’t try and learn Stata/R this term, we want to provide these tutorials in case you’d like to learn in the future. Additionally, there is an extra credit assignment that can add 3% of your grade if you apply the stata/R lessons to a final data analysis project (to be given later).



R versus Stata: which should you choose?

Both R and Stata are statistical computing programs used in the School of Public Health at UC Berkeley. Stata costs money and is closed source, while R is open sourced and free. Both have their pro’s and con’s and many researchers use both. Some UC Berkeley public health classes use R in lab, especially in the biostatistics department, and some use Stata. There are other statistical programs (SAS, SPSS), but those tend not to be used as much at UC Berkeley (in my experience).


Stata is probably easier to learn, with simpler and more intuitive commands. I find myself getting a lot less inexplicable errors in Stata as opposed to R. However, R is more flexible, with many powerful user-written packages not available in Stata. If you plan on doing lots of advanced, new, or non-standard statistics in the future, R may be the program to choose. If you plan to mainly use a statistical program for data cleaning and standard Epidemiology analysis, Stata may be the program to choose. If you are expecting a data-analysis heavy research path in epidemiology, learning both would be very useful. Additional reading on the subject:



R Install Guides

  • First install R.
  • Second, install R-studio. You do not need to install R-studio to use R, but it is highly recommended; it provides as much-improved graphical user interface (GUI) and some additional tools. Once you have installed R and then R-studio, you only ever need to open R-studio to interface with the R language.



Stata Install Guides



R resources

For new users of R, the following sources are helpful learning resources:



Stata resources