480 likes | 613 Views
Part 05: Basic Bayes. TOXOPLASMOSIS RATES (centered). The essential Bayes/Frequentist difference. As a Bayesian you can say, “Conditional on the data, the probability that the parameter is in the interval is 0.95” (you’ve always wanted to be able to say this!). SURGICAL
E N D
Part 05: Basic Bayes BIO656--Multilevel Models
TOXOPLASMOSIS RATES (centered) BIO656--Multilevel Models
The essential Bayes/Frequentist difference • As a Bayesian you can say, “Conditional on the data, • the probability that the parameter is in the interval is 0.95” • (you’ve always wanted to be able to say this!) BIO656--Multilevel Models
SURGICAL Hospital # of ops # of deaths A [1] 47 0 B 148 18 C 119 8 D 810 46 E 211 8 F 196 13 G 148 9 H 215 31 I 207 14 J 97 8 K 256 29 L 360 24 BIO656--Multilevel Models
“Surgical” Beta-Binomial Model (no combining; stand alone) model { for( i in 1 : N ) { p[i] ~ dbeta(1.0, 1.0) #need to specify the prior r[i] ~ dbin(p[i], n[i]) } righttail<-step(p[1]-3/n[1]) } # Also run with p[i] ~ dbeta(0.25,0.25) BIO656--Multilevel Models
“Surgical” Results for p[1] (no combining; stand alone) Beta mean sd 2.5% median 97.5% (1,1) 0.020 0.019 0.0003 0.0006 0.014 (.25,.25) 0.005 0.010 0.0002 0.0010 0.034 MLE 0 0.078 Beta(.25, .25) Beta(1,1) BIO656--Multilevel Models
Allows learning about the prior BIO656--Multilevel Models
“Surgical” Beta-binomial model (combine evidence; “estimate” the prior) model {for( i in 1 : N ) { b[i] ~ dnorm(mu,tau) # tau = 1/var r[i] ~ dbin(p[i],n[i]) logit(p[i]) <- b[i] } popmn <- exp(mu) / (1 + exp(mu)) mu ~ dnorm(0.0,1.0E-6) sigma <- 1 / sqrt(tau) tau ~ dgamma(alphatau, betatau) mutau<-1 alphatau<-.001 betatau<-alphatau/mutau } BIO656--Multilevel Models
“Surgical” Results (combine evidence) node mean sd 2.5% median 97.5% popmn 0.073 0.010 0.053 0.073 0.095 p[1] 0.053 0.020 0.018 0.052 0.094 BIO656--Multilevel Models
“Surgical” Results for p[1] (stand alone & combine) Beta mean sd 2.5% median 97.5% Comb 0.053 0.020 0.0180 0.0520 0.094 (1,1) 0.020 0.019 0.0003 0.0006 0.014 (.25,.25) 0.005 0.010 0.0002 0.0010 0.034 MLE 0 0.078 .25, .25 1,1 Comb BIO656--Multilevel Models
BACK TO HISTORICAL CONTROLS BIO656--Multilevel Models
BLOCKER Study deaths/n Treated Control 1 3/38 3/39 2 7/114 14/116 3 5/69 11/93 4 102/1533 27/1520 ..... 20 32/209 40/218 21 27/391 43/364 22 22/680 39/674 BIO656--Multilevel Models
delta = BIO656--Multilevel Models
Meta Analysis on the control probability (pc) (Historical Controls) model { for( i in 1 : Num ) { rc[i] ~ dbin(pc[i], nc[i]) rt[i] ~ dbin(pt[i], nt[i]) logit(pc[i]) <- mu[i] logit(pt[i]) <- mu[i] + delta[i] mu[i] ~ dnorm(d, tau) delta[i] ~ dnorm(0.0,1.0E-5) } d ~ dnorm(0.0,1.0E-6) mutau<-1 alphatau<-.0001 betatau<-alphatau/mutau tau ~ dgamma(alphatau, betatau) delta.new ~ dnorm(d, tau) sigma <- 1 / sqrt(tau) } BIO656--Multilevel Models
Meta Analysis on delta = log(OR) model { for( i in 1 : Num ) { rc[i] ~ dbin(pc[i], nc[i]) rt[i] ~ dbin(pt[i], nt[i]) logit(pc[i]) <- mu[i] logit(pt[i]) <- mu[i] + delta[i] mu[i] ~ dnorm(0.0,1.0E-5) delta[i] ~ dnorm(d, tau) } d ~ dnorm(0.0,1.0E-6) mutau<-1 alphatau<-.0001 betatau<-alphatau/mutau tau ~ dgamma(alphatau, betatau) delta.new ~ dnorm(d, tau) sigma <- 1 / sqrt(tau) } BIO656--Multilevel Models
Blocker MLE: pc = 0.079, pt = 0.077, delta = -0.28 Meta-analysis on delta node mean sd 2.5% median 97.5% pc[1] 0.08684 0.03338 0.03255 0.08207 0.1623 pt[1] 0.06883 0.02772 0.0256 0.06517 0.1321 delta[1] -0.2441 0.126 -0.4995 -0.2479 0.03553 Meta-analysis on pc node mean sd 2.5% median 97.5% pc[1] 0.09164 0.03144 0.04031 0.08749 0.164 pt[1] 0.07797 0.04282 0.01743 0.07022 0.1779 delta[1] -0.2504 0.762 -1.846 -0.2192 1.13 BIO656--Multilevel Models
Summary Carefully specified and applied, the Bayesian approach is very effective in • Structuring designs and analyses • Structuring complicated models and goals • we’ll see more of this in ranking • Incorporating all relevant uncertainties • Improving estimates • Communicating in a more “scientific” manner However, • The approach is no panacea and must be used carefully • Traditional values still apply Space-age methods will not rescue stone-age data BIO656--Multilevel Models