Message/Author 

Anonymous posted on Tuesday, May 04, 2004  4:14 pm



I'm trying to specify a growth model of my contiuous DV measured yearly from age 13 to age 22. I want to specify a piecewise model that captures linear growth from age 1315, 1619, and 2022. Can you help me to determine how I should specify this model in mplus? 


Example 6.11 shows how to set up a piecewise model for two parts. This can be generalized to three. 

Anonymous posted on Wednesday, May 05, 2004  2:01 pm



Thank you. Would you please take a look at this to make sure that I'm generalizing to 3 pieces correctly? i BY y13y22@1; s1 BY y13@0 y14@1 y15@2 y16y22@2; s2 BY y13y15@0 y16@0 Y17@1 y18@2 Y19@3 y20y22@3; s3 BY y13y19@0 y20@0 y21@1 y22@2; I'm confused about whether the y16y22 for s1 should be @2 or @0. Likewise, should y20y22 for s2 be @0 or @3? Thanks for your help. 


The end point of one piece should be the beginning point for the next piece if they are sequential. In the user's guide example, the timescores are: 01222 00012 so the first piece ends at 2 for the third repeated measure. The second piece starts at the end of the first piece. Your time scores are: 0 1 2 2 2 2 2 2 2 2 0 0 0 0 1 2 3 3 3 3 0 0 0 0 0 0 0 0 1 2 I'm not sure which measures are part of which piece given your time scores. 


I am creating a similar model and have a couple of questions. I have seven timepoints. I am interested in understanding the effect of an intervention which would have occured between timepoints 6 and 7. The outcome is the percentage of students in a school that enter college. Overall college enrollment rates have been slowly increasing in my state each year. I want to seperate this effect from the possible effect of the treatment. Should I specify my time scores as: 0 1 2 3 4 5 6 0 0 0 0 0 0 1 or 0 1 2 3 4 5 5 0 0 0 0 0 0 1 ? Finally, will the model be identified given that the second slope will apply to only a single timepoint? 


You are correct that the second piece would not be identified. I would use a single model and add a direct effect of the time 7 outcome on the dummy variable of intervention. So y7 ON intervention; 


Hello. I have been recently trying to specify a piecewise paramterization. The observations are in months/10 and are at initiation, 3, 6, 12 ,18, 24, 30, and 36 months. I have been trying to specify two parts, with four observations each, one over the first year and the second over the remaining two years. Is the following correct? i1 s1 Q1 pos1@0 pos2@0.3 pos3@0.6 pos4@1.2 pos5@1.8 pos6@1.8 pos7@1.8 pos8@1.8; s2 Q2 pos1@0 pos2@0 pos3@0 pos4@0 pos5@0.6 pos6@1.2 pos7@1.8 pos8@2.4; Thanks in advance 


Note that you need to mention the intercept growth factor in both parts of the growth model. Just use the same name. The way you have your second model specified, Mplus would interpret it as a linear model because it has two growth factors. In Chapter 16, there is a table that shows a piecewise growth model. I would specify the timescores for the piecewise growth model as follows. Piece 1: 0 .5 1 2 2 2 2 2 Piece 2: 0 0 0 0 0 1 2 3 


Thanks for the reply Linda. Hovever for my second piece, shouldn't the order be: Piece 1: 0 0.5 1 2 2 2 2 2 Piece 2: 0 0 0 0 1 2 3 4 In your proposed paramterization, I am not modelling the movement between 12 and 18 months? Sorry, still a bit confused. 


Yes, the second piece should be as you state when there is one intercept growth factor. 


Hello Muthens, I have some intervention data collected at pre, post 6, 12, 24, 36 month followups. I want to compare two randomized intervention conditions on various externalizing outcomes. The problem is there is a large drop in externalizing problems from pre to post, then only modest linear change in the outcome across the followup assessments. A quadratic does not fit the data well. It is more like a piecewise model with the first slope consisting of change from prepost, and the second consisting of linear change occuring after the intervention has been completed. Because there are only two timepoints for the first piece the model it is not identified. I have considered leaving out the baseline assessment since random assignment makes the two treatment groups of interest equal prior to treatment. However, I was wondering if you had any suggestions for dealing with this problem. 


One approach that I have used is to work with piecewise growth as you say, where the first piece has only a random intercept (centered at the baseline) but a fixed slope. This is then identified from 2 time points. The second piece can have its own intercept and slope which are both random. So part of the intervention effect is on the fixed slope of the first piece and part is on the random intercept and slope of the second piece. I would not leave out the baseline assessment from the growth modeling. 


Bengt, I am having problems getting it to run. Is this how it would be specified for six equally spaced time points: i1 s1  ext1@0 ext2@1 ext3@1 ext4@1 ext5@1 ext6@1; i2 s2  ext1@0 ext2@0 ext3@1 ext4@2 ext5@4 ext6@6; [ext1ext6@0 i1 i2 s1 s2]; s1@0; s1 with i1@0 s2@0 i2@0; So would the interpretation for the first slope (which is fixed) be the the average prepost intervention effect for all participants, and the second intercept would represent individual deviations from this average effect. 


No, when you have separate intercept factors, you work with 2 separate (but correlated) growth processes, e.g.: i1 s1  ext1@0 ext2@1; s1@0; i2 s2  ext3@3 ext4@2 ext5@1 ext6@0; where you center i2 at the last time point. Nothing else needs to be said, except of course s1 i2 s2 on tx; Check Tech1 to make sure you get i1 correlated with i2, s2. 


Bengt, Thanks. Just to clarify the regression should be i1 i2 s2 on tx; Correct? Because S1 has a variance fixed to 0. D 


You don't want to regress i1 on tx because i1 refers to the preintervention time point. You can regress s1 on tx even though s1 has variance zero. The regression implies that the s1 mean is different for controls and tx subjects, so that describes the first drop that you mentioned. 


I am modeling change over time with 6 equally spaced time points each 2 years apart. My means are: 1.557 1.587 1.590 1.613 1.624 1.588 Would it be inappropriate to have a piecewise growth model with 4 pieces? For example: 0 2 2 2 2 2 0 0 2 2 2 2 0 0 0 2 4 4 0 0 0 0 0 2 Thank you! 


This would not be identified. We recommend at least three repeated measures for each piece. 


Hello, I am using a piecewise growth model to describe late elementary school and the transition to middle school. The linear model for each piece estimates fine, but when I add a quadratic function, the model will not converge. To ask for the quadratic function, I am adding a "q" as I would in a traditional growth model. Do I need to do something different? Here is an example of the syntax... i s1 q1 g3fasxex@0 g3sasxex@1 4fasxex@2 g4sasxex@3 g5fasxex@4 g5sasxex@5 g6fasxex@5 g6sasxex@5 g7fasxex@5 g7sasxex@5; i s2 q2g3fasxex@0 g3sasxex@0 g4fasxex@0 g4sasxex@0 g5fasxex@0 g5sasxex@0 g6fasxex@1 g6sasxex@2 g7fasxex@3 g7sasxex@4; If it helps, this data has planned missingness, so I have had to set the covariance coverage to 0 to account for no students having data in both the 3rd and the 7th grade. 


A second question: if both slopes of a piecewise model appear similar, is there a way to test (through some kind of constraint) whether a single slope, rather than two slopes, fits the model just as well as two processes? Would you consider these models nested? Thank you for any insight. Gwen 


If you have no data for certain timepoints, you reflect this through the time scores, for example, if you measured in years 1, 2, and 4, the time scores would be 0, 1, and 3. You don't do this through missing data. Usually a piecewise model is used to break a growth curve that is not linear into linear pieces so I don't understand why you are adding a quadratic growth factor. You can test if the slope of the two pieces are equal by chisquare difference testing of the two nested models or by using MODEL TEST. 

Bill Dudley posted on Thursday, July 03, 2008  9:26 am



I have longitudinal data on recovery from cancer treatment. There are six time points (0, 6, 12, 18, 24 and 36). The time = 0 is prior to treatment and then starting with 6 months we have the recovery phase. The means show a jump between T1 and t2 so it makes sense to fit a two piece model. The first linear piece has only two time points so I have looked at the notes below re fixing s1 variance and the s1, i covariance. I assume that in the second piece that the time 2 serves as the intercept for that curve. I also want to include covariates  age and treatment type (a binary variable). Question1  So I wonder if I should model an i2 as well as i. Question2  If s1 and i are fixed then it makes no sense to look for predictors of s1…. Correct? Question 3  I also can fit a nice quadratic curve to the data without the piecewise approach. I assume that although this fits, it is not valid given the nature of the data collection and the mean and that I should stick with the piecewise… Correct? 


Q1 Yes Q2 You can. Think of a gender dummy variable where s1 is different for males and females  that can be identified. But the residual variance for s1 then needs to still be zero. Q3 If the second piece does not need a quadratic and if having only one piece that is quadratic fits the data well I would do one piece quadratic. My experience is that 2 pieces are needed  and they might have different covariate influence. 


Thanks for the reply to my post on July 3rd. Just a follow up if I might. With regard to Q3  are you saying that I should use a one piece quadratic model rather than a two piece or are you saying that in cases such as mine two piece models are preferred? 


Use the 1piece quadratic if it fits well. If it doesn't, use 2 pieces. 

Tim Stump posted on Friday, October 30, 2009  8:12 am



I'm specifying a linear growth model with 5 unequallyspaced time pointsbaseline and then followup at 2, 4, 8, and 12 wks from baseline. I'd like to specify a piecewise model since most of the change in individuals occurs between baseline and 2 wks and then they don't exhibit as much change after that. Would the timescores in the following statements be correct: i s1  var0@0 var2@2 var4@2 var8@2 var12@2; i s2  var0@0 var2@0 var4@2 var8@6 var12@10; I'm most unsure about the second slope factor. Thanks. 


This looks right. Note that the s1 variance cannot be identified from only 2 time points and will have to be fixed at zero. You can also consider a more flexible model with 2 different intercepts: i1 s1  var@0 var2@2; s1@0; i2 s2  var4@0 var8@4 var12@8; 

Tim Stump posted on Monday, November 02, 2009  6:53 am



Thanks for your reply to my post on 30oct2009. I have a followup question. By specifying s1@0, I'm setting the variance of the slope factor s1 to be zero. Can I still make comparisons on the mean of the slope factor s1? Say I have a binary covariate named group coded 0 or 1. If I add: i s1 s2 on group; to the model, does it still make sense to test for differences in the mean s1 across group even though the variance is contstrained to zero? 


Yes, because it simply says that the s1 mean is different for the two groups. 


Hello, I would like to continue with this thread by asking some additional questions: I would like to run a piecegrowth model. The reason I'd like to do this is because I have four time points, but a linear model does not fit the data. Specifically, there is a big change between time 1 and time 2. The change between time 24 is less dramatic. Substantively, time 12 represents the transition into elementary school and var is achievement. The data points are measured in twoyear increments. My model looks like this: i1 s1  var1@1 var2@0 ; s1@0 ; i1 s2  var2@0 var3@2 var4*4 ; I have found I have to free the time 4 factor loading to get the model to run. The estimated time score for this model is 2.067. Here are my questions: First, should this var4 time score alarm me? If I run a gc from times 24 and free the time 4 loading, the model runs and has good model fit. The estimated time 4 factor loading for this model is 2.65. If I estimate a quadratic using times 14, I get an error message. Secondly, I’d like to allow the intercepts to be different (specifying i1 and i2), but this model does not run. Could you suggest why this might be and how I can fix it? Thank you very much for your help! 


For a piecewise model, you need to include all outcomes in both pieces. Your piecewise model is set up incorrectly. See Example 6.11. If you want different intercepts, you could try: i1 s1 var1 var2; i2 s2 var3 var4; s1@0 s2@0; With only two measures, you cannot identify the variances of the slope growth factors. You can't include the same outcome in more than one growth model. 


Linda, Thank you for your help. So, if I wanted to estimate a piecewise model with the same intercept for each piece (as above), my model should actually look like: i1 s1  var1@1 var2@0 var3@0 var4@0; i1 s2  var1@0 var2@0 var3@2 var4*4 ; Also, you mention that with only two measures, I cannot identify the variances of the slope growth factors. This is why I need to set s1@0, which I understand, but as I think about it, is beginning to seem problematic because I'd like to look at the covariance of s1 with s2. Moreover, I am assuming that everyone has the same s1, which is not the correct. Are there other ways of dealing with this issue that you might suggest? Perhaps I could calculate a deviation score between t1 and t2, and use that to predict i1 and s2? As I mentioned in my previous post, I was considering a piecewise approach because there is considerable growth between t1 and t2, and more modest growth between t2t4. 


If s1 is zero, the covariance between s1 and s2 is also zero. See the Topic 3 course handout starting at Slide 106 where six ways to model nonlinear growth are described. Maybe something there will help you. 


Hello Muthens, I would like to do a GMM identifying latent classes of individuals who have differential responses to treatment (e.g., responders, nonresponders). I have intervention data collected at pre, post 6, 12, 24, 36 month followups. When I initially modeled the data using a traditional growth curve approach, a quadratic growth did not fit the data well. Instead, I found that a two process model fit well with the first process consisting of change from prepost, and the second process of linear change occuring after the intervention has been completed (see below). Now that I am moving toward a GMM, I am not sure how to include both processes to define different latent classes across all assessment points. Is it possible to use both processes to define a latent trajectory classes. i1 s1  ext1@0 ext2@1; s1@0; i2 s2  ext3@3 ext4@2 ext5@1 ext6@0; 


A sequential process growth model can be used in GMM. 


I assume that "Piecewise Growth Modeling" is not an option when a dependent variable is measured at only three time points, correct? 


That is true. 

Jon Elhai posted on Thursday, May 19, 2011  6:04 pm



I'm not sure if piecewise growth modeling would be appropriate... But I have 4 timepoints in a growth model, each of which are equidistant (measured every 2 weeks). But for the scores over the four weeks, the slope looks unlike the slopes I usually see in the Mplus forum. In this example, the observed scores would take the shape of something like: 100 (time1), 50 (time2), 80 (time3), 65 (time4). Would a piecewise model be appropriate, or some transformation of the time scores? 


Four time points is not enough to identify a piecewise model. Perhaps the outcome is not suitable to a developmental model given the up and down nature of the data. 

Anne Chan posted on Sunday, April 15, 2012  4:59 am



Hello! I specified two models. The first model is just a basic linear oneslope model: i s Y75@0 Y76@1 Y77@2 Y79@4 Y82@7; The second one is a piecewise (twopieces) model, constraining the slope 1 and slope 2 to be the same: i s1 Y75@0 Y76@1 Y77@2 Y79@2 Y82@2; i s2 Y75@0 Y76@0 Y77@0 Y79@2 Y82@5; [s1] (p1); [s2] (p2); MODEL CONSTRAINT: p1 = p2; May I ask if they are basically the SAME model? Thanks a lot! 


The two models are the same with respect to the means but not the variances and covariances. 


Hi, I am trying to model data on students' wellbeing across the school year, and have 6 time points. What I am finding is that wellbeing decreases from SeptemberDecember, then jumps back up in January, and decreases again throughout the second semester (JanuaryApril). My means are as follows: 4.764 4.421 4.378 5.058 4.659 4.386 I tried a piecewise model, with 3 pieces, one for each of the semesters, and then one for the change during the break (DecemberJanuary), which I constrained to 0 as suggested above i s1  t1wb@0 t2wb@1 t3wb@2 t4wb@2 t5wb@2 t6wb@2; i s2  t1wb@0 t2wb@0 t3wb@0 t4wb@1 t5wb@1 t6wb@1; s2@0; i s3  t1wb@0 t2wb@0 t3wb@0 t4wb@0 t5wb@1 t6wb@2; Is this correct? The fit is not great... thank you! 


How about having 2 intercepts so you easily capture the Xmas break jump: i s1  t1wb@0 t2wb@1 t3wb@2; i2 s2  t4wb@0 t5wb@1 t6wb@2; 

JMC posted on Wednesday, July 03, 2013  7:08 am



I am running into a similar problem as a post above. I have three time points (time 1time 2 with traditional instruction and time 2time 3 with an intervention). I wanted to compare the direction and rate of change for significance, but I don't think there are enough time points to do this. Is there any work around for this? I saw above a suggestion for setting up an intervention dummy variable, but I don't know how to set this up. Thank you. 


If the intervention happens between the second and third time points, you can have a dummy variable pointing to Y3. 


Dear Drs. Muthen, I am running multivariate piecewise growth models. I have been using a single intercept with 2 slopes, but someone has recommended I use 2 intercepts instead. Are there any advantages/disadvantages to using 2 intercepts rather than 1 intercept in a piecewise model? Thanks Kara 


Using two intercepts is not really a piecewise model. With two intercepts, you have two sequential processes. Your theory should guide your decision. 

Anne Chan posted on Wednesday, July 30, 2014  7:56 am



I have six waves of data. I specified (1)a curvilinear model with one slope and one quadratic term across the six measurement points: I S Q Y1@0 Y2@1 Y3@2 Y4@3 Y5@4 Y6@5; (2)a piecewise model which estimate the slope for the first three measurement points and the last three measurement points: I S1 Y1@0 Y2@1 Y3@2 Y4@0 Y5@0 Y6@0; I S2 Y1@0 Y2@0 Y3@0 Y4@1 Y5@2 Y6@3; May I ask if these two models are nested? If they are not, how can I test if one of them significantly fit the data better? Thanks! 


If you instead write the piecewise model as I S1 Y1@0 Y2@1 Y3@2 Y4@2 Y5@2 Y6@2; I S2 Y1@0 Y2@0 Y3@0 Y4@1 Y5@2 Y6@3; you obtain the first model as a special case where the mean and variance of s1 are the same as for s2, but the covariance for s1 and s2 would need to lead to correlation 1 which is on the border of the admissible parameter space. So I don't think nested chisquare testing works. Use BIC instead to compare and absolute fit (for each model) to decide which one is good enough. 

Anne Chan posted on Saturday, August 09, 2014  4:38 am



Hello! Thanks for your reply. May I ask what is "absolute fit" for each model? Are there any indices on absolute fit showing on the output files? Thanks a lot! 


By absolute fit I mean the fit of your H0 model compared to the unrestricted H1 model, that is, the usual chisquare/RMSEA/CFI testing  as opposed to relative fit measured by BIC where you compare two different H0 models. 

Anne Chan posted on Monday, August 18, 2014  7:29 am



Hello! May I ask if the following two models are nested or not: A basic LGC model: I S Y1@0 Y2@1 Y3@2 Y4@3 Y5@4 Y6@5; A piecewise model: I S1 Y1@0 Y2@1 Y3@2 Y4@2 Y5@2 Y6@2; I S2 Y1@0 Y2@0 Y3@0 Y4@1 Y5@2 Y6@3; Thanks a lot! 


You can try this out yourself by using the twopiece model with the further constraints: [s1] = [s2] s1 = s2 s1 with i = s2 with i If that gives the same loglikelihood as the singlepiece model, the singlepiece model is nested within the twopiece model 


Is it possible to specify a model with two different intercepts and the same slope (so parallel growth trajectories)? I'm not sure how to change the syntax, but I have a score change between SC9 and SC10. This is my current model: Intcpt Slope  SC7@0 SC8@1 SC9@2 SC10@3 SC11@4; Intcpt Slope ON M6 GENDER; [Intcpt Slope]; This is my other model for 2 slopes: Intcpt Slope1  SC7@0 SC8@1 SC9@2 SC10@2 SC11@2; Slope2 BY SC7@0 SC8@0 SC9@0 SC10@1 SC11@2; Intcpt Slope1 ON M6 GENDER; [Intcpt Slope1 Slope2]; Slope2@0; slope2 with slope1@0; slope2 with Intcpt@0; Thank you for any help you can provide! 


How about int1 slope  sc7@0 sc8@1 sch9@2; int2 slope  sc10@0 sc11@1; 


Thank you so much for your help! When I used your suggested code, I received an error message that the growth process was previously defined. However, the following code seems to be workingdo you think it looks ok? Intcpt1 Slope  sc7@0 sc8@1 sc9@2 sc10@3 sc11@4; Intcpt2  sc10@0 sc11@1; Intcpt1 Intcpt2 Slope ON M6 GENDER; [Intcpt1 Intcpt2 slope]; Intcpt2@0; Intcpt2 with Intcpt1@0; Intcpt2 with slope@0; 

Jon Heron posted on Thursday, December 11, 2014  4:57 am



So you want consistent linear change with a vertical jump midway through the process? that's a little unusual. If you're happy for everyone to have the same vertical jump and you don't actually want to be able to predict it with covariates you could capture this through a nonzero but constrained equal intercept for the last two measures. Excuse the awkward double use of intercept there. Intcpt Slope  sc7@0 sc8@1 sc9@2 sc10@3 sc11@4; [sc10* sc11*] (fix); 


Heather  I think your version looks ok. But do you really get identification problems unless you say intcpt2@0? Our Topic 3 handout, slide 122 refers to your situation. That slide shows two slopes (one for each piece), but you could hold their means and variances equal. Your situation is a little harder because the second piece has just 2 time points. 


Hello Mplus Team, I am trying to fit piecewise linear model to the trajectories and get the classes. I want the break point to be determined automatically from the fit rather than the user input as I have done below: MODEL:%OVERALL% i1 s1  x1@0 x2@0.25 x3@0.5 x4@0.5 x5@0.5 x6@0.5 x7@0.5 x8@0.5 x9@0.5 ; i2 s2  x1@0 x2@0 x3@0 x4@0.25 x5@0.5 x6@0.75 x7@1 x8@1.5 x9@2.5 ; How should I define my model so that the break point is also determined automatically? 


We don't offer changepoint analysis yet, which is the common way to deal with this. 

fred posted on Wednesday, June 17, 2015  2:05 am



Hello, I am fitting a piecewise model with two intercepts to a 6 timepoints (baseline, 4 months, 8 months, 12 months, 18 months, and 24 months) assessment wheere there is a steep decrease from the first to second assesment followed by an increase from T2 to T6. Here are the sample means: T1= 60.662 T2=56.489 T3=68.144 T4=70.304 T5= 71.445 and T6= 71.472 This is my model i1 s1 aQL2@0 bQL2@4; s1@0; i2 s2 cQL2@8 dQL2@12 eQL2@18 fQL2@24; The model fit is excellent, but the estimated intercepts have means at s1 = 60.649 and i2 67.204. I cannot make sense of why the second intercept is not corresponding to the second assement which would be lower than the first asessment. The plot of sample and estimated means show excellent correspoendence. Thanks in advance for gudiance 


This is because you have cQL2@8 instead of @0, which means that the s mean influences the outcome too. 

fred posted on Thursday, June 18, 2015  3:44 am



Thank you Bengt, What I am missing is a way to model the slope from 4 months to 8 months (that is bQL2@4 to cQL2@8) I am interpreting the current model as addressing base line to 4 months change, and then from 8 months to 24 months. How can I go about for getting the 4 to 8 months slope included in the model? 


I think you are asking for 3 pieces. So try something like this where the s1 and s2 pieces share the same intercept: i1 s1 aQL2@0 bQL2@4 cQL2@4; s1@0; i1 s2 aQL2@0 bQL2@0 cQL2@4; s2@0; i2 s2 dQL2@0 eQL2@6 fQL2@12; 

Back to top 