Digging deep into the system, I have found these files, which I hope are
the right ones.
If I were doing this again, I would use a bivariate normal for the
random effects, as in the
BiRats example in WinBUGS.
Best wishes
David
-----------------------------------------------------
Hi,
Does anyone out there know where can I get the raw data for the example
on
the Gambian Infant Hepatitis B that is being highlighted in the
book "Markov Chain Monte Carlo in Practice" by Gilks, Richardson, and
Spiegelhalter (1996). There is a graphical representation but I need
the
actual data.
-----
list(y = c(4.99721227376411, 8.02812905943176, 6.83087423464618,
4.90527477843843, 6.29526600143965, 3.95124371858143, 4.35670882668959,
6.79794041297493, 5.27299955856375, 4.31748811353631, 4.71849887129509,
3.49650756146648, 4.29045944114839, 5.78996017089725, 3.68887945411394,
3.43398720448515, 6.13122648948314, 3.85014760171006, 6.76272950693188,
3.29583686600433, 6.14846829591765, 5.25749537202778, 5.37527840768417,
10.7579879834538, 10.4925789214972, 5.63121178182137, 4.20469261939097,
3.49650756146648, 3.46573590279973, 1.79175946922805, 2.77258872223978,
7.92479591395644, 7.54750168281497, 6.40687998606931, 9.16115012778541,
8.34236350038058, 7.9483852851119, 8.74257423767064, 7.07580886397839,
6.3919171133926, 5.91079664404053, 5.11198778835654, 5.37989735354046,
6.54678541076052, 4.93447393313069, 5.86929691313377, 2.94443897916644,
3.17805383034795, 7.05272104923232, 6.25382881157547, 5.34233425196481,
0, 7.19067603433221, 9.13905916997122, 7.82724090175281,
8.48260174664662, 7.51697722460432, 4.45434729625351, 7.11963563801764,
5.8348107370626, 6.5424719605068, 7.64300363556072, 6.35610766069589,
6.89365635460264, 9.42294862137501, 8.57073395834427, 8.79026911147866,
8.2553088117856, 7.16394668434255, 7.46278915741245, 4.82028156560504,
3.40119738166216, 3.66356164612965, 6.54678541076052, 5.95583736946483,
4.99721227376411, 8.67470962929122, 7.32383056620232, 8.03040956213048,
7.86326672400957, 7.63385355968177, 7.16006920759613, 4.67282883446191,
3.36729582998647, 3.17805383034795, 7.41878088275079, 6.76157276880406,
6.84587987526405, 8.38845031552351, 6.31535800152233, 5.46383180502561,
9.9219166880045, 3.43398720448515, 1.6094379124341, 2.77258872223978,
7.7553388128465, 7.44366368311559, 7.82803803212583, 9.04239498112674,
6.64768837356333, 7.11151211649616, 8.45212119467252, 6.85118492749374,
7.01481435127554, 7.91425227874244, 6.16961073249146, 6.00881318544259,
7.72885582385254, 9.75214127004149, 9.59703032475801, 9.31433996199467,
8.26359043261732, 6.35957386867238, 5.84643877505772, 2.30258509299405,
0, 2.30258509299405, 8.29354951506035, 7.60589000105312,
10.1017644761202, 8.90082160491523, 6.25958146406492, 7.06561336359772,
8.87905466204227, 8.88391747120797, 11.5129154649202, 8.54286093816481,
8.97575663051942, 8.79618763547045, 7.86095636487639, 7.08757370555797,
8.40155784781731, 6.91075078796194, 7.22256601882217, 8.89370997756851,
7.59588991771854, 7.1800698743028, 7.03174125876313, 2.07944154167984,
4.82028156560504, 2.99573227355399, 2.70805020110221, 5.77765232322266,
3.91202300542815, 3.61091791264422, 6.4707995037826, 5.4510384535657,
4.40671924726425, 5.12989871492307, 3.85014760171006, 8.17413934342947,
7.88419993367604, 7.22766249872866, 2.30258509299405, 2.30258509299405,
0, 9.77104128523582, 9.32892308780313, 9.61767040669386,
6.95081476844258, 10.5472081164337, 8.66905554072548, 5.97635090929793,
5.71042701737487, 5.24174701505964, 5.8805329864007, 6.50128967054039,
5.48479693349065, 5.73979291217923, 5.53338948872752, 4.04305126783455,
5.75574221358691, 4.99043258677874, 5.15329159449778, 3.61091791264422,
8.11761074646623, 7.34729970074316, 6.55250788703459, 8.54636356871602,
8.03138533062553, 7.35115822643069, 7.58171964012531, 6.92264389147589,
6.52502965784346, 6.9037472575846, 6.7202201551353, 5.74939298590825,
4.66343909411207, 3.43398720448515, 3.09104245335832, 7.47986413116503,
6.19236248947487, 3.61091791264422, 3.78418963391826, 4.64439089914137,
4.51085950651685, 2.99573227355399, 4.39444915467244, 3.55534806148941,
3.29583686600433, 8.23509549725836, 7.81116338502528, 7.54855597916987,
6.12905021006055, 6.19847871649231, 4.81218435537242, 8.4424696452203,
3.55534806148941, 2.94443897916644, 6.88755257166462, 5.07517381523383,
7.29233717617388, 7.25417784645652, 6.38856140554563, 6.21460809842219,
5.03043792139244, 8.75998249497728, 7.19593722647557, 6.08677472691231,
4.66343909411207, 2.39789527279837, 4.02535169073515, 3.78418963391826,
2.94443897916644, 4.38202663467388, 2.484906649788, 6.85540879860993,
6.08221891037645, 5.45958551414416, 8.17919979842309, 6.04500531403601,
4.24849524204936, 3.52636052461616, 3.58351893845611, 8.98343977178426,
9.69990150043745, 8.74097653801779, 8.4721958254855, 7.76004068088038,
9.480214825778, 7.78113850984502, 6.1463292576689, 6.289715570909,
5.87493073085203, 9.93542217106647, 9.39806397805913, 9.17294998275762,
4.27666611901606, 5.34710753071747, 3.46573590279973, 5.36597601502185,
5.88887795833288, 3.36729582998647, 4.60517018598809, 5.29831736654804,
3.58351893845611, 3.2188758248682, 4.27666611901606, 7.63867982387611,
6.81783057145415, 3.46573590279973, 6.58479139238572, 7.2152399787301,
5.90808293816893, 5.91889385427315, 5.68357976733868, 5.8171111599632,
8.67641669696422, 7.72179177681754, 6.19031540585315, 2.484906649788,
1.38629436111989, 2.56494935746154, 6.73933662735717, 6.73221070646721,
4.51085950651685, 3.91202300542815, 5.4971682252932, 4.39444915467244,
4.56434819146784, 2.83321334405622, 9.15925758174687, 8.58073121222023,
7.07326971745971, 7.12608727329912, 5.01063529409626, 9.08636319215647,
7.9359451033537), log.time = c(6.5410299991899, 6.96318998587024,
5.8406416573734, 6.52941883826223, 6.98193467715639, 6.60123011872888,
7.02553831463852, 5.8636311755981, 6.51767127291227, 6.96790920180188,
5.91350300563827, 6.5694814204143, 7.00850518208228, 5.91889385427315,
6.5694814204143, 7.00760061395185, 5.87493073085203, 6.97447891102505,
5.82008293035236, 6.56244409369372, 5.91350300563827, 6.5510803350434,
7.00306545878646, 5.98896141688986, 7.0335064842877, 5.95064255258773,
6.59987049921284, 7.00940893270864, 5.75574221358691, 6.65544035036765,
6.9555926083963, 5.92157841964382, 6.70686233660275, 6.98286275146894,
5.93489419561959, 6.63987583382654, 6.9782137426307, 5.91350300563827,
6.63987583382654, 6.9782137426307, 5.97126183979046, 6.55961523749324,
7.00124562206948, 5.97126183979046, 6.60123011872888, 7.00033446027523,
6.59987049921284, 7.00215595440362, 5.92157841964382, 6.68959926917897,
6.96224346426621, 6.71780469502369, 6.98286275146894, 5.92958914338989,
6.56807791141198, 5.92157841964382, 6.71780469502369, 6.98286275146894,
5.92157841964382, 6.54821910276237, 6.98193467715639, 5.92157841964382,
6.54821910276237, 6.98193467715639, 5.92157841964382, 6.54821910276237,
6.98100574072173, 5.8406416573734, 6.54821910276237, 6.98100574072173,
5.89440283426485, 6.49072353450251, 6.95654544315157, 5.93489419561959,
6.70686233660275, 7.00306545878646, 5.93224518744801, 6.56103066589657,
7.0335064842877, 5.96870755998537, 6.52795791762255, 6.94215670569947,
5.8805329864007, 6.56244409369372, 6.97728134163075, 6.62671774924902,
6.94889722231331, 5.87773578177964, 6.54965074223381, 6.98841318199959,
6.59030104819669, 7.00669522683704, 5.92958914338989, 6.56807791141198,
6.98193467715639, 5.92958914338989, 6.56807791141198, 6.98193467715639,
5.86078622346587, 6.55819780281227, 6.97447891102505, 5.89440283426485,
6.59030104819669, 6.98378996525813, 5.95064255258773, 6.51767127291227,
6.97447891102505, 5.93224518744801, 6.70196036600254, 6.97447891102505,
5.97126183979046, 6.60934924316738, 6.57088296233958, 7.01571242048723,
5.93753620508243, 6.5206211275587, 6.97073007814353, 5.87493073085203,
6.56103066589657, 6.97447891102505, 5.89164421182577, 6.59030104819669,
6.98378996525813, 6.74170069465205, 6.98933526597456, 5.89440283426485,
6.5410299991899, 6.98286275146894, 5.94803498918065, 6.5510803350434,
6.99668148817654, 5.77455154554441, 6.49828214947643, 6.95844839329766,
5.97126183979046, 6.54965074223381, 5.96870755998537, 6.58892647753352,
7.01481435127554, 5.8805329864007, 6.59030104819669, 6.98378996525813,
5.89440283426485, 6.5410299991899, 6.98286275146894, 6.62936325343745,
6.98471632011826, 5.93224518744801, 6.62007320653036, 7.03174125876313,
5.99146454710798, 6.63856778916652, 7.04053639021596, 5.88887795833288,
6.59441345974978, 7.02908756414966, 5.93489419561959, 6.61873898351722,
7.04577657687951, 5.94017125272043, 6.62140565176413, 7.05272104923232,
5.95583736946483, 6.62936325343745, 7.05272104923232, 5.93489419561959,
6.61873898351722, 7.04490511712937, 5.92692602597041, 6.61204103483309,
7.04141166379481, 6.64639051484773, 7.04403289727469, 5.93224518744801,
6.62007320653036, 5.96870755998537, 6.64639051484773, 7.03174125876313,
5.93224518744801, 6.64768837356333, 7.028201432058, 5.93224518744801,
6.62007320653036, 7.03174125876313, 5.93224518744801, 6.62671774924902,
7.02731451403978, 5.94542060860658, 6.62140565176413, 7.05272104923232,
5.86929691313377, 6.5875500148248, 6.65801104587075, 7.05875815251866,
5.89715386763674, 6.59714570188665, 7.03174125876313, 6.00881318544259,
6.62936325343745, 7.03966034986208, 5.97126183979046, 6.66568371778241,
7.03878354138854, 5.97126183979046, 6.66440902035041, 7.04403289727469,
5.97126183979046, 6.66440902035041, 7.04403289727469, 6.00881318544259,
7.05185562295589, 6.64639051484773, 7.04403289727469, 5.88610403145016,
6.59167373200866, 7.028201432058, 5.75257263882563, 6.96129604591017,
5.68017260901707, 6.50876913697168, 6.97541392745595, 5.77144112313002,
6.56244409369372, 6.99759598298193, 5.96100533962327, 6.66695679242921,
5.75257263882563, 6.49828214947643, 6.99025650049388, 5.81413053182507,
7.02108396428914, 5.63478960316925, 6.46769872610435, 6.95081476844258,
5.77455154554441, 6.48768401848461, 6.92067150424868, 5.77765232322266,
6.52209279817015, 5.63121178182137, 6.55535689181067, 5.70711026474888,
6.45833828334479, 6.91473089271856, 5.89164421182577, 6.48920493132532,
6.92165818415113, 5.77455154554441, 6.48920493132532, 6.92165818415113,
6.0591231955818, 6.62671774924902, 7.01391547481053, 5.8171111599632,
6.49223983502047, 6.94119005506837, 5.65248918026865, 6.42162226780652,
6.86380339145295, 5.60947179518496, 6.44413125670044, 5.83773044716594,
6.48616078894409, 6.92165818415113, 5.91350300563827, 6.52649485957079,
6.97447891102505, 5.77455154554441, 6.45047042214418, 6.92755790627832,
5.83773044716594, 6.48463523563525, 6.91869521902047, 5.98645200528444,
6.51025834052315, 6.96413561241824, 5.8171111599632, 6.48463523563525,
6.94793706861497, 6.49526555593701, 6.94215670569947, 5.68697535633982,
6.47850964220857, 5.8171111599632, 6.51174532964473, 6.93634273583405,
5.85793315448346, 6.92264389147589), child = c(1, 1, 2, 2, 2, 3, 3, 4,
4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 11, 12, 12,
12, 13, 13, 13, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19,
20, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 26, 26,
26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 31, 31, 31, 33, 33, 33, 34, 34,
34, 35, 35, 36, 36, 36, 37, 37, 38, 38, 38, 39, 39, 39, 42, 42, 42, 43,
43, 43, 44, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 48, 49, 49, 49,
50, 50, 50, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 56, 56,
56, 57, 57, 57, 58, 58, 58, 59, 59, 60, 60, 60, 61, 61, 61, 62, 62, 62,
63, 63, 63, 64, 64, 64, 65, 65, 65, 66, 66, 66, 68, 68, 68, 69, 69, 70,
70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 77, 77,
78, 78, 79, 79, 79, 80, 80, 80, 81, 81, 81, 82, 82, 82, 83, 83, 83, 84,
84, 85, 85, 86, 86, 86, 89, 89, 91, 91, 91, 92, 92, 92, 93, 93, 94, 94,
94, 95, 95, 96, 96, 96, 98, 98, 98, 99, 99, 100, 100, 101, 101, 101,
102, 102, 102, 104, 104, 104, 105, 105, 105, 106, 106, 106, 107, 107,
107, 108, 108, 109, 109, 109, 110, 110, 110, 111, 111, 111, 112, 112,
112, 113, 113, 113, 114, 114, 114, 115, 115, 116, 116, 117, 117, 117,
118, 118), y0 = c(8.61341204915678, 7.10578612948127, 6.89669433162271,
5.63835466933375, 6.35088571671474, 5.03043792139244, 5.8664680569333,
5.73979291217923, 7.07834157955767, 8.56655462095396, 6.86171134048073,
6.97354301952014, 7.34213173058472, 8.82629423124132, 6.48768401848461,
6.66440902035041, 7.0343879299155, 4.49980967033027, 6.85118492749374,
3.04452243772342, 8.63905677917308, 1.79175946922805, 7.01660968389422,
7.09090982207998, 7.42356844425917, 8.09620827165004, 5.70711026474888,
7.01031186730723, 7.18311170174328, 8.15219801586179, 5.99645208861902,
7.0825485693553, 5.06890420222023, 7.04228617193974, 4.0943445622221,
7.32052696227274, 7.12689080889881, 7.24136628332232, 6.62007320653036,
7.36897040219479, 8.47720418319987, 7.20340552108309, 2.89037175789616,
7.39141523467536, 6.25190388316589, 8.38160253710989, 11.5129154649202,
6.60258789218934, 7.61283103040736, 7.42476176182321, 6.71174039505618,
5.56068163101553, 6.0282785202307, 7.10085190894405, 7.52671756135271,
7.92948652331429, 1.6094379124341, 6.85856503479136, 8.05006542291597,
5.83188247728352, 7.15851399732932, 7.01481435127554, 7.70120018085745,
7.16239749735572, 5.99893656194668, 5.41610040220442, 8.40782465436087,
7.18462915271731, 3.25809653802148, 8.14380797677148, 5.24702407216049,
5.73979291217923, 4.55387689160054, 7.72444664563354, 7.91425227874244,
7.11476944836646, 8.24064886337491, 8.56044423341055, 6.78558764500793,
10.8861838116069, 2.07944154167984, 5.82894561761021, 4.0943445622221,
7.53208814354172, 5.66988092298052, 3.46573590279973, 10.7229148990064,
8.02910705461974, 9.23092700558457, 6.42971947803914, 11.5129154649202,
7.25700270709207, 6.62007320653036, 9.41995278900604, 5.28826703069454,
8.04654935728308, 7.58984151218266, 6.39024066706535, 6.04025471127741,
2.77258872223978, 7.62948991639399, 7.85476918349913, 7.09007683577609,
5.50125821054473, 6.98100574072173, 5.50533153593236), nobs = c(2, 3,
2, 3, 3, 3, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 2, 3, 3, 3, 2,
3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3,
3, 3, 2, 2, 3, 2, 3, 3, 2, 3, 2, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 2, 3, 3,
3, 3, 3, 3, 2, 2, 3, 2), offset = c(1, 3, 6, 8, 11, 14, 17, 19, 21, 24,
26, 29, 32, 35, 38, 41, 44, 47, 49, 52, 54, 56, 59, 62, 65, 68, 71, 74,
77, 80, 83, 86, 88, 91, 93, 96, 99, 102, 105, 108, 111, 113, 115, 118,
121, 124, 126, 129, 132, 135, 137, 140, 143, 146, 148, 151, 154, 157,
160, 163, 166, 169, 172, 174, 176, 179, 182, 185, 188, 191, 193, 195,
198, 201, 204, 207, 210, 212, 214, 217, 219, 222, 225, 227, 230, 232,
235, 238, 240, 242, 245, 248, 251, 254, 257, 260, 262, 265, 268, 271,
274, 277, 280, 282, 284, 287, 289))
model hepatitis;
const
N=288, # number of samples
M=106; # number of children
var
child[N], y[N], log.time[N], y0[M], nobs[M], offset[M+1],
mu[N], tau, sigma, alpha[M], beta, gamma, tbar, y0bar, sresid[N],
mu.alpha, tau.alpha, sigma.alpha;
data in "hep.dat";
inits in "hep3.in";
{
# LIKELIHOOD
for(i in 1:M){ # select ith child
for(j in offset[i]:(offset[i+1]-1)) { # loop over observations for child
y[j] ~ dnorm(mu[j],tau); # specify distribution (=Normal) from
# exponential family for responses
mu[j] <- alpha[i]+beta*(log.time[j]-tbar)
+ gamma*(y0[i]-y0bar); # specify link function
# (=identity) & linear predictor
sresid[j] <- (y[j] - mu[j])/sigma;
}
alpha[i] ~ dnorm(mu.alpha, tau.alpha); # random intercept for each child
# - assume alpha[i]'s are exchangable
# in their joint (population) distn.
}
tbar <- mean(log.time[]); # for centering covariates about their means
y0bar <- mean(y0[]);
# PRIORS
mu.alpha ~ dnorm(0,0.0001); # } Vague (non-informative)
tau.alpha ~ dgamma(0.001,0.001); # } but proper (i.e. integrate
beta ~ dnorm(0,0.0001); # } to 1) priors for population
gamma ~ dnorm(0,0.0001); # } `hyper-parameters', fixed effects
tau ~ dgamma(0.001,0.001); # } and residual precision
sigma <- 1/sqrt(tau);
sigma.alpha <- 1/sqrt(tau.alpha);
}
|