Change that occurs in distinct phases or regimes can be modeled using piecewise (spline) functions (see, e.g., Gallant & Fuller, 1973; Seber & Wild, 1989, Chapter 9) where the overall piecewise regression model is a complex amalgamation of submodels, each of which is associated with a distinct interval of time (see, e.g., Cudeck & Klebe, 2002). Because the functional form in each segment can be tailored to fit the localized data (Cudeck & Harring, 2010), the piecewise growth model is quite flexible and can accommodate a variety of modeling scenarios that are not adequately captured by mathematical functions for single-stage change processes (Grimm et al., 2011; Ram & Grimm, 2009; Sterba, 2014) and/or often yield parameters with more meaningful and substantive interpretations.

For example, consider the two-phase linear-linear piecewise model depicted in Fig. 1. The changepoint distinguishes between two phases comprising the overall change process. On the left-hand side of the changepoint are the localized data corresponding to phase 1 in which a linear function is superimposed. The data in this phase also suggests that some curvilinear function in t, such as a quadratic function, may also be appropriate. The localized data to the right of the changepoint represent the change process across the second phase. It is clear from the graph that change appears constant across larger values of t and might be best characterized by a linear function where the rate of change is assumed to be zero.

Fig. 1
figure 1

A generic piecewise model with two phases and a single changepoint

Specification and estimation of piecewise growth models within a mixed-effects modeling framework has been thoroughly discussed in several articles (see, e.g., Cudeck & Klebe, 2002; Naumova et al.,, 2001) and book chapters (see, e.g., Fitzmaurice et al.,, 2011; Hoffman, 2015; Verbeke & Molenberghs, 2000). Cudeck and Klebe (2002), for example, fit a quadratic-linear mixed-effects model with zero- and first-order continuity constraints (Seber & Wild, 1989) to nonverbal performance data obtained from a life span study. Even though a polynomial was fit to each of the two segments comprising the growth model, the changepoint marking the shift from the first phase to the second phase was an unknown, subject-specific coefficient to be estimated from the data, thereby making the overall function intrinsically nonlinear.Footnote 1 These authors, and others (see, e.g., Grimm et al.,, 2017), demonstrated how this piecewise mixed-effects model could be fitted using SAS PROC NLMIXED—a module that allows user-defined conditional or Boolean logic programming statements (e.g., if-then statements) and integration of SAS PROC IML functions—allowing the estimation algorithm to parse an individuals’ data to fit one segment or another in a straightforward manner. If the changepoint denoting the transition from one phase to another does not vary from person to person or has a known value, then conventional multilevel modeling software, like SAS PROC MIXED (see, e.g., Hoffman, 2015; Verbeke & Molenberghs, 2000) or the lmer function in the lme4 package in R can be used.

Although the implementation of piecewise growth models as mixed-effects models is relatively straightforward, fitting these same models as latent growth models using structural equation modeling (SEM) software programs has proven to be more challenging because SEM software generally does not allow user-defined programming statements. However, the majority of SEM programs do have the facility to implement nonlinear constraints on model parameters, which permits, for example, the elements of the factor loading matrix to be expressed as nonlinear functions of growth model parameters and constants (see, e.g., Blozis et al.,, 2008; Grimm & Ram, 2009; Preacher & Hancock, 2012; Preacher & Hancock, 2015). It is precisely this nonlinear constraint functionality that allows one to fit piecewise latent growth models with SEM software. Harring et al., (2006) discuss how a conditionally-linear form of a bilinear (linear-linear) piecewise LGM could be implemented in SEM software by reparameterizing the model to a form that can take advantage of the nonlinear constraints of the program. This is accomplished using a variant of the minimum/maximum function for monotonic (i.e., always non-decreasing or non-increasing) functional relations between the response and time (see, Harring et al.,, 2006, for a complete description). This reparameterization permitted newly derived parameters to be recast from regression parameters of the original linear-linear growth function. One drawback of this approach at that time was that the reparameterized coefficients—simple functions of the original parameters—no longer related directly to the underlying developmental process and therefore lacked meaningful substantive interpretation, thus requiring back transformation of the model parameters. Modules in contemporary SEM software (e.g., the NEW command in Mplus) that allow new parameters to be derived from those estimated as part of the model now make this latter point moot.

Numerous examples exist in the methodological literature demonstrating how various nonlinear growth functions can be formulated in a latent growth modeling framework and implemented utilizing nonlinear constraints (see, e.g., Blozis et al.,, 2008; Choi et al.,, 2009; Grimm and Ram, 2009; Grimm et al.,, 2017; Preacher & Hancock, 2015; Sterba, 2014). The bilinear piecewise latent growth model introduced by Harring et al., (2006), for instance, has been extended to second-order factor structures (Kohli and Harring, 2013), growth mixture models (Kohli et al., 2013; Kohli et al., 2015; Kohli et al., 2016), and random changepoints (Feng et al., 2019; Grimm et al., 2017; Preacher & Hancock, 2015). Other methodological advances include extending piecewise LGMs to repeated measures data with measurement occasions that may vary across individuals in placement and/or number (Sterba, 2014) and to empirically determine the number and locations of changepoints in a dataset using an automated search algorithm (Marcoulides, 2018). These latter two methods impose the rather strict assumptions that changepoints are known (Sterba, 2014) and the same for all subjects (Marcoulides, 2018; Sterba, 2014). These methodological elaborations notwithstanding, applications of piecewise LGMs beyond two-phase monotonic, polynomial processes with known and/or fixed changepoints are scarce and may reflect the apparent difficulty in implementing such models in standard SEM software. To address this methodological gap, we demonstrate through three empirical examples how Mplus (version 8.1; Muthén & Muthén, 1998) and lavaan in R (version 0.6-5; Rosseel, 2012)—popular mainstream SEM software—can be utilized to fit a broader class of piecewise LGMs to describe non-polynomial growth within a given phase, non-monotonic growth over the entire measurement period, growth that encompasses more than two phases, and that allows the changepoints to be unknown (freely estimated from the data) and/or to vary across individuals.

As was pointed out previously (see, e.g., Blozis, 2007; Blozis et al.,, 2008; Grimm et al.,, 2017; Harring et al.,, 2006; Harring et al.,, 2012), SEM programs such as Mplus, LISREL, and laavan in R, remain the tools of choice of many researchers for analyzing a wide range of models. This is especially pertinent given recent advancements of SEM software to fit multilevel models to nested data structures, finite mixture models to account for population heterogeneity, and longitudinal models for intensive data collection designs. Yet, it is the most basic functionality of SEM programs—specification of latent repeated outcomes (i.e., second-order latent growth models; Hancock et al.,, 2001), incorporation of measured and latent variable covariates (Blozis & Cudeck, 1999), extensions to multiple group structures (McArdle & Nesselroade, 2014), accommodation of multivariate repeated measures (Blozis, 2004), and use of well-understood indices of model fit that make keeping analyses within the same software environment attractive.

In the remainder of this manuscript, we first review how piecewise growth models can be formulated in the latent growth modeling framework. Then, building off of the oft-utilized bilinear piecewise LGM, we extend the piecewise LGM framework to segmented polynomials and inherently nonlinear functions in subsequent sections. Finally, we shift to modeling a three-phase longitudinal process. As the elaborations are introduced, analytic decision points will be discussed such as whether (a) the segments join at the changepoint and how to incorporate this information into model specification; (b) the growth factors, including the changepoints, are random or fixed and how this decision impacts the model specification in the software; and (c) the inclusion of latent variable covariates as time-invariant predictors of piecewise growth.

Piecewise growth models

Specifying piecewise functions in a latent growth modeling framework follows, at least initially, the notation exploited by Cudeck and Klebe (2002). Let yij denote the response of the i th individual on the j th occasion with \(j = 1,2,\dotsc ,n_{i}\). The occasion of the measurement or the elapsed time from the beginning of the study to the j th assessment is tj. The collection of responses for individual i is denoted by \(\mathbf {y}_{i}=(y_{1},\dotsc ,y_{n_{i}})^{\prime }\), which is to be evaluated according to a given set of time points \(\mathbf {t}_{i}=(t_{1},\dotsc ,t_{n_{i}})^{\prime }\), where ni is the total number of measures for the individual. In contrast to the specification typical of mixed effect models, latent growth models are frequently, but not always, applied to a time-structured design in which measurement occasions are fixed across all individuals (McNeish & Matta, 2018). The i subscript on n is included to allow for the possibility that the length of and elements that comprise ti may vary across individuals (see, e.g., Blozis & Harring, 2015; Sterba, 2014). For the individual, the piecewise growth model can be written as

$$ \mathbf{y}_{i} = f(\mathbf{t}_{i}, \boldsymbol{\theta}_{i}) + \mathbf{e}_{i}, $$
(1)

where f defines the functional form of the growth model as a function of time (ti) and individual growth coefficients, θi, and \(\mathbf {e}_{i}=(e_{i1},\dotsc ,e_{in_{i}})^{\prime }\) is the set of time-specific residuals induced by imperfectly capturing the trajectory of yi through f. In their simplest form, the individual coefficients are decomposed into the sum of fixed effects (θ) and random effects (ui), respectively

$$ \boldsymbol{\theta}_{i} = \boldsymbol{\theta} + \mathbf{u}_{i}. $$

The fixed effects (θ) are growth parameters for the typical individual. The random effects (ui) and time-specific residuals (ei) are assumed to be independent [i.e., \(cov(\mathbf {u}_{i},\mathbf {e}_{i}^{\prime })=\mathbf {0}]\) and each vector is multivariate normal such that

$$ \mathbf{u}_{i} \sim MVN(\mathbf{0}, \boldsymbol{\Psi}) {\kern24pt} \text{and} {\kern24pt} \mathbf{e}_{i} \sim MVN(\mathbf{0}, \boldsymbol{\Theta}_{i}). $$

Here, Ψ is a symmetric covariance matrix of the random effects and is often assumed to be unstructured so as to not impose restrictions on (a) the extent to which growth factors vary across individuals, nor on (b) the direction and degree to which individual growth factors covary. The time-specific residual variances and their covariances across time are summarized in the ni × ni covariance matrix Θi. When coupled with the random effects covariance structure (Ψ), this residual covariance matrix (Θi) often takes on a simple structure, such as \(\boldsymbol {\Theta }_{i}=\mathbf {I}_{n_{i}}\sigma ^{2}\) or \(\boldsymbol {\Theta }_{i}=\mathbf {I}_{n_{i}}{\sigma _{j}^{2}}\), where \(j=1,\dotsc ,n_{i}\), and where \(\mathbf {I}_{n_{i}}\) is an identity matrix of dimension ni. Other structures are certainly possible (see, e.g., Fitzmaurice et al.,, 2011; Grimm & Widaman, 2010; Jennrich & Schluchter, 1986), and the choice of a particular structure should be theoretically defensible or empirically driven by a thorough exploration of the data.

The oft-cited linear-linear growth model is one possible form of f(ti,θi) and is defined in Eq. 2:

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i}) = \begin{cases} \alpha_{1i}+\alpha_{2i}t_{ij} & {\kern.75em} t_{ij} \leq \gamma_{i} \\ \alpha_{3i}+\alpha_{4i}t_{ij} & {\kern.75em} t_{ij} > \gamma_{i} \end{cases}, \end{array} $$
(2)

where α1i and α2i are the intercept and slope of the first phase and α3i and α4i are the intercept and slope of the second phase, respectively. Because there are only two phases, there is only one changepoint (γi). For this function, the set of model coefficients for the i th individual is \(\boldsymbol {\theta }_{i}=(\alpha _{1i},\alpha _{2i},\alpha _{3i},\alpha _{4i},\gamma _{i})^{\prime }\). The inclusion of the subscript i on each growth factor in Eq. 2 implies that each growth factor—including the changepoint—is allowed to vary across individuals. In other words, individuals may transition from phase 1 to phase 2 at different times, and individual trajectories within a phase might look quite different from the bilinear trajectory for the typical individual.

Behavior at the changepoint

Most applications using the bilinear piecewise growth model assume that the two linear segments join at the changepoint,Footnote 2 although exceptions have been noted (see, e.g., Cudeck & Codd, 2012; Cudeck & Harring, 2010; Cudeck & Klebe, 2002; Hoffman, 2015). To ensure continuity between adjoining segments, the two functions must be continuous and fulfill the condition

$$ \alpha_{1i}+\alpha_{2i}\gamma_{i} = \alpha_{3i}+\alpha_{4i}\gamma_{i}. $$
(3)

The equality constraint in Eq. 3 requiring the values of the phase 1 and phase 2 functions to be equal at the changepoint (i.e., when tij = γi) has been termed zero-order continuity (Seber & Wild, 1989) and guarantees that the two linear functions will meet resulting in an abrupt elbow-like transition from one phase to the next. With this constraint, one of the parameters is redundant and the bilinear piecewise function in Eq. 2 can be re-expressed, for example, by parameterizing the second phase intercept, α3i, in terms of the other model parameters as

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{1i}+\alpha_{2i}t_{ij} & t_{ij} \leq \gamma_{i} \\ \alpha_{1i}+\alpha_{2i}\gamma_{i}+\alpha_{4i}(t_{ij}-\gamma_{i}) & t_{ij} > \gamma_{i} \end{cases}. \end{array} $$
(4)

The resulting function now has three growth parameters, α1i,α2i, α4i, and single changepoint, γi. If a more gradual and smooth transition between phases better captures the underlying behavior of the phenomenon around the changepoint, then higher-order continuity conditions can be implemented (see, e.g., Cudeck & Klebe, 2002, for a thorough description and discussion). This requires, however, that the functions for the segments be of sufficient complexity with a greater number of parameters. We demonstrate how this is accomplished in the empirical examples forthcoming.

Fitting the piecewise growth model in Eq. 4 as a mixed-effects model requires writing an if-then statement such as

$$ \begin{array}{@{}rcl@{}} &&~~~~~~~~~~~\text{if~} t \le \gamma \text{~then~} f = \alpha_{1}+\alpha_{2} \cdot t\\ &&\text{else~if~} t > \gamma \text{~then~} f = \alpha_{1}+\alpha_{2}\gamma + \alpha_{4i}(t - \gamma), \end{array} $$

using software, such as SAS or R, that allows conditional programming statements. The challenge of fitting this same model in SEM software is to re-express f(ti,θi) as a linear combination of a factor loading matrix and latent growth factors, Λiηi, the cornerstone of the latent growth modeling framework (Bollen & Curran, 2006; Meredith & Tisak, 1990).

Specifying piecewise models in an LGM framework

Two-phase growth models can be specified in a number of ways. In some cases, the functions that define the different segments include only linear parameters, such as a model based on a linear-linear or quadratic-linear function, and the only nonlinear parameter is the changepoint. If the changepoint is known a priori and is fixed across individuals—such as may be the case when an intervention is delivered at a specific time—the discontinuity in the overall pattern can be easily treated through adding a second linear growth factor and setting elements of the factor loading matrix to pre-specified values. For a linear-linear function, the second latent growth factor can either be interpreted as the linear slope of the second phase (see the left panel of Fig. 2) or as the difference between the linear slopes of phase two and phase one (see the right panel of Fig. 2) depending on how the factor loading matrix is specified (see, e.g., Hancock et al.,, 2013).

Fig. 2
figure 2

The left panel shows a bilinear piecewise LGM with an explicit second phase slope. The right panel shows a bilinear piecewise LGM parameterized with a difference in linear slopes between phase 2 and phase 1

In other cases, one or both of the functions that define the segments include a nonlinear parameter, such as a model based on a combination of a linear and an exponential function. Typically, one or more of the growth parameters that enter the model in a linear way are random. Nonlinear growth parameters may be random or fixed. If fixed, then the model falls within the framework of a conditionally linear model. For instance, in a linear-exponential growth model, the nonlinear parameter of the exponential function would be fixed and the rate of change therefore held constant across individuals. In a very different formulation of a piecewise model, a nonlinear growth function is defined by a first-order Taylor polynomial, and as such, the weights of the polynomial are random and the nonlinear growth parameter is fixed. This latter type of model is known as a structured latent curve model (SLCM; Browne, 1993; Browne & du Toit, 1991). A third formulation of the model is one in which the nonlinear growth function is random, such as in a fully nonlinear mixed-effects model (see, e.g., Cudeck, 1996; Davidian & Giltinan, 1995; Davidian & Giltinan, 2003). Of these three formulations, only the first two may be fit within an SEM framework.

Structured latent curve model approach

Before delving into the specifics of the modeling extensions and empirical examples, we provide a very brief overview of the SLCM (readers familiar with the SLCM can skip this section without loss of continuity). Formulation of a structured latent curve model begins with the mean response that is assumed to follow a particular target function, f(ti,θ). To be clear, a target function is simply a mathematical function of time describing a trajectory of the mean response. For now, this target function is arbitrary, but represents any nonlinear growth function in which at least one parameter enters f in a nonlinear manner. For individual i, a generic four-parameter target function can be re-expressed as a first-order Taylor series expansion of the target function (see, e.g., Blozis & Harring, 2016; Browne, 1993; Preacher & Hancock, 2015)

$$ \begin{array}{@{}rcl@{}} \mathbf{y}_{i} &=& \mathbf{f}(\mathbf{t}_{i},\boldsymbol{\theta}) + z_{1i}\mathbf{f}_{1}^{\prime}(\mathbf{t}_{i},\boldsymbol{\theta})+ z_{2i}\mathbf{f}_{2}^{\prime}(\mathbf{t}_{i},\boldsymbol{\theta})+ z_{3i}\mathbf{f}_{3}^{\prime}(\mathbf{t}_{i},\boldsymbol{\theta})\\ &&+ z_{4i}\mathbf{f}_{4}^{\prime}(\mathbf{t}_{i},\boldsymbol{\theta}) + \mathbf{e}_{i} \end{array} $$
(5)

where \(\mathbf {f}_{k}^{\prime }(\mathbf {t}_{i},\boldsymbol {\theta })\) is a vector of first partial derivatives (known as a basis function, Browne, 1993; Meredith & Tisak, 1990) with respect to the k th growth parameter and is evaluated at the ni time points in ti and parameters in θ. The basis functions are weighted by random effects, zki, individual-level deviations from the growth parameters in θ with means equal to zero. With the additional assumption that the residuals in ei have means of zero as well implies that E[yi] = μ = f(ti,θ).

The basis functions comprise the columns of the factor loading matrix, Λi(ti,θ),

$$ \begin{array}{@{}rcl@{}} \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})= \begin{bmatrix} \frac{\partial f(t_{1},\boldsymbol{\theta})}{\partial\theta_{1}} & {\cdots} & \frac{\partial f(t_{1},\boldsymbol{\theta})}{\partial\theta_{4}} \\ \frac{\partial f(t_{2},\boldsymbol{\theta})}{\partial\theta_{1}} & {\cdots} & \frac{\partial f(t_{2},\boldsymbol{\theta})}{\partial\theta_{4}}\\ {\vdots} & {\ddots} & {\vdots} \\ \frac{\partial f(t_{n_{i}},\boldsymbol{\theta})}{\partial\theta_{1}} & {\cdots} & \frac{\partial f(t_{n_{i}},\boldsymbol{\theta})}{\partial\theta_{4}}\\ \end{bmatrix}. \end{array} $$
(6)

Under an SLCM, the mean function is assumed to be invariant to a constant scaling factor (see, Shapiro & Browne, 1987, Condition 2). As a consequence, the target function f(ti,θ) can be rewritten as Λi(ti,θ)α, where some of the elements of α may need to be set to zero (see, Blozis & Harring, 2016, for a discussion of how this is determined). Then in the individual-level model, Λi(ti,θ)α replaces the target function and the model in Eq. 5 can be rewritten as

$$ \mathbf{y}_{i} = \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})\boldsymbol{\alpha} + \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})\mathbf{z}_{i} + \mathbf{e}_{i}. $$
(7)

Letting ηi = α + zi, the model in Eq. 7 can be written as

$$ \mathbf{y}_{i} = \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})\boldsymbol{\eta}_{i} + \mathbf{e}_{i}. $$
(8)

The random effects and residuals are assumed to follow multivariate normal distributions, \(\mathbf {z}_{i} \sim N(\mathbf {0}, \boldsymbol {\Psi })\) and \(\mathbf {e}_{i} \sim N(\mathbf {0}, \boldsymbol {\Theta }_{i})\), respectively. The SLCM model in Eq. 8 can include time-invariant observed or latent covariates by augmenting the expression of individual growth factors, ηi = α + Γ1xi + Γ2ξi + zi, where coefficients in Γ1 correspond to the measured covariates in xi, and

coefficients in Γ2 correspond to the latent covariates in ξi which are related to a set indicator variables, wi, through a common factor model. The model-implied mean and covariance structures of the repeated measures for this conditional SLCM would be

$$ E[\mathbf{y}_{i}] =\boldsymbol{\mu}_{i}= \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})(\boldsymbol{\alpha}+ \boldsymbol{\Gamma}_{1}\boldsymbol{\mu}_{x} + \boldsymbol{\Gamma}_{2}\boldsymbol{\kappa}), $$

and

$$ \begin{array}{@{}rcl@{}} Var[\mathbf{y}_{i}] &=&\boldsymbol{\Sigma}_{i}= \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})(\boldsymbol{\Gamma}_{1}\boldsymbol{\Phi}_{x}\boldsymbol{\Gamma}_{1}^{T} + \boldsymbol{\Gamma}_{2}\boldsymbol{\Phi}_{\xi}\boldsymbol{\Gamma}_{2}^{T} + \boldsymbol{\Psi})\\ &&\boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})^{T} + \boldsymbol{\Theta}_{i}, \end{array} $$

where μx and κ are the mean vectors of the observed and latent covariates and Φx and Φξ are the covariance matrices of the observed and latent covariates, respectively.

Readers who want a more thorough discussion of the distinctions between the SLCM and nonlinear mixed-effects model are encouraged to read Blozis and Harring (2016) and Grimm et al., (2017), while Preacher and Hancock (2012) and Preacher and Hancock (2015) provide a full description of how the bilinear piecewise growth model fits within the SLCM framework.

Conditionally linear model

An SLCM is formulated by taking a first-order Taylor-series polynomial of a nonlinear growth function where polynomial terms are weighted by individual random effects. The nonlinear growth parameter(s) are fixed. An alternative to an SLCM for fitting nonlinear latent growth models is a slightly more restrictive version of the fully nonlinear mixed-effects model, a conditionally-linear LGM (see, e.g., Blozis & Cudeck, 1999; Harring et al.,, 2006; Harring et al.,, 2012). Individual-specific growth parameters that enter the function in a nonlinear fashion are fixed across individuals, whereas parameters that enter the function in a linear fashion are permitted to vary across individuals. Initial or potential (i.e., asymptotic) performance in developmental learning processes, for example, are often modeled as linear parameters in many nonlinear functions (Bates & Watts, 1988) and display considerable heterogeneity in the sample; conversely, a parameter relating to the rate of change, often a nonlinear parameter, varies markedly less.

The linear-linear function in Eq. 4 can be cast as a conditionally-linear model by eliminating the i subscript on the changepoint—the sole nonlinear parameter—as

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{1i}+\alpha_{2i}t_{ij} & t_{ij} \leq \gamma \\ \alpha_{1i}+\alpha_{2i}\gamma_{i}+\alpha_{4i}(t_{ij}-\gamma) & t_{ij} > \gamma \end{cases}. \end{array} $$

Note, that growth parameters α1i,α2i, and α4i that enter the piecewise function in a linear manner retain the i subscript and are allowed to vary across individuals. This conditionally-linear piecewise function fits into the LGM framework by writing f as

$$ f(\mathbf{t}_{i},\boldsymbol{\theta}_{i}) = \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i},\boldsymbol{\theta})\boldsymbol{\eta}_{i} $$

where Λi(ti,θ) contains possibly nonlinear functions of θ = γ, incorporates covariates that explain the growth characteristics of \(\boldsymbol {\eta }_{i}^{\prime } = (\alpha _{1i},\alpha _{2i},\alpha _{4i})\), and includes measurements of time. For each of the empirical examples that follow, computer code for both the SLCM and conditionally-linear model will be provided.Footnote 3

Segmented polynomials as LGMs

We begin this section by revisiting the bilinear model defined in Eq. 4, which is reproduced here as the target function defined in Eq. 5 for clarity,

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta})= \begin{cases} \alpha_{1}+\alpha_{2}t_{ij} & t_{ij} \leq \gamma \\ \alpha_{1}+\alpha_{2}\gamma+\alpha_{4}(t_{ij}-\gamma) & t_{ij} > \gamma \end{cases}. \end{array} $$
(9)

where \(\boldsymbol {\theta } = (\alpha _{1}, \alpha _{2}, \alpha _{4}, \gamma )^{\prime }\). To fit this function as an SLCM, Preacher and Hancock (2015) followed the tact introduced by Harring et al., (2006), namely rewriting the bilinear piecewise function using the minimum/maximum function applied to the two line segments, but allowing the changepoint to vary randomly across individuals. A related, but alternative approach can be used instead—providing greater flexibility to fit higher-order polynomials, inherently nonlinear functions (i.e., exponential), as well as to more than two phases with the caveat that the functions of adjacent segments need not be monotonic.

Instead of using the minimum/maximum function applied to the segments themselves, the bilinear piecewise function of Eq. 9 can be formulated as an SLCM by coding the j th row of Λi(ti,θ) using the minimum/maximum function, but applied directly to values of time, tij and the mean of the changepoint, which is expressed here as γ. Following Seber and Wild (1989, Section 9.4.2), the minimum and maximum functions are defined as: \(\min \limits (u,v)=\frac {1}{2}[ u + v - \sqrt {(u-v)^{2}}]\) and \(\min \limits (u,v)=-\max \limits (-u,-v)\) implying \(\max \limits (u,v)=\frac {1}{2}[ u + v + \sqrt {(v-u)^{2}}]\), where u,v ∈I R. These expressions are equivalent to the min() and max() functions found in many statistical software packages. The min(u,v) function in SAS PROC IML, for instance, evaluates arguments u and v and returns the minimum of the two. So does \(\min \limits (u,v)=\frac {1}{2}[ u + v - \sqrt {(u-v)^{2}}]\). Thus, the elements for the j th row of Λi(ti,θ) can be expressed as

$$ \left[ \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i}, \boldsymbol{\theta}) \right]_{j \cdot} = \left[ 1 {\kern4pt} \min(t_{ij},\gamma) {\kern4pt} \max(t_{ij}-\gamma,0) {\kern4pt} (\alpha_{2} - \alpha_{4}) \left( \frac{\max(t_{ij}-\gamma,0)}{t_{ij}-\gamma}\right) \right], $$
(10)

It may not be readily apparent that the column-wise elements represented in Eq. 10 are the partial derivatives of the target function in Eq. 9 with respect to each parameter evaluated at the j th time point. To make this connection, the partial derivatives of piecewise functions comprising f are evaluated before and after the changepoint and then combined to create each column across the values, tij. To make this concrete, suppose that six time points for individual i be \(\mathbf {t}_{i}=(0,1,2,5,6,10)^{\prime }\) and the single changepoint occurs at γ = 3. The partial derivative of f with respect to α1, the first entry in Eq. 10, at each time point before the changepoint (i.e., at 0, 1, and 2) is 1. For times after the changepoint (i.e., at 5, 6, and 10), the partial derivative is also 1. That is,

$$ \begin{array}{@{}rcl@{}} &&\frac{\partial}{\partial\alpha_{1}} \left[\alpha_{1}+\alpha_{2}t_{ij} \right] = 1 {\kern6pt} \text{when} {\kern6pt} t_{ij} \le \gamma \\ &&\text{and} {\kern6pt} \frac{\partial}{\partial\alpha_{1}} \left[ \alpha_{1}+\alpha_{2}\gamma+\alpha_{4}(t_{ij}-\gamma) \right] = 1 {\kern6pt} \text{when} {\kern6pt} t_{ij} > \gamma. \end{array} $$

The partial derivative of f with respect to α2, the second entry in Eq. 10, can be computed in a similar manner. For the first linear function—when tijγ—the partial derivative is tij. When tij > γ, then the partial derivative is γ. This is exactly what the operator, \(\min \limits (t_{ij},\gamma )\), does. Consequently, the second column of the hypothetical example evaluated at times ti would be

$$ \frac{\partial{f(\mathbf{t}_{i},\boldsymbol{\theta})}}{\partial{\alpha_{2}}} = \min(t_{ij},\gamma) = (0,1,2,3,3,3)^{\prime}. $$

In the event that a particular parameter in θ does not appear in one of the piecewise segments in f, then it will take on the value of 0. The last two entries (i.e., for α4 and γ) in Eq. 10 have this characteristic. Take \(\max \limits (t_{ij}-\gamma ,0)\), the partial derivative of f with respect to α4. When the value of tijγ > 0, then the \(\max \limits ()\) function returns the evaluated number, otherwise the entry is 0. For the running hypothetical example, the elements corresponding to the six time points would be (0, 0, 0, 2, 3, 7). Similarly, the first three elements of the partial derivative of f with respect to γ would be (0,0,0) while the second three elements take on the same value, α2α4. In our hypothetical example, the value of the changepoint is known—and thus it is apparent when the transition from 0 to α2α4 occurs. In most practical situations, the changepoint will be an unknown parameter to be estimated. As a consequence, a practical challenge to implementing this method in contemporary SEM software is to automate this type of on/off switch behavior. We accomplish this by including the term \([\max \limits (t_{ij}-\gamma )]\) /(tijγ). This acts as an indicator function taking on the value of 0 when tijγ ≤ 0 and taking on the value of 1 when tijγ > 0. We now show how this alternative approach can be implemented for other piecewise functions.

Quadratic-linear piecewise growth

A quadratic-linear piecewise function can be written as

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{1i}+\alpha_{2i}t_{ij} +\alpha_{3i}t_{ij}^{2} & {\kern.75em} t_{ij} \leq \gamma_{i} \\ \alpha_{4i}+\alpha_{5i}t_{ij} & {\kern.75em} t_{ij} > \gamma_{i} \end{cases}. \end{array} $$
(11)

For the polynomial segments to meet at the changepoint with a smooth transition requires both zero- and first-order continuity constraints. This means

$$ \alpha_{1i}+\alpha_{2i}t_{ij} +\alpha_{3i}t_{ij}^{2}t_{ij} \Big|_{t_{ij}=\gamma_{i}} = \alpha_{4i}+\alpha_{5i}t_{ij} \Big|_{t_{ij}=\gamma_{i}}, $$

and

$$ \frac{\partial}{\partial t_{ij}} (\alpha_{1i}+\alpha_{2i}t_{ij} +\alpha_{3i}t_{ij}^{2}) \Big|_{t_{ij}=\gamma_{i}} = \frac{\partial}{\partial t_{ij}} (\alpha_{4i}+\alpha_{5i}t_{ij}) \Big|_{t_{ij}=\gamma_{i}}. $$

With these two restrictions, two of the parameters in Eq. 11 are redundant and can be re-expressed in terms of other model parameters. By eliminating α1i and α2i, for example, the quadratic-linear function can be rewritten as

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{4i}+\alpha_{5i}t_{ij} +\alpha_{3i}(\gamma_{i}-t_{ij})^{2} & {\kern.75em} t_{ij} \leq \gamma_{i} \\ \alpha_{4i}+\alpha_{5i}t_{ij} & {\kern.75em} t_{ij} > \gamma_{i} \end{cases}. \end{array} $$
(12)

Using the same approach when specifying the bilinear piecewise growth model, the quadratic-linear piecewise function in Eq. 12 used as the target function (by eliminating the i subscript on θi) would be fit as an SLCM by coding the factor loading matrix as

$$ \left[ \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i}, \boldsymbol{\theta}) \right]_{j \cdot}= \begin{bmatrix} 1 {\kern10pt} t_{ij} {\kern10pt} \max(\gamma-t_{ij},0)^{2} {\kern10pt} 2\alpha_{3}\max(\gamma-t_{ij},0) \end{bmatrix}. $$
(13)

We now show how these methods can be implemented not only for the quadratic-linear piecewise LGM in Eq. 12, but also for other piecewise functions as well.

Empirical examples

Three different piecewise LGMs will be fitted to two empirical datasets. Data from a psychological experiment constitutes the second empirical example, in which the response is the number of words that were recalled across 10 trials. Interestingly, performance exhibits three phases where a distinct linear function is hypothesized in each phase. Transition from one phase to the next is abrupt but connected implying that two changepoints will be needed to glue the three segments together. A more complete description of the data is given next followed by reporting the results of each analysis.Footnote 4 The second dataset comes from a learning study in which verbal skill acquisition was assessed. Response times across 12 trial blocks showed a fairly steep, curvilinear decline (learning taking place) during earlier trials. Learning continued across later trials but slowed, and eventually decreased at a constant rate through the last trial. We fit two piecewise growth models to these data: (1) a quadratic-linear function as described earlier and (2) an exponential-linear model that uses an intrinsically nonlinear function—as opposed to a higher-order polynomial—to model the steep decline in the first phase.

Word recall data

The repeated measures data plotted in Fig. 3 are the number of words out of 15 possible that were recalled by a sample of college students over ten 30-sec trials of a single-session experiment (Smith & Klebe, 1997, June). The trials are recorded as \(t_{ij}=t_{j}=(0,\dotsc ,9)^{\prime }\). A random subset of 20 of the full sample (N = 103) are included in the spaghetti plot. As always, individual differences are appreciable. The number of words recalled on the initial trial varied between 3 and 10, whereas at the final trial the range was from 11 to 15. Most participants showed rapid and linear improvement up to Trial 3, after which there was a second phase in which more gradual improvement occurred until approximately trial 6, then little, if any, individual change in the number of words recalled for the final 2 to 3 trials. Here, we fit this data using a linear-linear-linear piecewise LGM across trials. The changepoints marking the shift from one phase to another are unknown parameters to be estimated. It appears that the changepoints are roughly similar for every participant, and thus, these parameters may need to be constrained to be identical for all subjects. This type of hypothesis can be adjudicated by performing a χ2 difference test under maximum likelihood estimation using an appropriate 50:50 mixture χ2 distribution (Stoel et al., 2006). The mixture distribution is recommended as the reference distribution to adjudicate the hypothesis test of the variance component of \(\psi _{\gamma _{1}} = var(z_{\gamma _{1i}})\) whose value under the null distribution is on the edge of parameter space.

Fig. 3
figure 3

A spaghetti plot with a 20% random sample (N = 103) of the number of words recalled across 10 trials

The segmented polynomial extends in a straightforward manner to more than two phases. Through some preliminary analyses, it was observed that the two changepoints did not vary across individuals and thus, a conditionally-linear LGM specification in which γki = γk for k = 1,2, was used for the analyses with imposed zero-order continuity (i.e., segments meet at the changepoints, but the transition is abrupt).

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{1i}+\alpha_{2i}t_{ij} & {\kern.75em} t_{ij} \leq \gamma_{1} \\ \alpha_{3i}+\alpha_{4i}t_{ij} & {\kern.75em} \gamma_{1} < t_{ij} \leq \gamma_{2} \\ \alpha_{5i}+\alpha_{6i}t_{ij} & {\kern.75em} \gamma_{2} < t_{ij} \end{cases}. \end{array} $$
(14)

With the imposed zero-order continuity restriction, the three-phase linear LGM in Eq. 14 can be rewritten as

$$ \begin{array}{@{}rcl@{}} &&f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})\\ &&=\begin{cases} \alpha_{1i}+\alpha_{2i}t_{ij} & {\kern.75em} t_{ij} \leq \gamma_{1} \\ \alpha_{1i}+\alpha_{2i}\gamma_{1} + \alpha_{4i}(t_{ij}-\gamma_{1}) & {\kern.75em} \gamma_{1} \leq t_{ij} \leq \gamma_{2} \\ \alpha_{1i}+\alpha_{2i}\gamma_{1} + \alpha_{4i}(\gamma_{2}-\gamma_{1})+\alpha_{6i}(t_{ij}-\gamma_{2}) & {\kern.75em} t_{ij} > \gamma_{2} \end{cases}. \\ \end{array} $$
(15)

The factor loading matrix for an LGM for the linear-linear-linear piecewise function would be parameterized with four columns corresponding to the four linear individual-specific parameters using Eq. 15.

$$ \begin{array}{@{}rcl@{}} \left[ \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i}, \boldsymbol{\theta}) \right]_{j \cdot}&=& \left[ 1 ~\min(t_{ij},\gamma_{1})~\min(\max(0,t_{ij}-\gamma_{1}), \gamma_{2}-\gamma_{1})\right.\\ && ~~~\left. \max(0,t_{ij}-\gamma_{2})\right]. \end{array} $$

Results

Table 1 shows the results from fitting the piecewise linear-linear-linear latent growth model using maximum likelihood estimation and appeared to have satisfactory model-data fit [χ2(48) = 67.06,p = 0.036, RMSEA 90% CI (0.017, 0.095), and SRMR = 0.083].

Table 1 Maximum likelihood estimates and standard errors for the conditionally-linear, three-phase linear piecewise LGM

The estimated intercept of the linear function in phase 1, \(\hat {\alpha }_{1} = 5.45\), is interpreted as the average number of words recalled at the beginning of the experiment—approximately 5.5 words. The estimated slope of the linear function in phase 1, \(\hat {\alpha }_{2} = 2.82\) is the expected increase in words recalled for each additional trial. The estimated slope of the second phase is \(\hat {\alpha }_{4}=1.23\) and represents the expected increased in the number of words recalled in phase 2. Compared to the constant rate of change in phase 1, the rate of word recall for the average individual in the second phase is slowing. The last estimated growth parameter, \(\hat {\alpha }_{6} = 0.22\), is the average linear growth rate of phase 3. The changepoints occur between the second and third trial (\(\hat {\gamma }_{1}=1.42\)) while the second shift occurs between the fourth and fifth trials (\(\hat {\gamma }_{2}=3.49\)). To see this more clearly, the fitted mean trajectory with fitted changepoints highlighted and superimposed is displayed in Fig. 4.

Fig. 4
figure 4

Fitted mean trajectory for the linear-linear-linear piecewise LGM superimposed on a random sample of N = 10 individuals. The estimated changepoints are highlighted with arrows

Central to any analysis of latent growth models is characterizing individual behavior of the phenomena underlying the repeated measures data. Examining individual fitted functions can provide valuable insight into understanding the myriad ways the phenomena changes according to the time-response relation. Figure 5 illustrates how the model performs for three specific individuals. Note that while each individual transitions at the same junctures from one phase to the next, their linear functions—one in each phase—is specific to the individual (i.e., linear parameters have corresponding random effects).

Fig. 5
figure 5

Three individuals’ fitted linear-linear-linear trajectories. Estimates of common changepoints are represented by vertical solid lines

Procedural learning task

The next two examples involve data that were obtained from a learning studyFootnote 5 in which researchers were interested in assessing performance on two procedural tasks. The repeated outcome variable used here is response time corrected for accuracy, taken to assess verbal skill acquisition. Quantitative and spatial skill acquisition were also evaluated. For each task, study participants were required to learn a set of declarative rules for assessing attributes of visual stimuli presented in series. Tasks were given together in blocks, with the administration order varied within blocks to avoid order effects. Both response times and accuracy scores were recorded. Data for a sample of N = 228 individuals whose average accuracy score across trial blocks was 80% or better on the task is considered here. The sample was restricted in this manner to lessen the impact of a speed – accuracy trade-off on response time. Response times for the procedural task were aggregated separately into 12 blocks of 32 trials each, where the median time to respond within blocks was used as the aggregate. For the interested reader, a more comprehensive description of data can be found in Blozis (2004).

As is apparent in Fig. 6, response times decreased rapidly across earlier trials where at approximately trial 4 or 5, response times continued to decline but at a constant rate. Among several alternative functions fitted to this data, two piecewise functions were finally chosen based on model-data fit, parameter interpretability and the belief that the underlying process occurs in two distinct phases. The first piecewise function is a quadratic-linear piecewise LGM. The two segments join and a smooth transition between quadratic and linear phase is expected. The quadratic-linear LGM explicated in Eq. 12 were fit to these data as a structured latent curve model. In a subsequent section, an exponential-linear piecewise LGM is fitted to the same repeated measures data. The first-phase exponential function is aligned with analyses performed in other studies (see, e.g., Blozis, 2004; Harring et al.,, 2012).

Fig. 6
figure 6

A spaghetti plot with a 10% random sample (N = 228) of response times across 12 trial blocks

Results

Table 2 presents maximum likelihood estimates and corresponding standard errors obtained from fitting the quadratic-linear LGM in Mplus (Muthén and Muthén, 1998). For the growth parameters, examination of the fixed effects estimates shows that the average individual has a convex pattern of quadratic change (\(\hat {\alpha }_{3}=0.35\)) across trial blocks until trial block 5 (\(\hat {\gamma } = 5.22\)), the estimated changepoint for the average individual where decline shifts to a constant rate of change that is more gradual. The linear slope of the second phase is \(\hat {\alpha }_{5}=-0.17\), and represents the expected decrease in reaction time in tenths of a second for each trial block increase while the intercept is \(\hat {\alpha }_{4}=8.20\). The intercept is the average reaction time in tenths of a second at the initial trial block (i.e., tj = t1 = 0). Centering time to another trial block in the second phase such as tj = t12 = 11 or at the changepoint \(t_{j}=\hat {\gamma }\) would make its value more interpretable (see, Hoffman, 2015, Chapter 6). The estimated fixed effects of the growth parameters were all large relative to their estimated standard errors and thus hypothesis tests using a Wald-like ratio of the estimate to its standard error could be used to establish statistical significance.

Table 2 Maximum likelihood estimates and standard errors for the quadratic-linear piecewise LGM

Individual differences in all aspects of learning can be ascertained by examining the variances and covariances of the random coefficients. From Table 2, the variance estimates of the random coefficients are all large relative to their standard errors. The correlation between individuals’ second phase intercepts, α4i and their changepoints, γi, for example, is

$$ \begin{array}{@{}rcl@{}} corr(z_{\alpha_{4i}}, z_{\gamma_{i}}) &=& \frac{-0.64}{\sqrt{4.61 \cdot 0.46}} \\ &=& -0.44, \end{array} $$

indicating a moderate negative linear trend. Thus, individuals who start the second phase at higher initial reaction times (slower reaction) will transition to the second phase at earlier trial blocks compared to those individuals whose initial reaction times are faster. To give some indication of how well the mean curve fits the data, a graph of the mean trajectory is displayed in Fig. 7 superimposed on line plots of a random sample of individuals’ data.

Fig. 7
figure 7

Fitted mean curve for the quadratic-linear piecewise LGM superimposed on a random sample of N = 10 individuals. The estimated changepoint occurs a little after the trial block 5: \(\hat {\gamma }=5.11\) and is denoted by the vertical dashed line

Procedural learning task revisited

The last empirical example again utilizes the procedural learning task dataset (see Fig. 3 for longitudinal profiles of a random sample of individuals). As is the case with curvilinear repeated measures data, many mathematical functions with parameterizations tailored to the scientifically-relevant features of underlying process may fit the data equally well. In past studies, for example, these data have been fitted with an exponential function in a structured latent curve modeling context (see, e.g., Blozis, 2004), a linear-linear piecewise LGM (Harring et al., 2012; Kohli & Harring, 2013) in a growth mixture modeling context as well as to a quadratic-linear piecewise function, also fitted as a structured latent curve model discussed previously. As a final extension, a two-phase model that assumes an exponential decaying response from the initial trial block to approximately the fifth trial block or so after which the form of change conforms to a linear function with slow, constant decremented change across the later trials.

The approach using the min() and max() functions with time and changepoint arguments can be utilized to fit segments that have at least one parameter of the piecewise growth function that enters in a nonlinear manner (e.g., exponential function) beyond the changepoint. If the functions meet at the changepoint and if a smooth transition is required when moving from one phase to the next, then zero-, first-, and even second-order continuity constraints may be applied given that the functions are of sufficient complexity. For example, the exponential-linear function used in the forthcoming analysis imposes both zero- and first-order continuity conditions. The two-phase piecewise function is defined as

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{1i}+ \alpha_{2i}\exp(\alpha_{3i}t_{ij}) & {\kern.75em} t_{ij} \leq \gamma_{i} \\ \alpha_{4i} + \alpha_{5i}t_{ij} & {\kern.75em} t_{ij} > \gamma_{i} \end{cases}. \end{array} $$
(16)

In Eq. 16, α1i is the limiting asymptotic performance (i.e., as \(t_{ij} \rightarrow \infty \)), α2i is a scaling factor and represents the distance from the asymptote to the initial value [i.e., tij = 0, f(ti,θi) = α1i + α2i]. The rate of decay is governed by α3i, an intrinsically nonlinear parameter of the exponential function, whose values are less than zero, α3i < 0. Note that if instead, exponential growth in the first phase was posited, then α3i > 0. Assuming zero-order continuity at the changepoint (i.e., assuming the two segments join at tij = γi), results in one redundant parameter. Here, we chose to write the intercept of phase 2, α4i, in terms of other model parameters

$$ \begin{array}{@{}rcl@{}} \alpha_{1i}+ \alpha_{2i}\exp(\alpha_{3i}\gamma_{i}) &=& \alpha_{4i} + \alpha_{5i}\gamma_{i} \\ \alpha_{1i}+ \alpha_{2i}\exp(\alpha_{3i}\gamma_{i}) - \alpha_{5i}\gamma_{i} &=& \alpha_{4i}. \end{array} $$
(17)

Further assuming first-order continuity at the changepoint (i.e., assuming the transition from phase 1 (exponential decay) to phase 2 (linear decay) is smooth rather than abrupt), the first-order partial derivatives of each function with respect to time are set equal to one another allowing to eliminate another growth parameter, in this case, linear slope of phase 2

$$ \alpha_{2i}\alpha_{3i}\exp\{\alpha_{3i}\gamma_{i}\} = \alpha_{5i}. $$
(18)

Together, zero- and first-order continuity defined in Eqs. 17 and 18 imply

$$ \begin{array}{@{}rcl@{}} \alpha_{4i} &=& \alpha_{1i} + \alpha_{2i}\exp\{\alpha_{3i}\gamma_{i}\} - \alpha_{2i}\alpha_{3i}\exp\{\alpha_{3i}\gamma_{i}\}\gamma_{i} \\ &=& \alpha_{1i} + (1 - \alpha_{3i} \gamma_{i}) \alpha_{2i}\exp\{\alpha_{3i}\gamma_{i}\}. \end{array} $$
(19)

The result of plugging Eqs. 18 and 19 into Eq. 16, is

$$ \begin{array}{@{}rcl@{}} f(\mathbf{t}_{i},\boldsymbol{\theta}_{i})= \begin{cases} \alpha_{1i}+ \alpha_{2i}\exp(\alpha_{3i}t_{ij}) & {\kern.75em} t_{ij} \leq \gamma_{i} \\ \alpha_{1i} + (1 - \alpha_{3i} \gamma_{i} + \alpha_{3i}t_{ij}) \alpha_{2i}\exp\{\alpha_{3i}\gamma_{i}\}& {\kern.75em} t_{ij} > \gamma_{i} \end{cases}, \\ \end{array} $$
(20)

with four unknown parameters, \(\boldsymbol {\theta }_{i}=(\alpha _{1i}, \alpha _{2i}, \alpha _{3i}, \gamma _{i})^{\prime }\), each of which may vary across individuals. Note that both the asymptote (α1i) and scale parameter (α2i) in phase 1 enter the function linearly while the rate of exponential decay (α3i) in phase 1 and the changepoint (γi) enter the model in a nonlinear manner. If a conditionally-linear LGM is sought, then only two columns in the factor loading matrix would need to be specified. The nonlinear parameters would be fixed across subjects and would be specified using the nonlinear constraints feature in the software program. If on the other hand, a structured latent curve model is to be fitted in which all parameters—those that enter the function linearly as well as those that enter in a nonlinear fashion—are allowed to vary across individuals, then the factor loading matrix would be comprised of four columns. In the latter case, the columns are made up of first-partial derivatives of the target function with respect to each parameter. The mean vector would set those elements corresponding to nonlinear parameters to zero, although other possibilities exist (see, e.g., Preacher & Hancock, 2015).

The factor loading matrix for the conditionally-linear LGM is

$$ \left[ \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i}, \boldsymbol{\theta}) \right]_{j \cdot} = [1, \exp(\alpha_{3} \cdot \min(t_{ij},\gamma)) \cdot (1 + \alpha_{3} \cdot \max(t_{ij}-\gamma,0))], $$

where \(\boldsymbol {\theta }^{\prime } = (\alpha _{3}, \gamma )\). The factor loading matrix for the structured latent curve model is

$$ \begin{array}{@{}rcl@{}} \left[ \boldsymbol{\Lambda}_{i}(\mathbf{t}_{i}, \boldsymbol{\theta}) \right]_{j \cdot} &=& [1, \\ && \exp[\alpha_{3} \cdot \min(t_{ij},\gamma)] \cdot \{1 + \alpha_{3} \cdot \max(t_{ij}-\gamma,0)\}, \\ && \alpha_{2}\exp\{\alpha_{3} \cdot \min(t_{ij},\gamma)\} (\alpha_{3}\gamma \cdot \max(t_{ij},\gamma)-\alpha_{3}\gamma^{2}+t_{ij}), \\ && {\alpha_{3}^{2}} \cdot \max(t_{ij}-\gamma,0)\alpha_{2}\exp\{\alpha_{3}\gamma\} ]. \end{array} $$

Results

We fit the exponential-linear piecewise LGM using both the conditionally-linear LGM as well as treating the model as a structured latent curve model. For each model, the residual covariance structure was specified to a homogeneous, mutually-independent structure, Θi = Inσ2 as there were no missing data. Maximum likelihood estimates for the conditionally-linear LGM were

$$ \begin{array}{@{}rcl@{}} \hat{\boldsymbol{\theta}} &=& (\hat{\alpha}_{1}, \hat{\alpha}_{2}, \hat{\alpha}_{3}, \hat{\gamma}) \\ &=& (6.83, 14.65, -0.64, 6.32), \end{array} $$
$$ \begin{array}{@{}rcl@{}} \hat{\boldsymbol{\Psi}} = \begin{pmatrix} 1.87 & \\ 5.16 & 84.95 \end{pmatrix} \hat{\sigma}^{2}=2.43. \end{array} $$

The estimated changepoint occurred between a bit after the seventh trial block, \(\hat {\gamma }_{1}=6.32\). One reason the changepoint was estimated at this juncture was due to the requirement of equality of the segment functions first-order derivatives. If only the zero-order constraint was implemented, the changepoint would have occurred at an earlier trial block. This disparity in placement of the changepoint is well-known (see, Cudeck & Harring, 2010) and can be directly attributed to what is assumed about the behavior (i.e., abrupt or smooth) of the process near the changepoint. In general, adopting higher-order continuity conditions provides greater degrees of smoothness of the transition between phases at the changepoints, which often has the effect of delaying when the transition occurs.

Maximum likelihood estimates for the structured latent curve model were

$$ \begin{array}{@{}rcl@{}} \hat{\boldsymbol{\theta}} &=& (\hat{\alpha}_{1}, \hat{\alpha}_{2}, \hat{\alpha}_{3}, \hat{\gamma}) \\ &=& (7.28, 13.25, -0.89, 4.48), \end{array} $$
$$ \begin{array}{@{}rcl@{}} \hat{\boldsymbol{\Psi}} = \begin{pmatrix} 1.80 & & & \\ 5.40 & 101.52 & & \\ 0 & 37.08 & 99.01 & \\ 0 & 14.12 & 26.12 & 7.19 \end{pmatrix} \hat{\sigma}^{2}=1.01. \end{array} $$

Using the New() function in the Model Constraint module in Mplus permits estimating the intercept and slope of the second phase for the average individual based on estimates of model parameters.Footnote 6 These were estimated to be \(\hat {\alpha }_{4}=8.51\) and \(\hat {\alpha }_{5}=-0.22\), respectively. Time was not centered in any way. Therefore, the interpretation of the intercept is the expected reaction time in tenths of seconds at tij = 0. The slope has a standard regression interpretation that for each additional trial block after the fifth trial, average reaction time would decrease nearly a quarter of a tenth of a second. From initial fitting of the model, it was determined that the covariances between asymptote and exponential decay rate and between asymptote and changepoint were approximately zero, and were then set to zero, producing the final estimates. Each of the four parameters showed statistically significant between-individual variation (i.e., the diagonal elements of \(\hat {\boldsymbol {\Psi }}\)). Unsurprisingly, the correlation between exponential decay rate and changepoint random effects was strong and positive, \(\hat {\rho }_{43}=26.12/ \sqrt {99.01 \cdot 7.19} \approx 0.98\).

A plot of the fitted mean exponential-linear piecewise functions using the two approaches is shown in Fig. 8. The fitted conditionally-linear piecewise LGM seemed to adhere to the empirical means at each time point quite closely. In contrast, the fitted SLCM in which the exponential rate of decay and the changepoint were allowed to vary across individuals, demonstrated slightly different fit. The mean changepoint occurred at a much earlier trial than did the changepoint from the conditionally-linear piecewise model. To be clear, our intention here, rather than attempting to reach substantive conclusions regarding the underlying procedural learning task response process, is to illustrate how an intrinsically nonlinear piecewise LGM may be used to articulate many interesting aspects and types of longitudinal change that exhibit distinct phases.

Fig. 8
figure 8

Fitted functions for the average exponential-linear change process for the conditionally-linear LGM (solid line) and the structured latent curve model (dotted line)

Discussion

Many alternatives exist to describe curvilinear patterns of repeated measures data. An appealing option, a piecewise growth model, is flexible, can effectively summarize behaviors that display distinct phases, and permits for estimation of the changepoint from one phase to the next. Estimating piecewise growth models as mixed effects models is fairly straightforward using software modules that allow the user to explicitly define the function in each phase using programming statements. For LGMs, estimating even the most basic piecewise growth model, the two-phase linear-linear model, is challenging; and perhaps as a consequence, published studies using other functional forms for the segments or allowing for multiple changepoints, are rare. As one reviewer rhetorically asked, why specify piecewise growth models in an SEM framework when a mixed effects modeling version already exists? There are many reasons to justify approaching this type of growth modeling from an SEM perspective. As was previously argued, SEM software like Mplus and lavaan can not only handle basic and advanced nonlinear growth models (Preacher & Hancock, 2015; Ram & Grimm, 2009), but with a few extra lines of code can extend these models to accommodate nested data structures and complex sampling designs, to account for population heterogeneity, and to incorporate intensive data collection design facets among other modeling elaborations. More importantly, using latent variables as longitudinal responses, time-varying covariates, determinants of change, and even distal outcomes—basic tenets of longitudinal SEM methods (Grimm & Marcoulides, 2016; McArdle & Nesselroade, 2014)—can be handled rather easily in SEM software ensuring that executing a piecewise growth modeling analysis within this environment will be worth the extra effort.

A central goal of this article was to show how a broader class of piecewise latent growth models could be fitted utilizing the nonlinear constraint module found in most modern SEM software. To this end, we extended the oft-used linear-linear piecewise latent growth model in three ways. The first elaboration was to a three-phase linear process. Two changepoints were needed to specify the model and were fixed across subjects in the real data example involving word recall. This type of conditionally-linear specification means that while some aspects of the change process operationalized with a piecewise function (i.e., the intercept and slope of the first phase) are specific to the individual, the points of transition of adjacent phases are not. This is not a limitation of the general piecewise LGM system, but arguably one of its most attractive features—tailoring its specification to adapt to characteristics of the particular study behavior. This is best accomplished based on theoretical considerations of the longitudinal design and data attributes as well as a deep understanding of the evolution of the underlying process. Of course, decisions made throughout the modeling process are also informed through the empirical investigation. The second elaboration was to higher-order polynomial functions for data that exhibit two distinct phases. Continuity constraints were incorporated and we demonstrated how the min() and max() functions could be used on time points and changepoints instead of the line segments used in past studies. Columns of the factor loading matrix of the piecewise LGM could then be specified using the nonlinear constraint module in popular SEM software.

The last modeling embellishment was to intrinsically nonlinear functions as was demonstrated in the analysis of the procedural learning task dataset. An exponential-linear piecewise LGM was specified in which the rate of the first phase and the changepoint—individual-specific parameters—enter the function in a nonlinear manner. Analyses using both conditionally-linear and structured latent curve modeling frameworks were performed. Allowing the nonlinear parameters to vary among individuals had the effect of moving the transition from the first to the second phase at an earlier trial. These models are complex with many analytic decision points to be made throughout: (1) should nonlinear parameters be fixed across subjects or should they be allowed to vary? and (2) what type of piecewise function is suggested by the theory of the underlying change process or through an empirical investigation? And, although our analyses did not include investigation of residual covariance structures or augmentation of the model with time-invariant covariates, these nuances as well as the many others naturally encountered when fitting latent growth models are just as applicable when piecewise functions are used.

The piecewise LGMs fitted in this article utilized the min()/max() functions on the time points and changepoints instead of applying these functions on the line segments themselves as Harring et al., (2006) and Preacher and Hancock (2015) have previously demonstrated. This methodological nuance permits the specification of adjacent growth trajectories to be non-monotonic and extends to higher-order polynomials and intrinsically nonlinear functions using the same basic tools (i.e., structured latent curve and conditionally-linear models) when fitting the popular linear-linear piecewise function. The functionality that makes fitting these extended piecewise LGMs in SEM software possible is the nonlinear constraint module found in most mainstream programs, like Mplus. As others have pointed out (see, e.g., Choi et al.,, 2009; Feng et al.,, 2019; Preacher & Hancock, 2012; Ram & Grimm, 2009), fitting nonlinear latent growth models in software designed to estimate linear relations among measured and latent variables can be challenging. This may be due in part by working with nonlinear functions themselves, which seem a bit more intimidating algebraically. However, as many researchers have pointed out (see, e.g., Cudeck & du Toit, 2002; Davidian & Giltinan, 2003; Pinheiro & Bates, 2000), nonlinear functions can often be tailored so that parameters have a natural, physical interpretation that corresponds directly to substantive characteristics of the research situation without sacrificing model-data fit. This should be sufficient incentive to belay concerns regarding the extra effort required to fit such models especially when continuous repeated measures data exhibit multiple phases.