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.
Weekly Assignments
| Week 1: | Basics of Emacs and an introduction to R | Assignment | demonstration.r | (extra) ESS mode |
| Week 2: | R, Emacs, ssh, X11, rsync and LaTeX on your personal computer. For Mac | For windows |
| 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: | Graphics Assignment | demonstraton.r 2232 Piedmont cave paintings |
| 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 |
| Week 11: |
Proportional hazard simulation extentions
Assignment |
demonstration |
Alternate assigment: review of R basics | Answers to Alternate assigment |
| 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.
- 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.
carlm@demog.berkeley.edu