2006 Hopkins Epi-Biostat Summer Institute1 Module 2: Bayesian Hierarchical Models Instructor: Elizabeth Johnson Course Developed: Francesca Dominici and.

Slides:



Advertisements
Similar presentations
Questions From Yesterday
Advertisements

Lecture 9 Model Comparison using MCMC and further models.
Hierarchical Linear Modeling: An Introduction & Applications in Organizational Research Michael C. Rodriguez.
Lecture 11 (Chapter 9).
Statistical Analysis Overview I Session 2 Peg Burchinal Frank Porter Graham Child Development Institute, University of North Carolina-Chapel Hill.
Objectives 10.1 Simple linear regression
Psychology 290 Special Topics Study Course: Advanced Meta-analysis April 7, 2014.
1 SSS II Lecture 1: Correlation and Regression Graduate School 2008/2009 Social Science Statistics II Gwilym Pryce
Lecture 6 (chapter 5) Revised on 2/22/2008. Parametric Models for Covariance Structure We consider the General Linear Model for correlated data, but assume.
2005 Hopkins Epi-Biostat Summer Institute1 Module 2: Bayesian Hierarchical Models Francesca Dominici Michael Griswold The Johns Hopkins University Bloomberg.
Lecture 4 Linear random coefficients models. Rats example 30 young rats, weights measured weekly for five weeks Dependent variable (Y ij ) is weight for.
2005 Hopkins Epi-Biostat Summer Institute1 Module I: Statistical Background on Multi-level Models Francesca Dominici Michael Griswold The Johns Hopkins.
The Simple Linear Regression Model: Specification and Estimation
School of Veterinary Medicine and Science Multilevel modelling Chris Hudson.
QUANTITATIVE DATA ANALYSIS
Longitudinal Experiments Larry V. Hedges Northwestern University Prepared for the IES Summer Research Training Institute July 28, 2010.
Violations of Assumptions In Least Squares Regression.
Heterogeneity in Hedges. Fixed Effects Borenstein et al., 2009, pp
1 Module III: Profiling Health Care Providers – A Multi-level Model Application Francesca Dominici & Michael Griswold.
Chapter 12 Section 1 Inference for Linear Regression.
Department of Geography, Florida State University
Standard error of estimate & Confidence interval.
Analysis of Clustered and Longitudinal Data
Introduction to Multilevel Modeling Using SPSS
Statistical Analysis & Techniques Ali Alkhafaji & Brian Grey.
Prediction concerning Y variable. Three different research questions What is the mean response, E(Y h ), for a given level, X h, of the predictor variable?
Lecture 2 Basic Bayes and two stage normal normal model…
From GLM to HLM Working with Continuous Outcomes EPSY 5245 Michael C. Rodriguez.
Chapter 11: Estimation Estimation Defined Confidence Levels
Model Inference and Averaging
Bayesian Inference, Basics Professor Wei Zhu 1. Bayes Theorem Bayesian statistics named after Thomas Bayes ( ) -- an English statistician, philosopher.
Montecarlo Simulation LAB NOV ECON Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.
Bayesian inference review Objective –estimate unknown parameter  based on observations y. Result is given by probability distribution. Bayesian inference.
Estimating parameters in a statistical model Likelihood and Maximum likelihood estimation Bayesian point estimates Maximum a posteriori point.
Introduction Multilevel Analysis
+ Chapter 12: Inference for Regression Inference for Linear Regression.
Incorporating heterogeneity in meta-analyses: A case study Liz Stojanovski University of Newcastle Presentation at IBS Taupo, New Zealand, 2009.
Bayesian Analysis and Applications of A Cure Rate Model.
Multilevel Data in Outcomes Research Types of multilevel data common in outcomes research Random versus fixed effects Statistical Model Choices “Shrinkage.
Introduction to Multilevel Modeling Stephen R. Porter Associate Professor Dept. of Educational Leadership and Policy Studies Iowa State University Lagomarcino.
Topic 10 - Linear Regression Least squares principle - pages 301 – – 309 Hypothesis tests/confidence intervals/prediction intervals for regression.
Inference for Regression Simple Linear Regression IPS Chapter 10.1 © 2009 W.H. Freeman and Company.
+ Chapter 12: More About Regression Section 12.1 Inference for Linear Regression.
2006 Summer Epi/Bio Institute1 Module IV: Applications of Multi-level Models to Spatial Epidemiology Instructor: Elizabeth Johnson Lecture Developed: Francesca.
Stat 112: Notes 2 Today’s class: Section 3.3. –Full description of simple linear regression model. –Checking the assumptions of the simple linear regression.
Lecture 3 Linear random intercept models. Example: Weight of Guinea Pigs Body weights of 48 pigs in 9 successive weeks of follow-up (Table 3.1 DLZ) The.
Latent Growth Modeling Byrne Chapter 11. Latent Growth Modeling Measuring change over repeated time measurements – Gives you more information than a repeated.
September 18-19, 2006 – Denver, Colorado Sponsored by the U.S. Department of Housing and Urban Development Conducting and interpreting multivariate analyses.
Multi-level Models Summer Institute 2005 Francesca Dominici Michael Griswold The Johns Hopkins University Bloomberg School of Public Health.
The generalization of Bayes for continuous densities is that we have some density f(y|  ) where y and  are vectors of data and parameters with  being.
Chapter 8: Simple Linear Regression Yang Zhenlin.
December 2010T. A. Louis: Basic Bayes 1 Basic Bayes.
4 basic analytical tasks in statistics: 1)Comparing scores across groups  look for differences in means 2)Cross-tabulating categoric variables  look.
G Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation.
Parameter Estimation. Statistics Probability specified inferred Steam engine pump “prediction” “estimation”
Biostatistics Regression and Correlation Methods Class #10 April 4, 2000.
Statistical Concepts Basic Principles An Overview of Today’s Class What: Inductive inference on characterizing a population Why : How will doing this allow.
Hierarchical models. Hierarchical with respect to Response being modeled – Outliers – Zeros Parameters in the model – Trends (Us) – Interactions (Bs)
CHAPTER 6: SAMPLING, SAMPLING DISTRIBUTIONS, AND ESTIMATION Leon-Guerrero and Frankfort-Nachmias, Essentials of Statistics for a Diverse Society.
Multiple Regression.
Analysis for Designs with Assignment of Both Clusters and Individuals
Module 2: Bayesian Hierarchical Models
Topic 10 - Linear Regression
Bayesian data analysis
B&A ; and REGRESSION - ANCOVA B&A ; and
Linear Mixed Models in JMP Pro
Multiple Regression.
From GLM to HLM Working with Continuous Outcomes
An Introductory Tutorial
Presentation transcript:

2006 Hopkins Epi-Biostat Summer Institute1 Module 2: Bayesian Hierarchical Models Instructor: Elizabeth Johnson Course Developed: Francesca Dominici and Michael Griswold The Johns Hopkins University Bloomberg School of Public Health

2006 Hopkins Epi-Biostat Summer Institute2 Key Points from yesterday “Multi-level” Models:  Have covariates from many levels and their interactions  Acknowledge correlation among observations from within a level (cluster) Random effect MLMs condition on unobserved “latent variables” to describe correlations Random Effects models fit naturally into a Bayesian paradigm Bayesian methods combine prior beliefs with the likelihood of the observed data to obtain posterior inferences

2006 Hopkins Epi-Biostat Summer Institute3 Bayesian Hierarchical Models Module 2:  Example 1: School Test Scores The simplest two-stage model WinBUGS  Example 2: Aww Rats A normal hierarchical model for repeated measures WinBUGS

2006 Hopkins Epi-Biostat Summer Institute4 Example 1: School Test Scores

2006 Hopkins Epi-Biostat Summer Institute5 Testing in Schools Goldstein et al. (1993) Goal: differentiate between `good' and `bad‘ schools Outcome: Standardized Test Scores Sample: 1978 students from 38 schools  MLM: students (obs) within schools (cluster) Possible Analyses: 1. Calculate each school’s observed average score 2. Calculate an overall average for all schools 3. Borrow strength across schools to improve individual school estimates

2006 Hopkins Epi-Biostat Summer Institute6 Testing in Schools Why borrow information across schools?  Median # of students per school: 48, Range:  Suppose small school (N=3) has: 90, 90,10 (avg=63)  Suppose large school (N=100) has avg=65  Suppose school with N=1 has: 69 (avg=69)  Which school is ‘better’?  Difficult to say, small N  highly variable estimates  For larger schools we have good estimates, for smaller schools we may be able to borrow information from other schools to obtain more accurate estimates  How? Bayes

2006 Hopkins Epi-Biostat Summer Institute7 Testing in Schools: “Direct Estimates” Model: E(Y ij ) =  j =  + b * j Mean Scores & C.I.s for Individual Schools  b*jb*j

2006 Hopkins Epi-Biostat Summer Institute8 Standard Normal regression models:  ij ~ N(0,  2 ) 1.Y ij =  +  ij 2.Y ij =  j +  ij =  + b * j +  ij Fixed and Random Effects  j = X (overall avg)  j = X j (school avg) = X + b* j = X + (X j – X) Fixed Effects

2006 Hopkins Epi-Biostat Summer Institute9 Standard Normal regression models:  ij ~ N(0,  2 ) 1.Y ij =  +  ij 2.Y ij =  j +  ij =  + b * j +  ij A random effects model: 3. Y ij | b j =  + b j +  ij, with: b j ~ N(0,  2 ) Random Effects Fixed and Random Effects  j = X (overall avg)  j = X j (shool avg) = X + b* j = X + (X j – X) Fixed Effects Represents Prior beliefs about similarities between schools!

2006 Hopkins Epi-Biostat Summer Institute10 Standard Normal regression models:  ij ~ N(0,  2 ) 1.Y ij =  +  ij 2.Y ij =  j +  ij =  + b * j +  ij A random effects model: 3. Y ij | b j =  + b j +  ij, with: b j ~ N(0,  2 ) Random Effects  Estimate is part-way between the model and the data  Amount depends on variability (  ) and underlying truth (  ) Fixed and Random Effects  j = X (overall avg)  j = X j (shool avg)  j = X + b j blup = X + b* j = X + (X j – X) = X + b* j = X + (X j – X) Fixed Effects

2006 Hopkins Epi-Biostat Summer Institute11 Testing in Schools: Shrinkage Plot  b*jb*j bjbj

2006 Hopkins Epi-Biostat Summer Institute12 Testing in Schools: Winbugs Data: i= (students), s=1…38 (schools) Model:  Y is ~Normal(  s,  2 y )   s ~ Normal( ,  2  )(priors on school avgs) Note: WinBUGS uses precision instead of variance to specify a normal distribution! WinBUGS:  Y is ~Normal(  s,  y ) with:  2 y = 1 /  y   s ~ Normal( ,   ) with:  2  = 1 /  

2006 Hopkins Epi-Biostat Summer Institute13 Testing in Schools: Winbugs WinBUGS Model:  Y is ~Normal(  s,  y ) with:  2 y = 1 /  y   s ~ Normal( ,   ) with:  2  = 1 /     y ~  (0.001,0.001) (prior on precision) Hyperpriors  Prior on mean of school means  ~ Normal( 0, 1/ )  Prior on precision (inv. variance) of school means   ~  (0.001,0.001) Using “Vague” / “Noninformative” Priors

2006 Hopkins Epi-Biostat Summer Institute14 Testing in Schools: Winbugs Full WinBUGS Model:  Y is ~ Normal(  s,  y ) with:  2 y = 1 /  y   s ~ Normal( ,   ) with:  2  = 1 /     y ~  (0.001,0.001)   ~ Normal(0, 1/ )    ~  (0.001,0.001)

2006 Hopkins Epi-Biostat Summer Institute15 Testing in Schools: Winbugs WinBUGS Code: model { for( i in 1 : N ) { Y[i] ~ dnorm(mu[i],y.tau) mu[i] <- alpha[school[i]] } for( s in 1 : M ) { alpha[s] ~ dnorm(alpha.c, alpha.tau) } y.tau ~ dgamma(0.001,0.001) sigma <- 1 / sqrt(y.tau) alpha.c ~ dnorm(0.0,1.0E-6) alpha.tau ~ dgamma(0.001,0.001) }

2006 Hopkins Epi-Biostat Summer Institute16 Lets fit this one together! All the “model”, “data” and “inits” files are now posted on the course webpage for you to use for practice! Testing in Schools: Winbugs

2006 Hopkins Epi-Biostat Summer Institute17 Example 2: Aww, Rats… A normal hierarchical model for repeated measures

2006 Hopkins Epi-Biostat Summer Institute18 Improving individual-level estimates Gelfand et al (1990) 30 young rats, weights measured weekly for five weeks Dependent variable (Y ij ) is weight for rat “i” at week “j” Data: Multilevel: weights (observations) within rats (clusters)

2006 Hopkins Epi-Biostat Summer Institute19 Individual & population growth Pop line (average growth) Individual Growth Lines Rat “i” has its own expected growth line: E(Y ij ) = b 0i + b 1i X j There is also an overall, average population growth line: E(Y ij ) =  0 +  1 X j Weight Study Day (centered)

2006 Hopkins Epi-Biostat Summer Institute20 Improving individual-level estimates Possible Analyses 1. Each rat (cluster) has its own line: intercept= b i0, slope= b i1 2. All rats follow the same line: b i0 =  0, b i1 =  1 3. A compromise between these two: Each rat has its own line, BUT… the lines come from an assumed distribution E(Y ij | b i0, b i1 ) = b i0 + b i1 X j b i0 ~ N(  0,  0 2 ) b i1 ~ N(  1,  1 2 ) “Random Effects”

2006 Hopkins Epi-Biostat Summer Institute21 Pop line (average growth) Bayes-Shrunk Individual Growth Lines A compromise: Each rat has its own line, but information is borrowed across rats to tell us about individual rat growth Weight Study Day (centered)

2006 Hopkins Epi-Biostat Summer Institute22 Rats: Winbugs (see help: Examples Vol I) WinBUGS Model:

2006 Hopkins Epi-Biostat Summer Institute23 Rats: Winbugs (see help: Examples Vol I) WinBUGS Code:

2006 Hopkins Epi-Biostat Summer Institute24 Rats: Winbugs (see help: Examples Vol I) WinBUGS Results: updates

2006 Hopkins Epi-Biostat Summer Institute25 Interpretation of the results: Primary parameter of interest is beta.c Our estimate is (95% Interval: – 6.394) We estimate that a “typical” rat’s weight will increase by 6.2 gm/day Among rats with similar “growth influences”, the average weight will increase by 6.2 gm/day 95% Interval for the expected growth for a rat is – gm/day

2006 Hopkins Epi-Biostat Summer Institute26 WinBUGS Diagnostics: MC error tells you to what extent simulation error contributes to the uncertainty in the estimation of the mean. This can be reduced by generating additional samples. Always examine the trace of the samples. To do this select the history button on the Sample Monitor Tool. Look for:  Trends  Correlations

2006 Hopkins Epi-Biostat Summer Institute27 Rats: Winbugs (see help: Examples Vol I) WinBUGS Diagnostics: history

2006 Hopkins Epi-Biostat Summer Institute28 WinBUGS Diagnostics: Examine sample autocorrelation directly by selecting the ‘auto cor’ button. If autocorrelation exists, generate additional samples and thin more.

2006 Hopkins Epi-Biostat Summer Institute29 Rats: Winbugs (see help: Examples Vol I) WinBUGS Diagnostics: autocorrelation

2006 Hopkins Epi-Biostat Summer Institute30 Bayes-Shrunk Growth Lines WinBUGS provides machinery for Bayesian paradigm “shrinkage estimates” in MLMs Pop line (average growth) Weight Study Day (centered) Pop line (average growth) Study Day (centered) Weight Individual Growth Lines Bayes

2006 Hopkins Epi-Biostat Summer Institute31 School Test Scores Revisited

2006 Hopkins Epi-Biostat Summer Institute32 Testing in Schools revisited Suppose we wanted to include covariate information in the school test scores example Student-level covariates  Gender  London Reading Test (LRT) score  Verbal reasoning (VR) test category (1, 2 or 3, where 1 represents the highest level of understanding) School -level covariates  Gender intake (all girls, all boys or mixed)  Religious denomination (Church of England, Roman Catholic, State school or other)

2006 Hopkins Epi-Biostat Summer Institute33 Testing in Schools revisited Model Wow! Can YOU fit this model? Yes you can! See WinBUGS>help>Examples Vol II for data, code, results, etc. More Importantly: Do you understand this model?

2006 Hopkins Epi-Biostat Summer Institute34 Additional Comments: Y is actually standardized score (difference from expected norm in standard deviations) What are the fixed effects in the model?  The β are the fixed effects (measured both at the school and student level)  Assume these are independent normal

2006 Hopkins Epi-Biostat Summer Institute35 What are the random effects in the model?  The α are the random effects (at the school level)  Assume these are multivariate normal  These may represent a) inherent school differences (random intercept) b) inherent school difference in terms of LRT and c) inherent school differences in terms of VR test  Fixed effects interpretations are conditional on schools where these random effects are similar. In this example we also put a model on the overall variance: we assume that the inverse of the between-pupil variance will increase linearly with LRT score Additional Comments:

2006 Hopkins Epi-Biostat Summer Institute36 Some results:

2006 Hopkins Epi-Biostat Summer Institute37 Gamma[1] to Gamma[3] represent the means of the random effects distributions Gamma[1] is the mean of the random intercept distribution; hard to interpret in this case Gamma[2] is the mean of the random effect of LRT  Among children from schools with similar latent effects, a one unit increase in LRT yeilds a 0.03 standard deviation increase in the child’s test score. Some results:

2006 Hopkins Epi-Biostat Summer Institute38 Gamma[3] is the mean of the random effect for the VR test. Among children from schools with similar latent effects, children with the highest VR scores have test scores that are on average 0.95 standard deviations greater than children with the lowest VR scores (95% CI: 0.78 – 1.12) Among children from schools with similar latent effects, children with the “moderate” VR scores have test scores that are on average 0.42 standard deviations greater than children with the lowest VR scores (95% CI: 0.29 – 0.54). Some results:

2006 Hopkins Epi-Biostat Summer Institute39 Among children from similar schools, girls have average test scores that are 0.17 standard deviation greater than boys (95% CI: 0.08 – 0.27) Among similar schools, all girls schools have average test scores that are 0.12 standard deviations greater than mixed schools (95% CI: – 0.37) Some results:

2006 Hopkins Epi-Biostat Summer Institute40 Bayesian Concepts Frequentist: Parameters are “the truth” Bayesian: Parameters have a distribution “Borrow Strength” from other observations “Shrink Estimates” towards overall averages Compromise between model & data Incorporate prior/other information in estimates Account for other sources of uncertainty Posterior  Likelihood * Prior