Performing Bayesian analysis in Stata using WinBUGS Tom Palmer, John Thompson & Santiago Moreno Department of Health Sciences, University of Leicester, UK 13 th UK Stata Users Group Meeting, 10 September 2007 Tom Palmer (Leicester) Running WinBUGS from Stata 1 / 24
Outline The Bayesian approach & WinBUGS 1 The winbugsfromstata package 2 How to run an analysis 3 Summary & developments 4 Tom Palmer (Leicester) Running WinBUGS from Stata 2 / 24
The Bayesian approach Bayes Theorem Posterior ∝ Likelihood × prior Tom Palmer (Leicester) Running WinBUGS from Stata 3 / 24
The Bayesian approach Bayes Theorem Posterior ∝ Likelihood × prior Direct probability statements - not frequentist - subjective Tom Palmer (Leicester) Running WinBUGS from Stata 3 / 24
The Bayesian approach Bayes Theorem Posterior ∝ Likelihood × prior Direct probability statements - not frequentist - subjective Complex posterior marginal distributions - estimation via simulation Tom Palmer (Leicester) Running WinBUGS from Stata 3 / 24
The Bayesian approach Bayes Theorem Posterior ∝ Likelihood × prior Direct probability statements - not frequentist - subjective Complex posterior marginal distributions - estimation via simulation Markov chain Monte Carlo (MCMC) methods Tom Palmer (Leicester) Running WinBUGS from Stata 3 / 24
WinBUGS Bayesian statistics using Gibbs sampling Tom Palmer (Leicester) Running WinBUGS from Stata 4 / 24
WinBUGS Bayesian statistics using Gibbs sampling MRC Biostatistics unit http://www.mrc-bsu.cam.ac.uk/bugs Tom Palmer (Leicester) Running WinBUGS from Stata 4 / 24
WinBUGS Bayesian statistics using Gibbs sampling MRC Biostatistics unit http://www.mrc-bsu.cam.ac.uk/bugs Health Economics, Medical Statistics Tom Palmer (Leicester) Running WinBUGS from Stata 4 / 24
WinBUGS Bayesian statistics using Gibbs sampling MRC Biostatistics unit http://www.mrc-bsu.cam.ac.uk/bugs Health Economics, Medical Statistics Disadvantages: data management, post-processing of results, graphics Tom Palmer (Leicester) Running WinBUGS from Stata 4 / 24
The winbugsfromstata package Stata interface to WinBUGS [Thompson et al., 2006] http://www2.le.ac.uk/departments/health-sciences/extranet/ BGE/genetic-epidemiology/gedownload/information Tom Palmer (Leicester) Running WinBUGS from Stata 5 / 24
The winbugsfromstata package Tom Palmer (Leicester) Running WinBUGS from Stata 6 / 24
How to run an analysis Tom Palmer (Leicester) Running WinBUGS from Stata 7 / 24
help winbugs Tom Palmer (Leicester) Running WinBUGS from Stata 8 / 24
Example analysis: Schools Schools example [Goldstein et al., 1993],[Spiegelhalter et al., 2004] Tom Palmer (Leicester) Running WinBUGS from Stata 9 / 24
Example analysis: Schools Schools example [Goldstein et al., 1993],[Spiegelhalter et al., 2004] Between-school variation in exam results from inner London schools Tom Palmer (Leicester) Running WinBUGS from Stata 9 / 24
Example analysis: Schools Schools example [Goldstein et al., 1993],[Spiegelhalter et al., 2004] Between-school variation in exam results from inner London schools Standardized mean scores ( Y ) 1,978 pupils, 38 schools Tom Palmer (Leicester) Running WinBUGS from Stata 9 / 24
Example analysis: Schools Schools example [Goldstein et al., 1993],[Spiegelhalter et al., 2004] Between-school variation in exam results from inner London schools Standardized mean scores ( Y ) 1,978 pupils, 38 schools LRT: London Reading Test, VR: verbal reasoning, Gender intake of school, denomination of school Tom Palmer (Leicester) Running WinBUGS from Stata 9 / 24
Data for the Schools example Tom Palmer (Leicester) Running WinBUGS from Stata 10 / 24
Recommend
More recommend