RESEARCH ARTICLE Open Access
Bayesian hie a chical piecewise eg ession
models: a ool o de ec ajec o y
di e gence be ween g oups in long- e m
obse a ional s udies
Ma ie-jeanne Busco
1
, Simon S. Wo he spoon
2
, Cos an G. Magnussen
1,3
, Ma kus Juonala
3,4
, Ma hew A. Sabin
5,6
,
Da id P. Bu gne
5,6,7
, Te ho Leh imäki
8
, Jo ma S. A. Viika i
3,4
, Nina Hu i-Kähönen
9,10
, Olli T. Rai aka i
3,4
and Russell J. Thomson
11*
Abs ac
Backg ound: Bayesian hie a chical piecewise eg ession (BHPR) modeling has no been p e iously o mula ed o
de ec and cha ac e ise he mechanism o ajec o y di e gence be ween g oups o pa icipan s ha ha e
longi udinal esponses wi h dis inc de elopmen al phases. These models a e use ul when pa icipan s in a
p ospec i e coho s udy a e g ouped acco ding o a dis al dicho omous heal h ou come. Indeed, a e ined
unde s anding o how dele e ious isk ac o p o iles de elop ac oss he li e-cou se may help in o m ea ly-li e
in e en ions. P e ious echniques o de e mine be ween-g oup di e ences in isk ac o s a each age may esul in
biased es ima e o he age a di e gence.
Me hods: We demons a e he use o Bayesian hie a chical piecewise eg ession (BHPR) o gene a e a poin
es ima e and c edible in e al o he age a which ajec o ies di e ge be ween g oups o con inuous ou come
measu es ha exhibi non-linea wi hin-pe son esponse p o iles o e ime. We illus a e ou app oach by modeling
he di e gence in childhood- o-adul hood body mass index (BMI) ajec o ies be ween wo g oups o adul s wi h/
wi hou ype 2 diabe es melli us (T2DM) in he Ca dio ascula Risk in Young Finns S udy (YFS).
Resul s: Using he p oposed BHPR app oach, we es ima ed he BMI p o iles o pa icipan s wi h T2DM di e ged
om heal hy pa icipan s a age 16 yea s o males (95% c edible in e al (CI):13.5–18 yea s) and 21 yea s o
emales (95% CI: 19.5–23 yea s). These da a sugges ha a c i ical window o weigh managemen in e en ion in
p e en ing T2DM migh exis be o e he age when BMI g ow h a e is na u ally expec ed o dec ease. Simula ion
showed ha when using pai wise compa ison o leas -squa e means om ca ego ical mixed models, smalle
sample sizes ended o conclude a la e age o di e gence. In con as , he poin es ima e o he di e gence ime is
no biased by sample size when using he p oposed BHPR me hod.
Conclusions: BHPR is a powe ul analy ic ool o model long- e m non-linea longi udinal ou comes, enabling he
iden i ica ion o he age a which isk ac o ajec o ies di e ge be ween g oups o pa icipan s. The me hod is
sui able o he analysis o unbalanced longi udinal da a, wi h only a limi ed numbe o epea ed measu es pe
pa icipan s and whe e he ime- ela ed ou come is ypically ma ked by ansi ional changes o by dis inc phases
o change o e ime.
Keywo ds: Piecewise model, Hie a chical eg ession, Non-linea ajec o y model, Accele a ed longi udinal design,
Coho e ec , G oup di e gence
* Co espondence: [email p o ec ed]du.au
11
Cen e o Resea ch in Ma hema ics, School o Compu ing, Enginee ing &
Ma hema ics, Wes e n Sydney Uni e si y, Sydney, Aus alia
Full lis o au ho in o ma ion is a ailable a he end o he a icle
© The Au ho (s). 2017 Open Access This a icle is dis ibu ed unde he e ms o he C ea i e Commons A ibu ion 4.0
In e na ional License (h p://c ea i ecommons.o g/licenses/by/4.0/), which pe mi s un es ic ed use, dis ibu ion, and
ep oduc ion in any medium, p o ided you gi e app op ia e c edi o he o iginal au ho (s) and he sou ce, p o ide a link o
he C ea i e Commons license, and indica e i changes we e made. The C ea i e Commons Public Domain Dedica ion wai e
(h p://c ea i ecommons.o g/publicdomain/ze o/1.0/) applies o he da a made a ailable in his a icle, unless o he wise s a ed.
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86
DOI 10.1186/s12874-017-0358-9
Backg ound
Child- o-adul ajec o ies o heal h ma ke s a e likely
o ha e implica ions o he isk o ch onic diseases in
la e li e, such as obesi y, ype 2 diabe es melli us
(T2DM) and ca dio ascula diseases; i is he e o e im-
po an o unde s and hei de elopmen h oughou he
li e-cou se [1–4].
Long- unning obse a ional s udies ha ollow he
same subjec s pa icipan s ac oss he li e-cou se a e es-
pecially sui ed o s udying adul onse diso de s, such as
ca diome abolic disease, since hey allow cha ac e izing
he de elopmen o no mal s. pa hological p ocesses
o e ime. A goal o such s udies is o en o de e mine
how a numbe o pa ien cha ac e is ics, modi iable isk
ac o s p o iles [1, 5], hei in e ac ions and no mal
aging may impac he onse and p og ession o disease
o e ime [6–8] in o de o iden i y ime pe iods o di-
e gence in hese ac o s [9–11].
A key s a is ical issue in hese s udies is o en o de e -
mine whe he he isk ac o le els a y o e ime be-
ween and wi hin g oups o pa icipan s, and whe he
di e en g oups a e changing in a simila o di e en
ashion o e ime [12, 13]. Depending on he s udy, he
s a i ica ion o pa icipan s in o g oups can ela e o
pa icipan s’cha ac e is ics o exposu e (i.e. smoking
s a us), in e en ion a m (i.e. con ol s. medica ion), o
i could be a la e heal h ou come (i.e. disease s a us in
mid-adul hood). When pa icipan s a e g ouped acco d-
ing o a dis al dicho omous heal h ou come, longi udinal
da a p o ide he ounda ion o unde s and pa hways o
dele e ious isk ac o p o iles, which may help in o m
he iming o in e en ions [8, 14, 15].
When i is es ablished ha g oups o in e es s a
wi h simila ini ial ou come le els, bu do no change
simila ly o e ime, i is o en o in e es o de e mine he
poin in ime o age a which hey s a di e ging in hei
ajec o ies [16–20]. Being able o de e mine how and
when he change mani es s be ween g oups o pa ici-
pan s is impo an , since i can help pinpoin pe iods in
he li e cou se ha a e c i ical in he de elopmen o ab-
no mal isk ac o p o iles [21]. Howe e , he e is li le
me hodological guidance in he li e a u e on s a is ical
echniques o achie e his, and se e al s udies ha e
no ed a lack o ele an me hods o in es iga e ajec o y
di e gence be ween g oups [20–22].
A common a emp is o i a mixed model wi h ime
(o age) ea ed as ca ego ical a iable (i.e. non ime-
o de ed/o dina ed [23]) o e ie e linea p edic ions a
each age o each g oup o in e es om his model (i.e.
means o leas squa es p edic ions, aka LS-means [24–26]),
and o es o a g oup di e ence in hese p edic ions using
a numbe o con as s (i.e. pos -hoc pai wise compa isons).
In his case, he age a which hedi e encebe ween-g oups
eme ge is o en he age a which a signi ican be ween-
g oup di e ence ma e ializes in he LS-means [23, 27, 28].
Se e al s udies ha e used his app oach o de e mine a
“wha imes he g oups means a e di e en ”(e.g. be ween-
subjec e ec o pos -hoc pai wise g oup compa ison, i
he e a e mo e han wo g oups) and/o ‘a wha imes he
means di e ’wi hin each g oup (wi hin-subjec e ec es -
ing) [27, 29, 30]. Howe e , e en when adjus men s a e ap-
plied o mul iple es s [27, 31–33], many au ho s ad ise
agains he un es ic ed use o mul iple compa isons among
ma ginal means due o well-documen ed mul iple es ing
issues, especially he inc ease in alse posi i e a e as he
numbe o hypo hesis es s inc eases [30, 34–37]. Mixed
models ha assume an uns uc u ed mean esponse by
ea ing age o ime as ca ego ical a iables end o be o e
pa ame e ized and may be ine icien a de ec ing main
e ec s [38]. Ano he c ucial disad an age o his app oach,
is ha i only es s o he di e ence in means be ween
g oups a each ime poin and does no p o ide any in o ma-
ion on subjec -speci ic esponse e olu ion in ime [13, 39],
so ha he age (o poin in ime) a which he g oup di e -
ence mani es s is ul ima ely a ques ion o sample size and
s a is ical powe .
In con as , con inuous ime models such as indi idual-
based ajec o y modeling me hods, including mixed e ec
[12], hie a chical [40], mul ile el [41] and he closely e-
la ed s uc u al equa ion and La en G ow h Cu e
models [42], ha e become in aluable ools o unde s and
he na u al his o y o heal h ou come as well as isk ac-
o /de e minan ajec o ies [14, 43–45]. They ha e
ad an ages o e adi ional app oaches o epea ed-
measu e da a analysis; hei main ea u e being ha hey
allow summa izing each pa icipan ’s ou come ajec o y
wi h a ew ajec o y pa ame e s [39, 46]. In addi ion, hey
pe mi he explici ly modeling o in e -indi idual di e -
ences in in a-indi idual change, pe mi ing in e ence
ega ding he a e age esponse ajec o y o e ime and
how his e olu ion may a y wi h pa icipan cha ac e is-
ics (i.e. pa icipan -le el p edic o s) [47–50].
Despi e hei lexibili y, hese models a e no o en
used o analyse spa se long- e m obse a ional da a
since accele a ed longi udinal designs [14, 22, 51] and
non-linea esponse o e ime [44, 52–54] bo h in oduce
signi ican complexi y in o he g ow h cu e modeling
app oach [55–58]. Indeed, being able o ep esen non-
linea pa e ns wi h a ela i ely small numbe o meas-
u emen occasions pe pa icipan s (o en <10 ime
poin s) and be speci ic abou whe e be ween-pa icipan
he e ogenei y appea s in hose pa e ns is a s a is ical
challenge.
Many applica ions o en elied on highe o de ime
(o age) polynomials o la en basis coe icien s [14, 20,
44, 59–61], which s eng hs and limi a ions ha e been
desc ibed elsewhe e [9, 46, 62–65]. In he con ex o ou
s udy he polynomial pa ame e isa ion o he g ow h
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 2 o 15
model does no speci ically yield an age o poin in ime
when he g ow h pa e n is changing wi hin-and
be ween-g oups. Al e na i ely, piecewise models, also
known as linea splines o b oken s ick models, can be
used o b eak up a non-linea o cu ilinea g ow h a-
jec o y in o se e al sepa a e linea componen s [66].
They a e pa icula ly use ul o compa e g ow h a es in
di e en pe iods o e ime i he unc ional o m o he
esponse is cha ac e ised by di e en phases o de elop-
men , o i he e is a shi in he ou come ajec o y a
some poin in he e en window (i.e. an accele a ion o a
decele a ion in he esponse change a e om one poin
in ime (o age)) [67–73]. Piecewise linea ajec o y
models ha e been used o model ‘mul iphase’de elop-
men al p ocesses p ima ily wi h ‘ ixed’ ansi ion poin s
in a a ie y o applica ions in he equen is mul ile el
[40, 45, 69, 74, 75] and s uc u al equa ion modeling
amewo k [42, 76]. Bayesian applica ions o hese p o-
cesses a e o en e e ed o as ‘ andom change poin
model’whe e he posi ion o indi idual b eakpoin s is
also es ima ed, allowing o be ween-pe son a iabili y in
he ansi ion poin s [77–86].
Few s udies ha e, howe e , in es iga ed he inclusion
o ca ego ical co a ia es o g ouping a iables as le el 2
p edic o s o he a iabili y in he change poin , and he
andom Bayesian change poin model has no , o ou
knowledge, been o mula ed o es speci ically o he
exis ence o a ‘ ajec o y di e gence’be ween wo (o
mo e) known g oups o pa icipan s ha ha e longi u-
dinal esponses cha ac e ised by dis inc de elopmen al
phases. In his pape we illus a e he use o Bayesian
hie a chical piecewise eg ession modeling o de ec a-
jec o y di e gence be ween g oups o pa icipan s using
longi udinal BMI da a om he Ca dio ascula Risk in
Young Finns (YFS) S udy, a well pheno yped p ospec i e
coho wi h measu es om mul iple ime-poin s. P e i-
ously published wo k on his da a, based on ca ego ical
mixed modeling, sugges ed ha BMI le els became s a-
is ically di e en be ween hose who de elop T2DM in
adul hood and hose who did no om he age o
15 yea s [87]. We e-analyse his da a se o demons a e
how he Bayesian me hod can be used o (1) model he
BMI p o iles o be e unde s and he na u al his o y o
he BMI ajec o ies in hose who do and do no de elop
T2DM in adul hood while con olling o po en ial co-
ho e ec s, and (2) ob ain a e ined es ima e and con i-
dence in e al o he age a which he wo g oups s a
di e ging om one ano he , ansla ing in o signi ican ly
di e en BMI om a ce ain age onwa ds. In addi ion,
we conduc a se ies o sho simula ions o illus a e he
di e ence in he es ima es o age a di e gence when
using he adi ional app oach (i.e. pai wise compa isons
o ma ginal means om a ca ego ical mixed model) s.
he p oposed ajec o y modeling app oach.
Me hods
S a is ical model
No-co a ia e model
To accommoda e he cu ilinea de elopmen al pa e n
in an indi idual con inuous esponse o e ime while
p o iding an adequa e ep esen a ion o i s de elopmen-
al heo y, we conside a linea -linea piecewise eg es-
sion model as he unc ional o m o change in he
ajec o y model. The ‘change poin ’(CP) ep esen s he
age (o ime) a which he ansi ion o a di e en
g ow h a e occu s. We conside he ollowing uncondi-
ional (no co a ia es) mul ile el model:
Le el 1 model:
Reponseij ¼b0iþb1iageij:1−uCPiageij
þb2iageij−CPi
:uCPiageij
þεij
ð1:1Þ
Le el 2 model:
b0i¼β00 þ 0ib1i¼β10 þ 1ib2i¼β20 þ 2i
CPi¼CP þ CPi
ð1:2Þ
0i
1i
2i
CPi
0
B
B
B
@1
C
C
C
AeN
0
0
0
0
0
B
B
@1
C
C
A;
σ 0
2…⋯…
σ 01 σ 1
2……
σ 02 σ 12 σ 2
2…
σ 0CP σ 1CP σ 2CP σCP
2
!
#
2
6
6
6
6
6
6
6
6
6
6
6
6
4ð1:3Þ
Whe e a age j o pa icipan i,Response
ij
is he e-
pea ed con inuous ou come measu es, and age
ij
is he
co esponding ime ela ed a iables cen e ed a ound i s
g and mean. uCPiageij
is a uni hea yside s ep unc ion
whe e uCPiageij
=1 i age
ij
≥CP
i
and uCPiageij
¼0i
age
ij
<CP
i
. The andom ajec o y pa ame e s b
0i
,b
1i
and b
2i
co espond o he indi idual in e cep , slope be-
o e and slope a e he pe son-speci ic change poin
CP
i
, espec i ely. Fo each pe son i,b
0i
con ols he indi-
idual baseline le el (o ini ial s a us) o he esponse
and i s in e p e a ion depends on he cen e ing o he
age a iable (e.g. i age is cen e ed a ound 25 yea s, b
0i
will be he expec ed pa icipan -le el esponse a 25 yea s
o age gi en hey a e in he i s phase o g ow h b
1i
).
b
1i
,b
2i
and CP
i
, a e he expec ed linea inc ease pe yea
o age in he i s phase o g ow h, he expec ed linea
a e o inc ease a e he change poin , and age a which
he linea pe u ba ion o he ini ial end occu s, e-
spec i ely. ε
ij
is he le el-1 esidual (i.e. andom wi hin-
pe son e o o pe son ia age j) and is independen
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 3 o 15
and no mally dis ibu ed (i.e. ε
ij
~iid N(0, σ
e
2
)).
0i
,
1i
,
2i
and
CPi
a e he le el-2 andom e ec s, mul i a ia e no -
mally dis ibu ed wi h ze o mean and a iances σ
0
2
,σ
1
2
,
σ
2
2
and σ
CP
2
espec i ely and ull co a iance ma ix as
shown in 1.3 . β
00
,β
10
,β
20
and CP a e he ixed e ec s
(i.e. popula ion a e age o each ajec o y pa ame e ). In
his model, he le el 1 esidual a iance σ
e
2
can be in e -
p e ed as he de ia ions a ound an indi idual’s ajec o y
and le el-2 esiduals as be ween-pa icipan a iabili y in
he o e all in e cep (σ
0
2
), in he a e o change be o e
and a e he change poin CP
i
(σ
1
2
and σ
2
2
espec i ely),
and in he change poin i sel (σ
CP
2
), espec i ely.
Model wi h g oup-e ec
To explo e he e ogenei y in indi idual ajec o ies be-
ween g oups o in e es s, he uncondi ional segmen ed
g ow h model can be expanded by including ime-
a ying co a ia es (TVCs) a le el-1 and ime in a ian
co a ia es (TICs) a le el 2, while simul aneously adjus -
ing o he e ec s o a iables measu ed on pa icipan s
a all ime poin s. Whe eas TICs di ec ly p edic he
g ow h pa ame e s, TVCs di ec ly p edic he epea ed
measu es while con olling o he in luence o he
g ow h pa ame e s [43, 88]. I he TIC a iable is a bin-
a y dummy g ouping ac o (“GRP
i
”), iden i ying pa ici-
pan s coming om wo iden i ied g oups, he model can
be ew i en as ollows:
Le el 1 model:
Responseij ¼b0iþb1iageij:1−uCPiageij
þb2iageij−CPi
:uCPiageij
þTVCij þεij
ð2:1Þ
Le el 2 model:
b0i¼β00 þβ0g pGRPiþ 0i
b1i¼β10 þβ1g pGRPiþ 1i
b2i¼β20 þβ2g pGRPiþ 2i
CPi¼CP þβCPGRPiþ CPi
ð2:2Þ
Whe e β
00
,β
10
,β
20
and CP a e he expec ed ajec o y
pa ame e s o he e e ence g oup (a ze o alues o
o he po en ial co a ia es); β
0g p
,β
1g p
,β
2g p
and β
CP
a e
he expec ed in e g oup a ia ions in hese pa ame e s
o pa icipan s in he second g oup (i.e. espec i ely, in
he mean esponse, in he linea age e ec , in he de i-
a ion om linea a e a e he CP and in he CP im-
ing); and
0i
,
1i
,
2i
and
CPi
a e he le el-2 esiduals
pe son i o in e cep , slopes, and age a he change
poin a e con olling o g oup di e ences. To es o
a be ween-g oup di e ence in one ajec o y pa ame e
only, ‘GRP’can be included as a le el-2 p edic o o he
pa ame e o in e es , and model all o he g ow h
pa ame e s as andom e ec s only (as in 1.2). Fo each
o he p+ 1 indi idual g ow h pa ame e s, addi ional
pa icipan -speci ic co a ia es (TICs) can be included in
a simila ashion o ha e mul iple p edic o s a le el 2 as
ollows: bpi ¼βp0þXQp
q¼1βpqxqi þupi , wi h x
qi
, he q
h
measu ed TIC; β
pq
, he e ec o he TIC x
qi
on he (p +
1)
h
ajec o y pa ame e ; and u
pi
, he (p + 1)
h
andom
e ec . The se o p + 1 andom e ec s o pe son ias-
sumed o be mul i a ia e no mally dis ibu ed wi h co-
a iance ma ix o dimension (p+1)*(p+ 1), al hough
simple a iance-co a iance s uc u es o he andom
e ec s can be conside ed du ing model building (i.e.
mu ual independence o he andom e ec s). I is ad is-
o y o s anda dize TVCs in o de o s abilize he a i-
ance, imp o e no mali y o e o s and linea i y o he
mean [88]. The common assump ion o he e o s uc-
u e is ε
ij
~iid N(0, σ
e
2
) bu i can be elaxed o include
ime speci ic a iances o esidual e o co ela ion such
as AR1 e o s.
The same app oach can be used o expand he hie -
a chical piecewise ajec o y model wi h g ouping ac-
o s ha ha e mo e han 2 le els. This is one o he
possible app oaches o es o a coho -e ec on he de-
elopmen o cu ilinea esponses o e ime when da a
a ises om mul i-coho o accele a ed longi udinal de-
signs [89, 90]. I s udy pa icipan s belong o one o k
possible bi h coho s, k-1 bina y dummy a iables a e
c ea ed o iden i y obse a ions coming om people
bo n in he same calenda yea , and as in 2.2, hese new
k-1 g ouping a iables a e in oduced as le el 2 p edic-
o s o he di e en ajec o y pa ame e s in he model.
The bina y dummy a iables a e in oduced o sequen-
ially shi he condi ional means o each o he di e en
ajec o y pa ame e s. The ixed e ec s will be he a e -
age ajec o y pa ame e s o he coho chosen as he
e e ence coho in he s udy sample, and each (β
coho
)
1..
k−1
coe icien will hus be in e p e ed as he a ia ion
in g ow h pa ame e s in he co esponding k-1 h coho
compa ed o he e e ence coho .
T ajec o y di e gence mechanisms
The equa ion 2.2 abo e, allows o be ween-g oup di e -
ence in each o he 4 ajec o y pa ame e s o he piece-
wise model. (i.e. in e cep , slope be o e and a e he
change poin (CP), and he change poin i sel ). I he
ocus is o de e mine and model he di e gence in he
ajec o ies be ween g oup, hen model 2.2 can be modi-
ied by o cing he in e cep and slope be o e he CP o
be in a ian ac oss g oups by se ing β
0g p
and β
1g p
o
ze o a le el 2 in equa ion 2.2. As illus a ed in Fig. 1,
we iden i y 3 possible ways in which con inuous ou -
comes ajec o ies can di e ge o e ime be ween
g oups: (1) ype 1: he wo g oups ha e di e en slope
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 4 o 15
a e he CP, (2) Type 2: he wo g oups ha e di e en
change poin s, and (3) Type 3: he wo g oups ha e
di e en CP and pos -CP slopes. To es o g oup-
di e ence a di e en s ages o he ou come de elop-
men , ou app oach consis s in i ing hese 3 possible
condi ional Bayesian hie a chical models o he da a and
compa ing model i o de e mine which mechanisms
p o ides he bes ep esen a ion o he unde lying de el-
opmen o he ou come be ween g oups o pa icipan s.
Bayesian es ima ion o he hie a chical piecewise model
We used a Bayesian app oach o es ima e and
summa ize he pa ame e s o in e es in he condi ional
mul ile el piecewise model ( o mula 2.2) [86, 91]. In ou
illus a i e example, all models we e i in RJAGS and
R2JAGS in R.. In combined Bayesian no a ion, he a-
jec o y model wi h a bina y g ouping s a us ‘GRP’as he
TIC co a ia e in e ac ing wi h all 4 ajec o y pa ame e s
can be w i en as ollows:
ResponseijeNo mal muij;σ2
muij ¼ 0iþβ0g pGRPiþ 1iþβ1g pGRPi
ageij
þ 2iþβ2g pGRPi
ageij− CPi þCPg pGRPi
þ
To ensu e ha he e ec o ‘g oup’on each ajec o y
pa ame e can be ei he posi i e o nega i e and ha he
p io in o ma ion does no domina e he likelihood, un-
in o ma i e p io s o he ixed g oup e ec s β
0g p
,β
1g p
,
β
2g p
,CP
g p
can be se as N~ (0, 10
4
). In ec o no a ion,
he andom e ec s
i
=(
oi
,
1i
,
2i
,
cpi
)
T
a e assumed
o ollow a mul i a ia e no mal dis ibu ion wi h mean β
and uns uc u ed 4 x4 a iance-co a iance ma ix φas
in 1.3, whe e β=(β
0
,β
1
,β
2
,CP)
T
, he ec o o popula-
ion means. T adi ionally in Bayesian analysis o an-
dom e ec s, In Wisha (Σ,k) is used as a conjuga e p io
o he unknown a iance-co a iance ma ix o
mul i a ia e no mal dis ibu ions, whe e Σis a posi i e
de ini e in e se scale ma ix o deg ee o eedom k[93].
In e se-Gamma (λ
1
,λ
2
) is o en used as he conjuga e
p io o he a iance o uni a ia e no mal dis ibu ion
(i.e. o mu ually independen andom e ec s, and model
e o a iance σ
2
). Al e na i e p io dis ibu ions may be
used o le el 2 a iances o independen andom e ec s
o o he a iance componen s o mul i a ia e no mal
dis ibu ions [41, 92, 93].
Signi icance o g oup-di e ences in ajec o y pa ame e s
Tes ing o g oup-di e ences in ajec o y pa ame e s is
equi alen o in es iga ing he signi icance o he g oup-
ing co a ia es pa ame e s a le el 2 in he hie a chical
change poin model. In he Bayesian con ex , his is
done by looking a he pos e io p obabili y densi y o
he " β
g p
”pa ame e s in 2.2. (i.e. β
0g p
,β
1g p
., β
2g p
.and
β
CP
) o he es ima ed co a ia e pa ame e s. Fo example,
he e ec o ‘GRP’on each ajec o y pa ame e is sig-
ni ican i he 95% Bayesian c edible in e als (CI) o he
es ima ed eg esso s (i.e. each “β
g p
”) exclude ze o, in
which case, he es ima ed “β
g p
”can be in e p e ed as
he shi s in each ajec o y pa ame e in one g oup
compa ed o he o he g oup [77, 92, 94].
Model con e gence, i and adequacy
The choice o he bes model among he sui e o candi-
da e (condi ional) Bayesian hie a chical models can be
based on wo c i e ia: (1) he de iance in o ma ion
c i e ion DIC [95, 96], an index o quali y o i ha is
commonly used o Bayesian model compa ison [97],
and (2), he Bayesian pos e io p edic i e p- alue (PP p-
alue), ob ained h ough pos e io p edic i e checking o
he likelihood o each po en ial model ( he sum o esid-
uals was used as a as a disc epancy measu e) [41].
Fig. 1 Th ee hypo he ical models o be ween-g oup di e gence in cu ilinea esponse ajec o ies o e ime. Red and black solid lines indica e
he a e age esponse cu e o pa icipan s belonging o one o he o he g oup; dashed lines show he posi ion and age a change poin (s) o
he wo g oups o pa icipan s, o he age a which ajec o ies di e ge be ween he wo g oups. G aph ob ained using simula ed da a
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 5 o 15
Illus a i e da a
We illus a e he applica ion o he p oposed Bayesian
piecewise modeling app oach by using i o in es iga e he
di e gence in child- o adul ajec o ies o BMI be ween
pa icipan s who do and do no de elop adul T2DM in a
well-s udied ongoing popula ion-based p ospec i e co-
ho , he Ca dio ascula Risk in YFS [15]. De ails on s udy
design and on he collec ion o ca dio ascula isk ac o s
be ween 1980 and 2011 a e published elsewhe e [98] and
summa ized in Addi ional ile 1.
In a p e iously published wo k on he YFS coho , ele-
a ed BMI in child en be ween 9 and 18 yea s was asso-
cia ed wi h an inc eased isk o de eloping T2DM in
adul hood [87]. Addi ionally, a sex- and insulin-adjus ed
mixed model inco po a ing pa icipan s ages as a ca -
ego ical a iable, sugges ed ha di e ences in a e age
BMI alues be ween hose who do and hose who do no
de elop adul T2DM ended o eme ge du ing adoles-
cence, becoming ma ginally signi ican om he age o
15 yea s onwa ds. In his app oach, he be ween-g oup
di e ence a each age g oups was assessed by pai wise
compa isons o he p edic ed ma ginal means (i.e. LS-
means), and did no inco po a e BMI ajec o y in o ma-
ion a he indi idual o popula ion le el. In con as ,
he p oposed hie a chical piecewise eg ession app oach
conside s and makes ull use o indi idual ajec o y in-
o ma ion o es o g oup-di e ences a speci ic s ages
o BMI de elopmen om childhood o adul hood.
Unlike ca ego ical app oaches, he p oposed g ow h
model p o ides a clea e ep esen a ion o he unde -
lying pa hological BMI de elopmen among hose who
de elop T2DM in adul hood.
In ou illus a ion, we include 2540 YFS pa icipan s
(1401 emales and 1139 males) ollowed-up a maximum
o six imes be ween 1980 and 2011 (Addi ional ile 2:
Table S1). In o ma ion on adul T2DM s a us was col-
lec ed on pa icipan s a hei la es indi idual adul
ollow-up (i.e. dicho omous ou come coded 0 o pa ici-
pan s wi hou T2DM, and 1 o hose wi h T2DM in
2001, 2007, o 2011). Included pa icipan s had a leas
one BMI measu e a ailable in childhood (i.e. in 1980,
1983 o 1986 be ween age 3 and 18 yea s). Pa icipan s
had on a e age 4.98 epea ed measu es o BMI o e he
s udy pe iod, wi h 90.7% o pa icipan s ha ing 4 o
mo e BMI measu es (Addi ional ile 2: Figu e S1). 88 in-
cluded pa icipan s (3.5%, 44 emales and 44 males) had
T2DM in adul hood. We excluded BMI obse a ions
made among hose aged 3 yea s in 1980 so ha he ages
o pa icipan s conside ed in he ajec o y analysis
anged om 6 o 49 yea s. 3 yea olds we e no included
in he analysis since only 3 pa icipan s in his bi h co-
ho de eloped T2DM in adul hood. Fu he mo e, he
lack o BMI measu es be ween 3 and 6 yea s, p e en ed
modeling he downwa ds slope om in ancy peak, no
he age a adiposi y ebound, which usually occu s be-
o e age 6 yea s in no mal weigh child en [99, 100].
Using BMI da a collec ed on pa icipan s aged 6 yea s
and o e , we expec ha mos pa icipan s had eached
his impo an childhood miles one, and ha a linea
end was hus an app op ia e unc ional o m o ap-
p oxima e childhood BMI g ow h om ha age
(Addi ional ile 3: Figu e S1).
Since sex di e ences in childhood g ow h and pube al
iming ha e been demons a ed [101, 102], subsequen
BMI ajec o y modeling be ween age 6 and 49 yea s
was conduc ed among males and emales sepa a ely
[103]. BMI, especially in adul hood, is sligh ly igh
skewed, bu using log10 ans o med BMI in he model-
ing app oach p esen ed below did no al e ou conclu-
sions. Fo ease o in e p e a ion, we hus p esen esul s
using un ans o med BMI only.
Visual inspec ion o he sex-speci ic smoo hed BMI
ajec o ies con i ms he p esence o a di e gence be-
ween he wo g oups in adolescence (Addi ional ile 3:
Figu e S2). Compa ed o pa icipan s who emain
heal hy, hose who de elop T2DM seem o ha e g ea e
a e age BMI le els by he ime hey a e young adul s, al-
hough i is unclea whe he his di e gence esul s om
a g oup-di e ence in he iming a which he ansi ion
o a slowe BMI g ow h a e happens (Type II di e -
gence) om a g oup-di e ence in a e i sel a e pu-
be y (Type I di e gence), o om bo h (Type III
di e gence).
Al hough he dis al ou come o ‘adul T2DM’is he
g ouping ac o o in e es in ou illus a i e ajec o y
di e gence analyses, we also demons a e how he same
modeling app oach can be used o in es iga e po en ial
in e -coho a ia ion in childhood o adul hood BMI
ajec o ies by conside ing models wi h ‘yea o bi h’as
a ca ego ical le el 2 p edic o o each o he 4 ajec o y
pa ame e s. Indi idual age- and sex-speci ic BMI Z-
sco es a he i s clinic (in 1980) we e also included as
le el 2 p edic o s o each BMI ajec o y pa ame e s o
in es iga e i sys ema ic de ia ion om pa icipan s o
compa able age and sex a baseline had any in luence on
he de elopmen o BMI ajec o ies la e in li e. All
con inuous co a ia es used in he analyses we e s an-
da dized in o de o s abilize he a iance, imp o e no -
mali y o e o s and linea i y o he mean.
Speci ic alues o he hype pa ame e s used in ou il-
lus a i e analyses a e gi en in Addi ional ile 4. While
in p inciple φcan be uns uc u ed, in ou applica ion,
con e gence o some pa ame e s could no be eached
when conside ing an un es ic ed co a iance s uc u e
be ween all ou andom e ec s in he uncondi ional
change poin model (equa ions 1.1 and 1.2), p obably due
o o e pa ame e isa ion. Because ini ial analyses sug-
ges ed a co ela ion be ween he slopes be o e he change
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 6 o 15
poin (b
1i
)and he di e ence in slopes a e he change
poin (b
2i
), we cons ained he model by including a non-
ze o co ela ion be ween hese wo andom e ec s bu
se ing independence o all o he andom e ec s, leading
o a block diagonal s uc u e o φ(Addi ional ile 4). Based
on DIC, his co a iance s uc u e was p e e ed o e mu-
ually independen andom e ec s o bo h males and e-
males (Addi ional ile 4), and used when expending he
ajec o y models wi h le el 2 p edic o s. In ou applica-
ion, we in es iga ed p io sensi i i y by i ing he uncon-
di ional BMI ajec o y model using h ee se s o p io s
o he hype pa ame e s (Addi ional ile 4). Because we
ound ha he choice o hype pa ame e s had a mino in-
luence on he ma ginal pos e io dis ibu ions, o subse-
quen (condi ional) analyses, we chose o epo pos e io
es ima es o pa ame e s es ima ed om he se o p io s
ha yielded he lowes DIC in he sensi i i y analyses
(Addi ional ile 4). In his se he p io s o he means o
he change poin s we e based on he sex-speci ic es ima es
ha maximized he p o ile log likelihood o he ixed
(popula ion-a e age) b eakpoin s in he uncondi ional
model (es ima ed a 16 yea s o emales and 22 o males,
see es ima ion me hod in Addi ional ile 5). Using hese
p io s o he change poin means also kep compu a ion
unning imes easonable.
Fo he o he pa icipan s a ying a iable included in he
analysis, sex- and age-speci ic BMI z-sco es a he i s isi
and bi h coho , p io s we e se o N ~ (0,0.001) o all co -
esponding pa ame e s (i.e. all β
coho
p io s and β
ini ialBMI −
z−sco e
). To emain consis en wi h p e ious analyses o his
da a se [87], ime- a ying measu es o as ing insulin we e
log- ans o med and s anda dized be o e being included as
a le el-1 p edic o in he Bayesian hie a chical models o
imp o e igh skewedness and o linea ize i s ela ionship
wi h BMI Abou 17% o he insulin measu es we e no
a ailable in he da a. The missing da a mechanism o ‘insu-
lin’was conside ed non-in o ma i e, as we ha e no eason
o belie e ha he p obabili y o an indi idual insulin meas-
u e being missing depends on he ue alue o his missing
insulin obse a ion (al hough i may be ela ed o o he ob-
se ed a iables o ha indi idual). We hus conside ha
insulin is missing a andom (MAR), and we speci y a p io
o his co a ia e [104]. Since log (insulin) is app oxima ely
no mally dis ibu ed, we speci y a N~(μ
log(insulin)
,τ
log(insu-
lin)
) likelihood o log(insulin)
i
and place a ague p io on
i s a iance (i.e. τ
log(insulin)~ Gamma(0.001,0,001)
). Unde his
pa ame iza ion, he pos e io p edic i e dis ibu ion o
μ
log(insulin)
and τ
log(insulin)
will be in o med by he obse ed
pa o he da a only. Al hough indi idual insulin measu e-
men s change a each da a collec ion poin , by adding
log(insulin) as a le el 1 co a ia e in he mul ile el model,
he es ima ed ela ionship be ween insulin and BMI de el-
opmen emains cons an ac oss ime [45]. This is a eason-
able assump ion in ou applica ion, since da a explo a ion
did no sugges any sys ema ic pa e ns o change in insulin
le els a he in a-indi idual le el as people age. Tha is, he
age smoo he es ima e ob ained by i ing a gene alized
addi i e mixed model had an es ima ed deg ee o eedom
(ed ) close o 1 and was no signi ican (p- alue >0.3),
which did no sugges a non-linea ela ionship be ween
log(insulin) and age [105].
App oxima e pos e io dis ibu ions o he pa ame e s
o he models conside ed h oughou he analyses a e
ob ained ia MCMC simula ions. Each model an wi h 4
independen pa allel chains o he Gibbs sample (see
Appendix 3 o an example o code). Fo each model,
he i s 50000 i e a ions we e disca ded in a bu n-in
un, and he d aws om he pos e io we e hinned by a
ac o o 10 o educe se ial co ela ion o he chains.
The ollowing 20000 i e a ions we e used o ob ain pos-
e io dis ibu ions o model pa ame e s by mixing he 4
sequences. Model con e gence was assessed h ough
MCMC i e a ions aceplo s and Gelman-Rubin diag-
nos ic [92], and esidual e o s we e plo ed o con i m
hey app oxima ely ollowed a no mal dis ibu ion.
Resul s
Di e gence o BMI p o iles in T2DM and non-T2DM YFS
pa icipan s
Following he modeling app oach p esen ed in he
Me hods and he p io s and hei co esponding hype -
pa ame e s (Addi ional ile 4: Table S1) we i ed he ol-
lowing se o condi ional Bayesian hie a chical piecewise
models o each sex: uncondi ional (Model A), adul
T2DM s a us adjus ed in e cep (Model B), adul T2DM
s a us adjus ed childhood slope (Model C), adul T2DM
s a us adjus ed adul slope (Model D), adul T2DM s a us
adjus ed change poin (CP) (Model E), adul T2DM s a us
adjus ed CP and adul slope (Model F), adul T2DM s a us
adjus ed change poin , childhood and adul slopes (Model
G), adul T2DM s a us adjus ed in e cep , and change
poin (Model G), and a model wi h all ou pa ame e s ad-
jus ed o adul T2DM s a us (Model H). As men ioned
abo e, p e ious esea ch on his da a se sugges ed BMI
le els we e no signi ican ly di e en be ween he wo
g oups in childhood [87]. Models C (i.e. g oup di e ence
in childhood slopes) and B (i.e. BMI esponse consis en ly
highe in one g oup ac oss he li e cou se) we e hus i ed
o demons a e ou modeling app oach. An anno a ed ex-
ac showing he RJAGS code syn ax used o i Model E
isa ailableinAddi ional ile6.
Fo bo h sex, he lowes DIC was ob ained when i -
ing model E, which was also he bes i ing model wi h
PP p- alues close o 0.5 (Table 1). This suppo ed he
ype II di e gence mechanism whe e a di e ence in BMI
le els eme ged be ween he wo g oups due o a g oup
di e ence in he change poin iming. BMI g ow h a e
in adul hood o bo h sexes was dec eased by wo- hi ds
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 7 o 15
compa ed o childhood (i.e. 0.67- s. 0.18 -, and 0.61- s.
0.15 kg/m
2
pe yea in childhood and adul hood o
emales and males espec i ely), and pa icipan s who
de eloped T2DM had simila BMI yea ly a es in adul -
hood compa ed o hose who emained heal hy (β
2T2DM
e ec no signi ican in model F o bo h sex Table 2).
Howe e , emales who de eloped T2DM eached hei
de elopmen al ansi ion in BMI a e on a e age
12.37 yea s la e (Table 2).
Simila ly o males, es ima ed BMI g ow h a es we e
no ma kedly di e en be ween he wo T2DM g oups
in childhood o in adul hood, and compa able o hose
es ima ed in emales (Table 2). Bu again, compa ed wi h
heal hy adul s, hose who de eloped T2DM eached
hei slowe BMI g ow h a e on a e age 6.47 yea s la e .
The e ec o he ime- a ying co a ia e o insulin a
le el 1 was signi ican o bo h males and emales, wi h a
1-sd inc ease in log(Insulin) esul ing in a BMI obse a-
ion inc eased by 2.6 and 2.8 kg/m
2
espec i ely (i.e.
exp(β
log(insulin)
), Table 2). To assess po en ial di e ences
in he magni ude o he insulin e ec as a unc ion o
be ween-pe son cha ac e is ics, we expanded model E by
including an in e ac ion be ween ‘adul T2DM s a us’
and log(insulin). Fo each sex, he es ima ed pa ame e s
we e no signi ican (95% CI included 0), sugges ing ha
he e ec o insulin on BMI was homogenous be ween
he wo g oups and ac oss gende s.
The es ima es o he a iance-co a iance pa ame e s
o model E showed ha he co ela ion be ween an indi-
idual’s BMI g ow h a e in childhood and adul hood is
equal o 0.61 o emales and 0.47 o males, sugges ing
ha child en who ha e g ea e yea ly BMI inc ease a es
also ha e g ea e adul a es o inc ease (co ela ion
es ima ed as: σβ1β2=ffiffiffiffiffiffiffiffiffiffiffi
σ2
β1σ2
β2
p, Table 2). The be ween-
pa icipan a ia ion a ound he change poin σ
CP
was
compa able be ween males and emales (Table 2).
Figu e 2 shows he es ima ed popula ion-a e age
p o o ypical ajec o ies o each sex and T2DM g oup
ob ained om he es ima ed pa ame e s o Model E,
along wi h 100 ajec o ies p edic ed o each sex and
T2DM g oup om Model E by Mon e Ca lo simula ion.
This illus a es a ange o c edible indi idual p o iles
gene a ed unde his model (see Appendix o code). Fo
each sex and adul T2DM s a us g oup, Fig. 3. shows a
box and whiske s plo o he es ima ed indi idual BMI
slopes ob ained om Model E a e he a e age change
poin in he heal hy g oup and be o e he T2DM g oups
each hei a e age CP (i.e. slopes be ween 16.02 and
28.4 yea s in emales, and slopes be ween 21.62 and
28.09 yea s in males). Figu e 3 illus a es ha indi idual
a es o change a e pube y p o ides be e disc imin-
a ion o pa icipan s who wen on o de elop T2DM
om hose who did no , compa ed o punc ual indi idual
BMI le els a age 15 o 18 o emales, and ages 21 and 24
o males (Addi ional ile 2: Figu e S2). While he
Table 1 Analyses o he di e gence in BMI ajec o ies be ween T2DM adul s and non-T2DM adul s: assessmen o Bayesian model
complexi y (e ec i e numbe o pa ame e s pD), and i (de iance in o ma ion c i e ia DIC) o each candida e model
Model Females PP p- al Males PP p- al
Uncondi ional A 26910 (2544) 0.47 19837 (2223) 0.55
T2DMg oup (in β
0
) B 26670 (2366) 0.45 19741 (2270) 0.43
T2DMg oup (childhood slope β
1
) C 26780 (2510) 0.6 19865 (2247) 0.58
T2DMg oup (Adul hood slope β
2
) D 26701 (2401) 0.58 19828 (2242) 0.62
T2DMg oup (change poin CP) E 26076 (2777) 0.52 19762 (2213) 0.51
T2DMg oup (CP + β
2
) F 26504(2430) 0.6 19860 (2271) 0.54
T2DMg oup (CP + β
0
) G 26436 (2751) 0.55 19896 (2242) 0.45
T2DMg oup (all 4 pa ame e s
)
H 26532 (2978) 0.52 19920 (2435) 0.51
Repo ed o each model a e DIC (pD), and pos e io p edic i e p- alues (PP p- al). Bes i ing models a e indica ed in bold cha ac e s
Table 2 Pos e io mean pa ame e es ima es o Bayesian
hie a chical Piecewise BMI ajec o y o bes i ing ajec o y
di e gence models in males and emales (Models E)
Females
Model E
Males
Model E
β
0
I 26.5 (0.20) 27.46 (0.16)
β
1
S1 0.67 (0.012) 0.61 (0.01)
β
2
S2 −0.49 (0.015) −0.46 (0.06)
CP CP 16.02 (0.29) 21.62 (0.42)
CP
T2DM
CP 12.37 (1.21) 6.47 (1.23)
σ
β0
2.07 (0.05) 2.36 (0.07)
σ
β1
0.02 (0.005) 0.06 (0.004)
σ
β2
0.07 (0.006) 0.05 (0.004)
σ
β1β2
0.11 (0.05) 0.14 (0.03)
σ
CP
3.1 (0.26) 4.3 (0.2)
σ1.33 (0.02) 1.21 (0.01)
β
log(insulin)
1.01 (0.04) 0.98 (0.03)
Pos e io s anda d de ia ions (unce ain y in he pa ame e s) a e epo ed in
b acke s. Repo ed β
0
coe icien s a e in kg/m
2
,β
1
and β
2
a e in kg/m
2
pe
yea , CP and CP
T2DM
a e in yea s. All σcoe icien s a e s anda d de ia ions o
he co esponding g ow h pa ame e s and he esidual e o . β
log(insulin)
coe icien s a e in kg/m
2
o a 1 sd inc ease in log(insulin) le el
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 8 o 15
dis ibu ion o BMI le els a age g oups su ounding he
age a di e gence o e laps conside ably (Addi ional ile 2:
Figu e S2), indi idual slopes allow o di e en ia e pa ici-
pan s who ha e swi ched o a a e consis en wi h a no -
mal slowing down o BMI de elopmen a e pube y,
om hose who a e s ill on he ajec o y o inc easing
BMI de elopmen consis en wi h he a e om
childhood.
E ec o age-and sex-speci ic childhood Z-sco e on BMI
ajec o ies
When including indi idual age-and sex-speci ic BMI z-
sco es a he i s clinic as con inuous le el 2 p edic o s
o each o he ou g ow h pa ame e s in sex-speci ic
Models E, he only signi ican e ec obse ed was o
he childhood BMI slope, wi h a 1-sd inc ease in BMI
z-sco e associa ed wi h a 0.056 (sd = 0.012) and a 0.038
(sd =0.009) inc ease in childhood (in kg/m
2
pe yea ) o
male, and emales espec i ely. This sugges s ha in he
YFS sample, highe age- and sex-adjus ed BMI a i s
isi in childhood we e associa ed wi h as e BMI in-
c ease in childhood, bu no wi h he age a ansi ion in
BMI de elopmen no he change a e in adul hood.
Be ween coho he e ogenei y in BMI ajec o ies
To es whe he ‘yea o bi h’was associa ed wi h
be ween-pa icipan he e ogenei y in he de elopmen o
BMI om age 6 o 49 yea s, i e bina y dummy a iables
iden i ying BMI obse a ions o people bo n in di e en
yea s (i.e. 62, 65, 71, 74 and 77) we e in oduced as le el 2
Fig. 2 Sex-speci ic popula ion a e age p o o ypical BMI ajec o ies o heal hy and T2DM adul s in he YFS coho (solid blue and solid ed lines,
espec i ely) and p edic ion o 200 indi idual ajec o ies o each sex (100 pe T2DM s a us g oup). The dashed ajec o ies we e ob ained by
MCMC simula ion using sex-speci ic pos e io es ima es o mean and a iance o g ow h pa ame e s o he bes i ing models (Model E). In hese
p edic ions, ime a ying measu es o log(insulin) we e se o he a e age log(Insulin) obse ed in he coho
Fig. 3 Box and whiske s plo o i ed indi iduals andom slopes be ween 16.02 and 28.4 yea s o emales (a) and be ween 21.62 and 28.09 yea s
o males (b). Indi idual andom slopes a e es ima ed om he Bayesian hie a chical andom change poin model E. Solid lines in he boxplo
indica e he g oup-speci ic median o he slopes (equi alen o he 50 h pe cen iles o he pos e io dis ibu ion)
Busco e al. BMC Medical Resea ch Me hodology (2017) 17:86 Page 9 o 15