Print

Print


Dear BUGS users,
I wonder if anyone else has tried this:
I am trying to fit a joint model for longitudinal and binary data.
(as opposed to the usual joint models for longitudinal and survival data.)
The longitudinal data are measured with error.

In the generated data below, there are 100 individuals, and
 a continuous variable (Y) is measured at 8 different times (longitudinal data)
 while a binary variable (R) is measured once.
The continuous measurements include true measure (U) and
  measurement error (e): Y=U+e
The binary variable follows a logit model: logit(R) =  G0 + G1*U.

The model is correct, since the data are generated, and the
 true value of G1 is 1.6.

When I put a non-informative prior on the parameters,
 the posterior distribution of the parameter of interest (G1)
is so variable as to be practically useless.  Here is the output
from a not particularly vague prior on G1 (G1~dnorm(0, .02)).

    mean      sd      MC_error  val2.5pc  median   val97.5pc   start  sample
G0  -0.08904  0.3394  0.008596  -0.789   -0.08988   0.6018     10000  10001
G1  -0.439    6.725   0.229     -13.18   -0.7294   13.5        10000  10001

It gets worse the lower the precision of the prior on G1.
Is there any obvious reason for this? Is this model just doomed,
or have I done something silly?

Thanks,

Julie Horrocks
University of Guelph
Guelph, Ontario, Canada

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
model{
for (i in 1:N) {
    for (j in 1:M) {
       Y[i,j] ~ dnorm(muy[i, j], tauz)
       muy[i, j]<-U1[i]
    }
    U1[i] ~ dnorm(muu,tau1)
    r[i]~dbin(p[i],1)

    logit(p[i])<-G0+G1*U1[i]
   }

sigmaz<- sqrt(1/tauz )

#priors

tauz~dgamma(0.1, 0.1)
sigma1~dunif(0,1)
G0~dnorm(0,0.000001)
G1~dnorm(1.6, .02)
muu~dnorm(0,1.0E-6)
}

list(N = 100, M = 8, Y = structure(.Data=c(-0.262313843855381,
-0.0829926192505581, 0.470176890117265, -0.899980830698257, 0.00657683988293917,
0.108985362617801, 0.94320290019508, 0.0793846298459693, 1.08080717460911,
-0.536724926512684, -0.859525603764751, 1.03465788624157, 0.291866101942854,
-0.78205891349431, 0.890040456790485, -1.34238948129829, -0.285357264120757,
-0.264662266394864, 0.492223883893569, 0.0551348373728768, 1.91005928384055,
-0.566341302158937, 1.28394586810013, 1.18665003359530, 0.178659798447664,
-2.21284913124418, -0.0566859936326375, 0.175730258764369, 0.947640582071549,
0.636540067518711, -0.129009761313290, -0.783013817334896, 0.473276518546235,
-0.51145302291504, -0.555167927968795, -0.182915323655587, -0.361489617986338,
-1.10770530377032, -1.29048206702299, -0.63535156894623, -0.98214606965787,
-0.7265414729711, -0.296085918095656, 1.17368226042249, 0.129501072338256,
0.956177306929572, -0.263667970562866, -0.275316829867991, -0.620513482010366,
-0.281528194582710, -0.590363917465252, 0.980843770841761, 0.0940104283677036,
0.906369114937596, -0.177347963079963, -0.431977029430145, -0.373065444174461,
0.305169949036871, 1.00188092393959, 0.388498697580012, -0.292361180751258,
1.15719791066870, 0.0392095305692937, 1.11049908258761, 0.0995255028876407,
-0.934415471154188, -1.05694964977726, -1.00521530978515, -0.829533959525446,
-0.593711408561849, -0.512109510046093, 0.200011936381755, 0.322091135692809,
0.404908862838225, 1.05026538462093, 0.492047013847931, 0.635850081360298,
0.437668752092144, 0.806098859834227, -0.993813559617363, 0.101404619251168,
-0.650808634694079, 0.825505383799838, -0.201924224081044, -2.68900641120357,
0.99035517739857, -0.87284572591653, 0.852254281633406, -0.711369463267391,
-0.0383747801012487, 0.485647005777027, 0.625092768956708, -0.283606183962768,
-0.629655775957537, -0.422939936152345, -1.09910611522213, 0.494294801707532,
-0.563337583057439, -1.36314895174426, -0.0883968731937448, 0.506910467343079,
-0.421265706720007, 0.401037809314724, -0.245785031403988, 0.643333171381075,
0.439331726510418, -0.44574468183068, -0.438884527550954, 1.44052952689377,
0.341187100257255, 0.393861998965560, 0.841160286439434, -0.403785224956695,
0.378268632598794, 0.459112333533235, -0.0264085906969822, 0.850929713880627,
0.0693805019055929, 0.7445268479806, -0.741234673289254, 1.92163930399897,
0.41794101781863, -0.607906980038515, -0.0713919488472551, -0.212512408844271,
-1.51057614114355, 0.390561312742683, -0.342115465405608, -0.0259278231450088,
0.558938833080513, 0.104875051264156, -0.410332941379152, 0.699092185883475,
-0.0702551795807514, -0.52900873140823, 0.161455026953328, -0.892566084871266,
0.102540237722249, -0.377849721082014, 0.539144069995910, -0.8048997620704,
-1.28565381563743, -1.15158522513273, 0.916797029468736, 0.46193417987513,
1.79337835976295, -0.209150185037746, 0.263540933647109, -0.901632948344635,
-0.605513576208318, -0.138283499118962, 0.77530643160563, -0.183712201072288,
1.11705936013196, -0.667651442991455, -1.11879175374123, -0.61670685398736,
0.0250341939072417, 1.51475794394235, 0.50876493113721, -0.150199045978622,
0.745400538648151, -0.0900685102168363, -0.328020875611095, 0.487493151564222,
0.340147982405991, -0.734918396477195, -0.061351224753963, -0.704731484858476,
-0.653050067550829, -1.17681487311360, 0.83224161173267, -0.159158099197796,
0.949677108154374, 0.530833300388768, -0.61936723366974, 0.681583352730048,
-0.0314961824308881, 0.521859508532552, -0.520422371048633, 0.815622280532758,
-0.0792672174818522, -0.110009438892181, 0.512039585384339, -1.35444147779143,
0.0298502117823569, -0.229440932055461, 0.349372859575004, -0.0108339086297197,
-0.482833524874656, 0.819548031849175, 0.825742711958275, -0.670476489182971,
-1.21494194900905, -1.34720015258043, -0.913198850875488, 1.49549251474963,
-0.070040708297565, -0.63009932690837, -0.91093837438548, 0.00754053139830496,
-0.0328349710367747, 0.761364637204696, -1.42718275436943, -0.311706730066955,
-0.260626388474995, 0.597412256722584, -0.253705464097676, 1.51729326343767,
-0.881523092789801, 0.412239895865782, 0.269496631411631, 0.237848399073548,
-1.23693269135033, 0.950682924493945, -0.36898365219508, -0.544230485458481,
0.158664115599743, -0.149917612384833, -0.107388119306422, 0.0416931568720789,
-0.275203506831297, 0.362883358439414, 0.292085730666601, -0.327479623914981,
-0.988187917484935, 0.573131232595114, -0.395142240347669, -0.0886587434135838,
0.336215288596743, -0.0328902386379526, -0.0688843083940802,
0.261555779761879, -0.499589799841197, -0.205435428476091, -0.404868045840446,
-0.778773421746447, -0.955161012078008, -0.764596807369313, -0.104520490211723,
-0.625961754845854, -0.966419758720353, -0.274752608020697, 1.60273083141038,
0.817689227995274, 0.39344702443475, 0.264668140895748, -0.405633295101381,
0.311436881438525, -0.193897905857856, -1.28109971241264, 1.79498837403237,
-0.97776528891676, 1.34874765999540, -1.17147393222698, -0.406820364528985,
-0.0810442975927692, 0.302232745852411, 0.229150841625598, 1.42516752443191,
-0.524690855708216, 1.39638738287062, 0.244541584097404, 0.0658594058607683,
0.742036311856972, -0.348209766344051, -0.990618245949897, -0.569035281115429,
-0.406441756940526, -0.569878424992982, 0.253254611043749, 0.256342237747865,
-0.97218116095324, -0.403692648067440, -1.04402164938636, -0.349183510399362,
0.75380552868092, -0.211401067263695, 1.02620022256753, -0.990412593867658,
0.472403756297723, -0.663191318542109, 0.281532355764858, 0.051925633534339,
-1.27589963228010, 1.04114865009781, -0.841234702385585, 0.362835921947747,
0.689239382939566, 0.539317648568145, 1.84073941863830, 1.01951251161427,
-0.604073658965897, -1.06231079777414, -1.35449435995121, 0.46087060896684,
1.49530025536671, 0.134735638888674, -0.963936823234674, 0.281354205377584,
-0.857755222752967, 0.328354325381843, 0.53418830192534, -1.43640287729360,
-0.0480195857652559, 0.394763133841527, -0.489850380620958, 0.0600907703569357,
-0.0374227535061644, -0.584595340799979, 1.63082309174468, 0.0966164057879005,
0.0739579750134796, -0.450491403243188, 1.14154699146042, -2.13269540788465,
0.938480211584413, -0.219312227853993, 0.388744567437591, -0.483585846164443,
1.37883473420675, 0.0397128552449173, 0.237777623050931, 0.635094392799893,
-0.304473072222319, -0.617244349534207, -0.200536559907023, 0.0663412805499233,
0.193327263445334, 0.872648235085903, 0.414117494993621, 0.746146987755067,
0.39998744624149, 0.516163972942518, -1.12977247337538, -1.65873833164563,
-0.288976737018402, 0.336607679589844, -0.805130005230272, -0.161927654964284,
-0.0733530165122028, -1.10610315112596, -0.0292695293369888,
0.272110377669371, 1.20149603175768, 0.164324635606736, -0.180374827529047,
-0.337178089117294, -0.417701447165887, -0.524349267297216, -0.478780936814164,
0.870211928501177, -0.80892766060025, 0.554727232356038, -0.734099773099188,
-0.622771711189445, 0.552867441906036, 0.462670317019126, 0.658403944661937,
1.31156763902789, -0.507450833011692, 1.07489464697887, 0.37024754287166,
0.508679652766496, 0.978013944933652, -0.590053126139065, -1.67088691957439,
0.917201629575048, -0.0300033921582482, -0.375324670208786, -1.10041243900434,
0.117186607668980, -0.219726850121263, -0.133903931883344, -0.0903486546895271,
0.413685778181764, 1.15733315970167, 0.0247986146635587, 0.643327005619584,
-0.473147776668208, 0.191741165582149, -1.41169313375439, -0.498355189067551,
-0.91972930910538, -0.815750495348175, 0.992100379078578, -0.465912447759498,
-1.10903989312256, 0.742814141788076, 0.635161426864646, 1.28691886459358,
0.654644871762147, -0.780684947602064, -0.4833837607171, -1.53673947402666,
-0.525520788348621, 0.742869678818934, -0.0857036117695746, -0.525284138525547,
-0.289611958652047, -0.800695257219627, 0.771894502822429, 1.13942105640371,
-0.220285750481646, -0.388147175616469, 0.341164759695402, 0.279604084547096,
-0.776282059056274, 0.817693251577725, -0.700358162046333, -0.610464869568692,
0.0624885338446118, -0.926084426252678, -0.294102624951686, 0.961715826859577,
-1.46519575920258, 0.792793688665757, -0.211098744490838, 0.622666727227981,
1.18171971192671, 1.43223221626535, -0.914062578422381, 0.906547464867556,
0.818265899858349, 0.215702268850951, -1.16700840997670, 0.144272092116641,
0.215923344590953, -0.00305784964898187, 0.478048609818364, 0.0632516077640306,
-0.000613451174209828, 1.52163856333695, -0.929212515168337,
-1.13574148589228, -0.804961157598481, -1.52559385361358, -0.3057957297828,
-0.66174628855308, -0.343517373947564, 0.468246637606029, -1.46894161809435,
-0.272558118513443, 1.72895956715526, 0.30628924593141, 1.03013379053786,
0.544587128058241, 0.0627401343437758, 0.264232675057915, -0.190818752577293,
-0.863729432874684, 1.65856945331447, 0.68305758255553, 1.03197926492736,
-1.12803848323680, -0.95066306657529, -0.239615093751205, 1.18460881006502,
0.631028694978775, 0.889764557306355, -0.991587298170804, 1.06091863796031,
-1.07594134672776, -0.152034130342826, 0.282321107241050, -0.961312716885113,
0.245733516072725, -0.247131362908278, -0.90841822166488, -0.865696063030821,
-1.67894033817661, -0.260041467794232, 0.0786493895802466, 0.65106056336789,
0.220032032278141, 0.0352809937215272, 0.676692811342841, 0.387401491906656,
-0.517772349023245, -1.65250827313294, 0.551212055752981, -0.945958801179925,
0.584352228340535, -0.980857402539102, -0.618111213599683, 0.15182564395259,
-1.75888540605149, 0.10162914391033, -0.808843249835783, -0.00243889899368235,
0.00357554421414319, 0.484906959331679, -0.416986154713015, -0.927708027228287,
-1.19573919115615, 0.00119225722298355, 0.0774330850964464, 0.292779414931425,
0.4927445168823, -1.10182577231518, -0.418045469043111, 0.374508893665191,
1.63801175734463, -0.399706248536409, -0.406826946694581, -0.337154537025788,
-0.185991178033547, -0.561833816920273, 1.68130028984522, 0.126698806888407,
0.183957135493503, 0.117666881420134, -0.00767357937586582, 0.0875525738257124,
0.499240501474753, -1.17050840661185, 0.821746082874742, 0.268674945300936,
0.532136733667986, 0.446918723593829, 0.863365747783281, 0.0752031018570142,
1.14322579242455, 0.819580693811568, 1.06905615688706, -1.18166983671641,
0.00837264509929805, -0.45187425344488, 0.417936402413105, -0.0401852721791318,
0.980281483674919, 0.180316829787211, 0.423933934101462, -0.118998319786345,
-0.845818385347428, -0.712402786239804, -1.7213184295429, -0.081527285969119,
0.545946100836338, -0.0161298960413834, 0.101539976958744, -0.188712123002625,
-0.805436119902866, 1.67602492831821, -0.32962071264414, 0.521366339852043,
-0.290622896004522, 0.577073502596097, -0.457432968424319, -0.395206926181365,
-0.853740873686117, 1.35881252050283, -0.52405162149736, 0.324729422110164,
-0.876217545817042, -1.01779365485351, 0.629545947466087, 0.0907259419105735,
0.480467561593237, 1.62870307854362, -0.516716095049764, 1.66864445169973,
0.911622678946508, -0.90186909687608, 0.739695545109854, -0.953003659173766,
-1.33315134849374, -0.627054050127954, 0.553345368023529, 0.0479594086627174,
-1.09358412213567, 0.299960807554538, -0.449440674823015, 0.170781352508544,
-0.140243314522815, -0.173476519750641, 0.799667316410057, 0.215530424183986,
1.02434080574288, -0.603135455593818, 0.293654121821101, -0.980107160686633,
0.549683746155133, -1.17989576154709, -1.12436031671245, 0.817351424926362,
-0.675926355605179, -0.373594702058113, 0.59210184631138, 0.619298252774493,
0.911789445605487, 1.11475623869486, -0.828610578428599, -0.514248006782542,
-0.848239183267679, -0.093512561320502, 0.915560450108484, -0.212952733317881,
-1.02206479636585, -0.0698201932106842, -0.227277462898416, 0.320414637563982,
0.814839184487377, -0.129653982649115, 0.907423320213684, -0.43247971644757,
-0.480324302376674, 0.918698385206403, 0.927625113297937, -0.635112636886692,
-0.103354156516500, 0.639868198932538, -0.294141210792006, -1.18207505083906,
1.22211829446668, -2.01636375325595, 0.43118762629978, -0.184661328994472,
1.10589735930361, 0.479851950547259, 1.07855973423081, 0.236332078335766,
0.115870994675976, 1.41948698287058, 0.218196876694874, -1.32616173418101,
0.195816715573113, 0.084591712894243, 0.616829294514431, 0.918943974926277,
0.109978350126097, 0.0709886118178426, -0.394056598470619, -0.156350769427685,
-0.029959871995058, 0.131024199507432, -1.58304163544551, -1.07907948372605,
-0.316620799589587, -0.129161752816208, -0.726823929636043, -1.11407250710767,
-0.76011074180999, 1.41590928766623, 0.96080976315599, 0.519864515675258,
-0.544333466946987, -0.429373109752309, 0.380557879483683, -0.528078129085878,
-0.698358898262289, 1.07920271591172, -0.880558835381087, 1.64258455397624,
0.00371727830975332, -0.385540297057388, -1.19231334907844, 0.716028074656116,
-0.0910344276139589, 1.24885973485630, -1.46832608885572, 1.19163120656298,
-1.35329445417639, -0.680412488383345, -0.326213533793055, -0.900144656852019,
-1.09423395178476, -0.598726949275079, -0.504710937186593, -0.67355826707978,
-0.665019103743323, -0.96427474914904, -0.461447371504625, 0.84911364886565,
0.199144932989593, -0.635453756438417, 0.772347983390234, 0.556890757763254,
0.816073908123003, -0.745507810095904, 1.05361437540234, -1.04294237070362,
-0.139644975953926, -0.605781103668443, -0.601441464666243, 2.00272834917963,
-0.661204669848463, -0.222977281776556, -0.0522990223040301,
0.951540526818452, 0.589081260327396, 1.14054439435737, -0.695887290174514,
-0.270708914210209, -0.711380268098953, -0.110722774618135, 1.04628130728235,
-0.511462995356823, -0.167334743891058, -0.276346895423433, -1.23586964091865,
0.707901423833829, 0.610436190650904, -1.57331062822986, 0.179985533535713,
0.554155461403677, 0.29132915762825, -1.16946182818641, 1.11131317861817,
0.202678735944249, 0.350389496212382, -0.0188997098773617, 0.220723398659665,
-1.08964837647398, 0.34511793140342, -1.68226294199260, 0.42372307489144,
-0.0707894361041884, -0.299314150859737, 0.19778694080626, 1.04686501579577,
-0.0135981310993740, 1.09097945900444, 0.0346151682731844, -0.197802459374791,
-1.47514497226055, 0.407207984279559, -0.309004451018228, -0.36725925131416,
1.30945036479418, 0.765328207381141, 1.30184900895539, 1.62183617798371,
0.564485540193846, -0.892685774787704, -0.41708531390867, -1.82656464269386,
0.254683325636118, -0.304363230935357, -0.349802115911927, -0.91133574351325,
-1.23231058438745, -0.308931641851249, 0.298146719690391, 0.430237494557323,
1.42949014693376, 0.93109091891645, 0.56110944691244, -0.268290089653620,
-0.651203391833492, -0.299477176380969, 1.00123461378704, -0.132486843148446,
1.37848452519519, -0.431433999132537, -1.55023463925404, -1.36465421332819,
0.0339502755094938, 0.397492874858985, 0.383095985651148, 0.00568678112217202,
0.617176121879459, 0.150103498407917, -0.351107961069875, 0.215606643314364,
-0.852552887011086, -0.892052149513662, -0.195285146867997, -0.46025895465704,
-0.375836754636786, 0.153241148807489, 0.754634996062549, -0.322830422102971,
-1.12570002174003, -0.371595866755367, -0.675509053412837, 0.97407630412936,
0.199279992105377, 0.145756186739396, -1.45985395704062, 0.634084076326643,
-0.839175345416791, -0.811343569105302, -1.53394510038748, -1.06507227404272,
1.08274843159052, 0.307840840323339, -0.135123087179747, -0.315506811176714,
-0.292291579345138, 0.601793929269907, 1.68835971398503, -0.418231348707417,
-0.527953059264142, -1.34171700632720, 0.877855944027478, 2.07116931866773,
0.125286188715722, 0.821505571498239, -0.620181753764083), .Dim = c(100,
8)), r = c(1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1,
1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1,
1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1,
1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0,
1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0))

-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]

To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.

To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list