Demography 213 Fall 2011
http://www.demog.berkeley.edu/213
Instructor: Carl Mason
carlm@demog.berkeley.edu
MONDAY 1-2 PM (seminar room) and WEDNESDAY 1:00-3:00 PM (basement
computer lab)
2232 Piedmont Ave
Office Hours:
Fri 1-2PM (in the lab)
and/or By Appointment (in my office, Rm 206)
Instructor: Carl Mason
carlm@demog.berkeley.edu
MONDAY 1-2 PM (seminar room) and WEDNESDAY 1:00-3:00 PM (basement
computer lab)
2232 Piedmont Ave
Office Hours:
Fri 1-2PM (in the lab)
and/or By Appointment (in my office, Rm 206)
An introductory course for first year Demography Graduate Students in the use of the Demography Lab. Covers basic Unix skills & computer hygiene, the Emacs editor, 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. 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.
- UC Thesis template (.tex) |
- UC Thesis template bib file (.bib)
- "short" guide to LaTeX
- In class example of minimal paper |
- .bib file for In class example
- 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.
Weekly Assignments
| Week 1: | The "12' Most Important Linux Commands; Introduction to R and Rstudio | 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 |
| Week 8: | Graphics Assignment | demonstraton.r 2232 Piedmont cave paintings |
| Week 9: | Lattice Graphics Project Assignment 9 | demonstraton.r | A tour of trellis |
| Week 10: | lx and proportional hazard simulation assignment | demonstration | code for reading HMD lifetable" |
| Week 11: |
Proportional hazard simulation extentions
Assignment |
demonstration |
|
| Week 12: | Cox Regression Project Assignment | demonstration.r |
| Week 13: |
Writing Your Dissertation (LaTeX)
Assignment |
|
References
Below are some additional (free) documents. Most are slightly out of date, but since they are free it's hard to complain.
carlm@demog.berkeley.edu