Demography 213 Fall 2016
An introductory course for first year Demography Graduate Students in the use of the Demography Lab. Covers basic Unix skills & computing hygiene, LaTeX and the R computing environment.
R is the common computing language of the Demography Department and as such, the mastery of R will be an important by-product of the course. The primary purpose of the course, however, is to develop general computing skills-- specifically: (1) design and implementation of algorithms and (2) good computing habits.
Weekly lab assignements will involve simulating interesting population processes and presenting the results in written and oral form. In addition to simulation, we will explore well known datasets such as historical Census, ACS, and the Current Population Survey. There is no final exam.
Since first year students are required to take Demography 110/210 simultaneously, this course complements that course in that it will provide the R background necessary for success.
The course meets once per week for a 1.0 hour lecture/demonstration. In addition there will be a 2.0 hour supervised lab weekly. Substantial work is expected outside of class, Friday afternoons, during my office hour is a particularly good time to do some of it. The texts for this class are
- Introduction to R by W.N. Venables and D.M. Smith. This is terse yet complete document. It is also free to download.
- R in Action by Robert Kabacoff. This is friendlier approach to learning R. It is however, considerably more expensive than the Introduction
- Getting Started with Rstudio by John Verzani. This is licensed by UCB for use by students.
- R in a Nutshell, 2nd Edition . by Joseph Adler. A good overview of R for someone refreshing their skill or perhaps someone who already knows a bunch of other computer languages. NOTE the link should work if you have a UCB ip address e.g. AirBears or a Demography Lab workstation.
- R Graphics Cookbook . by Winston Chang. This book covers the ggplot2 graphics system in an efficient way -- for someone who is familliar with R graphics. If ggplot2 is completely new, then start with the Appendix. NOTE the link should work if you have a UCB ip address e.g. AirBears or a Demography Lab workstation.
- UC Thesis "example" (demonstration.Rnw) |
- bibtex file referenced in UC thesis "example" (galton.bib)
- In Class knitr Example (Rnw) and bib file
- "short" guide to LaTeX
- knitr documentation
- Article about using knitr and Sweave in R studio
- A list of 110 other books about R (or S)
- R reference card [pdf]
- Introduction to R [pdf] The main text of the course.
- R Data Import/Export [pdf] Useful reference for moving data in and out of R
- ESS-Mode by A.J. Rossini, R.M. Heiberger, K. Hornik, and M. Maechler. ESS stands for "emacs speaks statistics" it is the emacs mode that you will use to edit R/Splus SAS and perhaps STATA program files and to run R/Splus in. It assumes you are familiar with how the emacs editor works--you aren't now -- but you will be. [pdf 49 pages]
- Official GNU Emacs Manual In addition to the online tutorial, which is a bit out of date, Free Software Foundation makes this HTML manual available via the Web.
- Emacs Quick Reference This is the official Free Sofware Foundation Emacs cheat sheet.
|Week 1:||The "12' Most Important Linux Commands; a brief Introduction to R and then off to DataCamp | Assignment | demonstration.r | The "twelve" most important Unix commands|
|Week 2:||Coming to Terms with Rstudio | Assignment | Getting Started with Rstudio (UCB library licence)|
|Week 3:||A simulation exercise Assignment | demonstration.r|
|Week 4:||A stochastic simulation. Using loops, branches and functions in R Assignment | demonstraton.r|
|Week 5:||A stochastic micro-simulation; dataframes; more programming and some ways to avoid programming Assignment | demonstraton.r|
|Week 6:||Calculating TFR and Other Rates Using tapply() Assignment | demonstration.r|
|Week 7:||Making Cool Graph of TFRs and Other Rates Assignment | demonstration.r | supsmu example.r | Descriptive statistics example.r|
|Week 8:||Graphics with ggplot2 Assignment | demonstraton.r | ggplot reference | detailed ggplot "cheat sheet"|
|Week 9:||Graphics Assignment | demonstraton.r 2232 Piedmont cave paintings|
|Week 10:||lx and proportional hazard simulation assignment | demonstration | code for reading HMD lifetable"|
Proportional hazard simulation extentions
|Week 12:||Cox Regression Project demonstration.r | Documentation Numerator .dct Denominator .dct|
Writing Your Dissertation (LaTeX)
References[an error occurred while processing this directive]
Below are some additional (free) documents. Most are slightly out of date, but since they are free it's hard to complain.