Example using { t R}: Heart Valves StudyExample using { t R}: Heart Valves StudyExample using { t R}: Heart Valves StudyExample using { t R}: Heart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyHeart Valves StudyAlternate hierarchical modelsAlternate hierarchical modelsAlternate hierarchical modelsAlternate hierarchical modelsPump ExamplePump ExamplePump ExamplePump DataPump ExamplePump ExampleWinBUGS code to fit this modelPump Example ResultsPump Example ResultsPump Example ResultsPK ExamplePK ExamplePK ExamplePK ExamplePK DataPK Data, original scalePK Data, log scalePK ExamplePK ExamplePK ExamplePK Results (WinBUGS vs. Fortran)Lip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleLip Cancer ExampleDataset: Scottish lip cancer dataDataset: Scottish lip cancer dataWinBUGS code to fit this modelLip Cancer ResultsLip Cancer ResultsLip Cancer ResultsInterStim ExampleInterStim ExampleInterStim ExampleInterStim ExampleInterStim ExampleInterStim ExampleInterStim ExampleInterStim ExampleExample using R: Heart Valves StudyGoal: Show that the thrombogenicity rate (TR) is lessthan two times the objective performance criterionR and WinBUGS Examples – p. 1/27Example using R: Heart Valves StudyGoal: Show that the thrombogenicity rate (TR) is lessthan two times the objective performance criterionData: From both the current study and a previous studyon a similar product (St. Jude mechanical valve).R and WinBUGS Examples – p. 1/27Example using R: Heart Valves StudyGoal: Show that the thrombogenicity rate (TR) is lessthan two times the objective performance criterionData: From both the current study and a previous studyon a similar product (St. Jude mechanical valve).Model: Let T be the total number of patient-years offollowup, and θ be the TR per year. We assume thenumber of thrombogenicity events Y ∼ P oisson(θT ):f(y|θ) =e−θT(θT )yy!.R and WinBUGS Examples – p. 1/27Example using R: Heart Valves StudyGoal: Show that the thrombogenicity rate (TR) is lessthan two times the objective performance criterionData: From both the current study and a previous studyon a similar product (St. Jude mechanical valve).Model: Let T be the total number of patient-years offollowup, and θ be the TR per year. We assume thenumber of thrombogenicity events Y ∼ P oisson(θT ):f(y|θ) =e−θT(θT )yy!.Prior: Assume a Gamma(α, β) prior for θ:p(θ) =θα−1e−θ/βΓ(α)βα, θ > 0 .R and WinBUGS Examples – p. 1/27Heart Valves StudyThe gamma prior is conjugate with the likelihood, so theposterior emerges in closed form:p(θ|y) ∝ θy+α−1e−θ(T +1/β)∝ Gamma(y + α, (T + 1/β)−1) .The study objective is met ifP (θ < 2 × OP C | y) ≥ 0.95 ,where OP C = θ0= 0.038.R and WinBUGS Examples – p. 2/27Heart Valves StudyThe gamma prior is conjugate with the likelihood, so theposterior emerges in closed form:p(θ|y) ∝ θy+α−1e−θ(T +1/β)∝ Gamma(y + α, (T + 1/β)−1) .The study objective is met ifP (θ < 2 × OP C | y) ≥ 0.95 ,where OP C = θ0= 0.038.Prior selection: Our gamma prior has mean M = αβand variance V = αβ2. This means that if we specify Mand V , we can solve for α and β asα = M2/V and β = V/M .R and WinBUGS Examples – p. 2/27Heart Valves StudyA few possibilities for prior parameters:R and WinBUGS Examples – p. 3/27Heart Valves StudyA few possibilities for prior parameters:Suppose we set M = θ0= 0.038 and√V = 2θ0(sothat 0 is two standard deviations below the mean).Then α = 0.25 and β = 0.152, a rather vague prior.R and WinBUGS Examples – p. 3/27Heart Valves StudyA few possibilities for prior parameters:Suppose we set M = θ0= 0.038 and√V = 2θ0(sothat 0 is two standard deviations below the mean).Then α = 0.25 and β = 0.152, a rather vague prior.Suppose we set M = 98/5891 = .0166, the overallvalue from the St. Jude studies, and√V = M (so 0is one sd below the mean). Then α = 1 andβ = 0.0166, a moderate (exponential) prior.R and WinBUGS Examples – p. 3/27Heart Valves StudyA few possibilities for prior parameters:Suppose we set M = θ0= 0.038 and√V = 2θ0(sothat 0 is two standard deviations below the mean).Then α = 0.25 and β = 0.152, a rather vague prior.Suppose we set M = 98/5891 = .0166, the overallvalue from the St. Jude studies, and√V = M (so 0is one sd below the mean). Then α = 1 andβ = 0.0166, a moderate (exponential) prior.Suppose we set M = 98/5891 = .0166 again, but set√V = M/2. This is a rather informative prior.R and WinBUGS Examples – p. 3/27Heart Valves StudyA few possibilities for prior parameters:Suppose we set M = θ0= 0.038 and√V = 2θ0(sothat 0 is two standard deviations below the mean).Then α = 0.25 and β = 0.152, a rather vague prior.Suppose we set M = 98/5891 = .0166, the overallvalue from the St. Jude studies, and√V = M (so 0is one sd below the mean). Then α = 1 andβ = 0.0166, a moderate (exponential) prior.Suppose we set M = 98/5891 = .0166 again, but set√V = M/2. This is a rather informative prior.We also consider event counts that are lower (1), aboutthe same (3), and much higher (20) than for St. Jude.R and WinBUGS Examples – p. 3/27Heart Valves StudyA few possibilities for prior parameters:Suppose we set M = θ0= 0.038 and√V = 2θ0(sothat 0 is two standard deviations below the mean).Then α = 0.25 and β = 0.152, a rather vague prior.Suppose we set M = 98/5891 = .0166, the overallvalue from the St. Jude studies, and√V = M (so 0is one sd below the mean). Then α = 1 andβ = 0.0166, a moderate (exponential) prior.Suppose we set M = 98/5891 = .0166 again, but set√V = M/2. This is a rather informative prior.We also consider event counts that are lower (1), aboutthe same (3), and much higher (20) than for St. Jude.The study objective is not met with the “bad” data –unless the posterior is “rescued” by the informative prior(lower right corner, next page).R and WinBUGS Examples – p. 3/27Heart Valves Study0.0 0.05 0.10 0.15 0.200 20 40 60 80 120posteriorpriorM, sd = 0.038 0.076 ; Y = 1P(theta < 2 OPC|y) = 10.0 0.05 0.10 0.15 0.200 20 40 60 80posteriorpriorM, sd = 0.017 0.017 ; Y = 1P(theta < 2 OPC|y) = 10.0 0.05 0.10 0.15 0.200 20 40 60 80posteriorpriorM, sd = 0.017 0.008 ; Y = 1P(theta < 2
View Full Document