Education 401D  Spring 2015
    Multilevel Modeling Using R


David Rogosa Sequoia 224,   rag{AT}stat{DOT}stanford{DOT}edu   Office hours: Thursday 2:10-3
Course web page: http://web.stanford.edu/~rag/ed401d/


From explorecourses
  EDUC 401D: Multilevel Modeling Using R
Multilevel data analysis examples using R. 
Topics include: two-level nested data, growth curve modeling, generalized linear models for counts and categorical data, 
three-level analyses. For more information, see course website: http://web.stanford.edu/~rag/ed401d/
Terms: Spr | Units: 1 | Grading: Satisfactory/No Credit
Instructors: Rogosa, D. (PI) 
*Preliminary* Course Schedule
Five (2hr) mtgs M 3:15 - 5:05 on April 6 13 20 27, May 11  Building 160, Rm 314
 week 1. Introduction: Analyses for two-level nested data  and for longitudinal Data (growth curves)          
 week 2. Additional two-level models for observational data (High School and Beyond ex) and experimental designs.
 week 3. Beyond basic linear models: generalized linear mixed models for counts and categorical outcomes; nonlinear functional forms
 week 4. Three-level analyses (nested data and longitudinal data)    
 week 5. Student presentations of multilevel data analyses  
For the 1-unit enrollment in this short course, students are expected to engage in the four lecture class sessions, and for the fifth session each student makes a short (5-10 min) presentation of a relevant data analysis they have conducted.


Note to auditors. We should have room for auditors.
The Registrar does have a form (no-fee) for faculty, staff, post-docs: Application for Auditor or Permit to Attend (PTA) Status   

Core Sources
Many of the example presented in this short course are described in Examples from Multilevel Software Comparative Reviews Douglas Bates.    Code version of MlmSoftRev
R-package containing mlmRev data examples.     Additional examples in core package lme4
Another set of examples: lmer for SAS PROC MIXED Users Douglas Bates Department of Statistics University of Wisconsin Madison    Data sets from SAS System for Mixed Models
Overviews and additional examples from Doug Bates:
lme4: Mixed-effects modeling with R  February 17, 2010 Springer (chapters). An merged version of Bates book: lme4: Mixed-effects modeling with R January 11, 2010
R Journal intro Fitting linear mixed models in R Using the lme4 package Douglas Bates (pp.27-30)
Collection of all Doug Bates lme4 talks      Fitting linear mixed-effects models using lme4, Journal of Statistical Software Douglas Bates Martin Machler Ben Bolker.       Technical topics: Mixed models in R using the lme4 package Part 4: Theory of linear mixed models
HSB and growth curve examples in  John Fox lme tutorial

A new text provides more infrastructure. This has free access at Stanford via crcnetbase.com      Multilevel Modeling Using R
http://www.crcpress.com/product/isbn/9781466515857
Chapman & Hall/CRC Statistics in the Social and Behavioral Sciences Published:June 23, 2014 by CRC Press
     Journal of Statistical Software Book Review
Book website, including data

For perspective, a blog post by George Michaelides ยท Birkbeck, University of London (April 2014) "I found this list of multilevel in a different discussion and edited/added some of the entries. Probably a bit outdated but still quite comprehensive" .
We will not attempt to explore all these packages.
amer -- Additive mixed models with lme4
arm -- Data Analysis Using Regression and Multilevel/Hierarchical Models
coxme -- Mixed Effects Cox Models
gamm4 -- Generalized additive mixed models using mgcv and lme4
GLMMarp -- Generalized Linear Multilevel Model with AR(p) Errors Package
glmmAK -- Generalized Linear Mixed Models
heavy -- Estimation in the linear mixed model using heavy-tailed distributions
hglm -- hglm is used to fit hierarchical generalized linear models
HGLMMM -- Hierarchical Generalized Linear Models
influence.ME -- Tools for detecting influential data in mixed effects models
kinship -- mixed-effects Cox models, sparse matrices, and modeling
data from large pedigrees
lme4 -- Linear mixed-effects models using S4 classes
lmeSplines -- lmeSplines
lmec -- Linear Mixed-Effects Models with Censored Responses
lmm -- Linear mixed models
longRPart -- Recursive partitioning of longitudinal data using mixed-effects models
MASS -- Main Package of Venables and Ripley's MASS (see function glmmPQL)
MCMCglmm -- MCMC Generalised Linear Mixed Models
MEMSS -- Data sets from Mixed-effects Models in S
mlmRev -- Examples from Multilevel Modelling Software Review
multilevel -- Multilevel Functions
nlme -- Linear and Nonlinear Mixed Effects Models
nlmeODE -- Non-linear mixed-effects modelling in nlme using differential equations
npde -- Normalised prediction distribution errors for nonlinear mixed-effect models
PSM -- Non-Linear Mixed-Effects modelling using Stochastic Differential Equations
pamm -- Power analysis for random effects in mixed models
pedigreemm -- Pedigree-based mixed-effects models
phmm -- Proportional Hazards Mixed-effects Model (PHMM)
RLRsim -- Exact (Restricted) Likelihood Ratio tests for mixed and additive models
glmmADMB -- Mixed models for discrete data in R
OpenMx -- Structural Equation Modeling (can handle multilevel problems)
rjags - interface for JAGS for Bayesian models
rstan - interface for Stan for Bayesian models
glmmBUGS -- Generalised Linear Mixed Models and Spatial Models with BUGS 

Week 1 April 6
1. Introductory Example. Goldstein Exam Data.       UK HS data.   Coed schools exam data
  Stat 209 Gender gap data analysis.  ascii version   scanned class handout
   Ed401D redo: start-to-finish     basic plots
2. Introductory descriptive approaches (Smart First Year Student analyses using lmList, additional plots) for various data structures.

Week 2 April 13
1. Goldstein Exam data (week 1), additional items in Ed401D redo.
2. HSB (High School and Beyond), another two-level, measured outcome analysis.
    a full single Bryk dataset skips over the data manipulation of the Fox tutorial      xyplots session, Bryk data    selected xyplots
     analysis session, Bryk data       side-by-side boxplots, SFYS analysis
     HSB: analysis of covariance on group means        school means dataset, HSB ancova
      Background:       Collection of HSB data analyses from various text sources      A nice teaching document from Indiana that does HSB data with every known statistical package (including lmer)

Week 3 April 20
      nice overview: Generalized Linear Mixed Models   from Encyclopedia of Statistics in Behavioral Science.   
1. Dichotomous outcomes, glmer analysis examples.
  a. Respiratory clinical trial from HSAUR.     Respiratory study R-session (lmList and glmer)
  b. Contraception (Bangladesh) use from Bates review         Rogosa R-session
  c. Test scores (pass/fail outcome) from Ch 8, Multilevel Modeling Using R.    Rogosa R-session
2. Count data outcomes (more glmer examples).
  a. Cardiac Rehab example, Chapter 8, Multilevel Modelling Using R.   Cardiac data check
  b. Count data: Contagious bovine pleuropneumonia, data(cbpp) in lme4.    Rogosa R-session     herd plots
  c. Another count data example from mlmRev package, data(Mmmec): Malignant Melanoma Mortality in the European Community associated with the impact of UV radiation exposure.

Week 4 April 27
1. Three-level (and above) lmer examples.
  a. Achieve data from Multilevel Modeling Using R book.    Rogosa R-session
  b. example from mlmRev package, data(Chem97): Scores on A-level Chemistry in 1997.    Rogosa R-session
2.   Non-linear Models: Example: Orange Tree growth.     Data from MEMSS package Data sets and sample analyses from Pinheiro and Bates, Mixedeffects Models in S and S-PLUS (Springer, 2000).
   Doug Bates Slides Orange trees analysis (pdf pages 8-16), Logistic SS (pdf p.6), pharmacokinetics ex (pdf pages 7, 17-24)   
3. Growth Curve Modeling example from Stat222. Brain Volume Data, in-class modeling exercise: analyses from "Variation in longitudinal trajectories of regional brain volumes of healthy men and women (ages 10 to 85 years) measured with atlas-based parcellation of MRI"     cartoon plot of Lateral Ventricles data;     actual data plot of Lateral Ventricles data;    development of lmer (random effect) growth models
         Additional topics: More model diagnostics; Ecological Inference; Power calculations and Design; Multilevel Survival Analysis.


Week 5 May 11
Student presentations, multilevel analysis example.