Skip to main content
Log in

Nonlinear Random-Effects Mixture Models for Repeated Measures

  • Published:
Psychometrika Aims and scope Submit manuscript

Abstract

A mixture model for repeated measures based on nonlinear functions with random effects is reviewed. The model can include individual schedules of measurement, data missing at random, nonlinear functions of the random effects, of covariates and of residuals. Individual group membership probabilities and individual random effects are obtained as empirical Bayes predictions. Although this is a complicated model that combines a mixture of populations, nonlinear regression, and hierarchical models, it is straightforward to estimate by maximum likelihood using SAS PROC NLMIXED. Many different models can be studied with this procedure. The model is more general than those that can be estimated with most special purpose computer programs currently available because the response function is essentially any form of nonlinear regression. Examples and sample code are included to illustrate the method.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.

Similar content being viewed by others

References

  • Bates, D.M., & Watts, D.G. (1988). Nonlinear regression. New York: Wiley.

    Google Scholar 

  • Booth, J.G., & Hobert, J.P. (1998). Standard errors of prediction in generalized linear mixed models. Journal of the American Statistical Association, 93, 262–272.

    Article  Google Scholar 

  • Browne, M.W., & du Toit, S.H.C. (1991). Models for learning data. In L. Collins & J.L. Horn (Eds.), Best methods for the analysis of change (pp. 47–68). Washington: American Psychological Association.

    Google Scholar 

  • Cudeck, R., & du Toit, S.H.C. (2002). A nonlinear form of quadratic regression with interpretable parameters. Multivariate Behavioral Research, 37, 501–519.

    Article  Google Scholar 

  • Davidian, M. (2009). Non-linear mixed-effects models. In G. Fitzmaurice, M. Davidian, G. Verbeke, & G. Molenberghs (Eds.), Longitudinal data analysis, Boca Raton: Chapman & Hall/CRC.

    Google Scholar 

  • Davis, C.S. (2002). Statistical methods for the analysis of repeated measurements. New York: Springer.

    Google Scholar 

  • Demidenko, E. (2004). Mixed models theory and applications. Hoboken: Wiley.

    Book  Google Scholar 

  • DeSarbo, W.S., & Cron, W.L. (1988). A maximum likelihood methodology for clusterwise linear regression. Journal of Classification, 5, 249–282.

    Article  Google Scholar 

  • Graybill, F.A. (1983). Matrices with applications in statistics (2nd ed.). Pacific Grove: Wadsworth.

    Google Scholar 

  • Hand, D., & Crowder, M. (1996). Practical longitudinal data analysis. London: Chapman & Hall.

    Book  Google Scholar 

  • Harring, J.R. (2005). Nonlinear mixed effects mixture model: a model for clustering nonlinear longitudinal profiles. Doctoral dissertation. University of Minnesota. Available from ProQuest Dissertations and theses database (UMI No. 3172806).

  • Harring, J.R. (2012). Finite mixtures of nonlinear mixed effects models. In J.R. Harring & G.R. Hancock (Eds.), Advances in longitudinal methods in the social and behavioral sciences (pp. 159–192). Charlotte: Information Age Publishing.

    Google Scholar 

  • Huet, S., Bouvier, A., Poursat, M.-A., & Jolivet, E. (2004). Statistical tools for nonlinear regression (2nd ed.). New York: Springer.

    Google Scholar 

  • Hosmer, D.W. (1974). Maximum likelihood estimates of the parameters of a mixture of two regression lines. Communications in Statistics, 3, 995–1006.

    Article  Google Scholar 

  • Jedidi, K., Jagpal, H.S., & DeSarbo, W.S. (1997a). STEMM: a general finite mixture structural equation model. Journal of Classification, 14, 23–50.

    Article  Google Scholar 

  • Jedidi, K., Jagpal, H.S., & DeSarbo, W.S. (1997b). Finite-mixture structural equation models for response-based segmentation and unobserved heterogeneity. Marketing Science, 16(1), 39–59.

    Article  Google Scholar 

  • Jones, B., & Nagin, D.S. (2007). Advances in group-based trajectory modeling and a SAS procedure for estimating them. Sociological Methods & Research, 35, 542–571.

    Article  Google Scholar 

  • Krommer, A.R., & Ueberhuber, C.W. (1994). Numerical integration on advanced computer systems. New York: Springer.

    Book  Google Scholar 

  • Komárek, A., Verbeke, G., & Molenberghs, G. (2002). A SAS-macro for linear mixed models with finite normal mixtures as random-effects distribution, Version 1.1.

  • Lenk, P.J., & DeSarbo, W.S. (2000). Bayesian inference for finite mixture models of generalized mixture models with random effects. Psychometrika, 65, 93–119.

    Article  Google Scholar 

  • Lesaffre, E., & Spiessens, B. (2001). On the effect of the number of quadrature points in a logistic random-effects model: an example. Applied Statistics, 50, 325–335.

    Google Scholar 

  • Lindstrom, M.J., & Bates, D.M. (1990). Nonlinear mixed effects models for repeated measures data. Biometrics, 46, 673–687.

    Article  PubMed  Google Scholar 

  • Liu, L., & Yu, Z. (2008). A likelihood reformulation method in non-normal random effects models. Statistics in Medicine, 27, 3105–3124.

    Article  PubMed  Google Scholar 

  • McCulloch, C.E., Searle, S.R., & Neuhaus, J.M. (2008). Generalized linear and mixed models (2nd ed.). New York: Wiley.

    Google Scholar 

  • McDonald, R.P. (2004). The informative analysis of individual trend curves. Multivariate Behavioral Research, 39, 517–563.

    Article  Google Scholar 

  • McLachlan, G., & Peel, D. (2000). Finite mixture models. New York: Wiley.

    Book  Google Scholar 

  • Meredith, W., & Tisak, J. (1990). Latent curve analysis. Psychometrika, 55(1), 107–122.

    Article  Google Scholar 

  • Motulsky, H., & Christopoulos, A. (2004). Fitting models to biological data using linear and nonlinear regression. Oxford: Oxford University Press.

    Google Scholar 

  • Muthén, B., & Muthén, L. (2008). Mplus: user’s manual. Los Angeles: Muthén & Muthén.

    Google Scholar 

  • Muthén, B., & Shedden, K. (1999). Finite mixture modeling with mixture outcomes using the EM algorithm. Biometrics, 55, 463–469.

    Article  PubMed  Google Scholar 

  • Nagin, D.S. (2005). Group-based modeling of development. Cambridge: Harvard University Press.

    Google Scholar 

  • Nylund, K.L., Asparouhov, T., & Muthen, B.O. (2007). Deciding on the number of classes in latent class analysis and growth mixture modeling: a Monte Carlo simulation study. Structural Equation Modeling, 14, 535–569.

    Article  Google Scholar 

  • Pauler, D.K., & Laird, N.M. (2000). A mixture model for longitudinal data with application to assessment of noncompliance. Biometrics, 56, 464–472.

    Article  PubMed  Google Scholar 

  • Pinheiro, J.C., & Bates, D.M. (1995). Approximations to the log-likelihood function in the nonlinear mixed-effects model. Journal of Computational and Graphical Statistics, 4, 12–35.

    Google Scholar 

  • Proust, C., & Jacqmin-Gadda, H. (2005). Estimation of linear mixed models with a mixture distribution for the random effects. Computer Methods and Programs in Biomedicine, 78, 165–173.

    Article  PubMed  Google Scholar 

  • Ratkowsky, D.A. (1983). Nonlinear regression modeling. New York: Marcel Dekker.

    Google Scholar 

  • Ratkowsky, D.A. (1990). Handbook of nonlinear regression models. New York: Marcel Dekker.

    Google Scholar 

  • SAS Institute (2011). SAS/STAT 9.3 user’s guide: the NLMIXED procedure. Cary: SAS Institute. Online documentation retrieved from http://support.sas.com/documentation/onlinedoc/stat/930/nlmixed.pdf.

    Google Scholar 

  • Seber, G.A.F., & Wild, C.J. (1989). Nonlinear regression. New York: Wiley.

    Book  Google Scholar 

  • Skrondal, A., & Rabe-Hesketh, S. (2009). Prediction in multilevel generalized linear models. Journal of the Royal Statistical Society. Series A, 172(3), 659–687.

    Article  Google Scholar 

  • Verbeke, G., & Lesaffre, E. (1996). A linear mixed-effects model with heterogeneity in the random-effects population. Journal of the American Statistical Association, 91, 217–221.

    Article  Google Scholar 

  • Verbeke, G., & Molenberghs, G. (2000). Linear mixed models for longitudinal data. New York: Springer.

    Google Scholar 

  • Verbeke, G., & Molenberghs, G. (2003). The use of score tests for inference on variance components. Biometrics, 59, 254–262.

    Article  PubMed  Google Scholar 

  • Vermunt, J.K. (2010). Longitudinal research using mixture models. In K. van Montfort, J.H.L. Oud, & A. Satorra (Eds.), Longitudinal research with latent variables (pp. 119–152). Heidelberg: Springer.

    Chapter  Google Scholar 

  • Vermunt, J.K., & Magidson, J. (2008). LG-syntax user’s guide: manual for latent GOLD 4.5 syntax module. Belmont: Statistical Innovations.

    Google Scholar 

  • Vonesh, E.F., & Carter, R.L. (1992). Mixed-effects nonlinear regression for unbalanced repeated measures. Biometrics, 48, 1–17.

    Article  PubMed  Google Scholar 

  • Vonesh, E.F., & Chinchilli, V.M. (1997). Linear and nonlinear models for the analysis of repeated measures. New York: Marcel Dekker.

    Google Scholar 

  • Weisberg, S. (2005). Applied linear regression (3rd ed.). New York: Wiley.

    Book  Google Scholar 

  • Woltz, D.J. (1988). An investigation of the role of working memory in procedural skill acquisition. Journal of Experimental Psychology. General, 117, 319–331.

    Article  Google Scholar 

  • Xu, W., & Hedeker, D. (2001). A random-effects mixture model for classifying treatment response in longitudinal clinical trials. Journal of Biopharmaceutical Statistics, 11, 253–273.

    Article  PubMed  Google Scholar 

  • Young, D.S., Hunter, D.R., Elmore, R.T., Xuan, F., Hettmansperger, T.P., & Thomas, H. (2007). The mixtools package: tools for mixture models. R Package Version 0.2.0.

  • Yung, Y.-F. (1997). Finite mixtures in confirmatory factor-analysis models. Psychometrika, 62(3), 297–330.

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Casey L. Codd.

Appendices

Appendix A

In this section we present code to fit model (12) with a mixture of random effects distributions given in (13). The code is divided into five sections. In Section 1 model options are specified, starting values for model parameters are given, and terms (both constants and functions of model parameters) that will be used throughout the model are defined. The final line of this section also defines the distribution of the random effects to be standard normal. This is simply a computing strategy, and the distribution of the random effects will be rescaled in later sections.

Terms that are needed to define the likelihood function are computed in Sections 2 and 3. In particular, terms that need to be compiled over time for each individual are defined in Section 2. Using the notation from Equations (9) and (10), terms that are common to both classes and terms that are unique to each are defined in Section 3.

The log-likelihood function is then defined in Section 4. Following (8), the likelihood function involves 3 distributions: (1) the conditional distribution of the data given random effects and group, m g (y i |u,g), (2) the distribution of the random effects, h g (u|g), and (3) a standard normal distribution of the random effects. Lpart1 involves the pieces of the log-likelihood function that are common to both classes for this particular model. The pieces that are unique to the latent classes are given in Lpart2. Because this piece involves taking the log of a sum, we use the identity ln(a+b)=ln(e ln(a)−ln(b)+1)+ln(b), where ln(a) defines the terms from the overall log-likelihood function that are unique to the first class and ln(b) defines the terms that are unique to the second class. Finally, Lpart3 defines the standard normal distribution of the random effects. These terms are all then combined to create the overall log-likelihood function which is labeled Li. Even though all of the data is included in Li, NLMIXED still requires that a variable be listed on the left side of the tilde in the model statement. Therefore, the variable “dum” simply acts as a placeholder.

*Section 1;

proc nlmixed data=learning qpoints=30;

  array y{*} y0-y35;

  parms int=10.5 g1_max=27.6 g2_max=42.6 rate=.05 ph11=5.1

  ph22=21.7 ve=4.5 p1=.3;

    ni = 36;

    nb = 2;

    pi = constant("pi");

    p2 = 1-p1;

  random u0 u1~ normal([0,0],[1,0,1]) subject=id;

*Section 2;

  s=0;

  do j = 1 to ni;

    t = j-1;

    f = u1 - (u1-u0)*exp(-rate*t);

    s = s + (y[j]-f)**2;

  end;

*Section 3;

  *overall;

    Q = s/ve;

    dg = ph11*ph22; *determinant of phi;

    dig = ve**ni; *determinant of lambda;

  *population 1;

    v11 = u0-int;

    v21 = u1-g1_max;

    qi1 = ((v11**2)*ph22 + (v21**2)*ph11)/dg;

  *population 2;

    v12 = u0-int;

    v22 = u1-g2_max;

    qi2 = ((v12**2)*ph22 + (v22**2)*ph11)/dg;

*Section 4;

  Lpart1 = -.5*((ni+nb)*log(2*pi) + log(dig) + log(dg) + Q);

    lna = log(p1) -.5*(qi1);

    lnb = log(p2) -.5*(qi2);

  Lpart2 = log(exp(lna-lnb)+1)+lnb;

  Lpart3 = (-nb/2)*log(2*pi) -.5*(u0**2 + u1**2);

  Li = Lpart1 + Lpart2 - Lpart3;

  dum=1;

  model dum~general(Li);

*Section 5;

  prob1 = (p1*exp(-.5*qi1))/((p1*exp(-.5*qi1))+(p2*exp(-.5*qi2)));

  predict u0 out=u0 (keep=id pred rename=(pred=rand_u0));

  predict u1 out=u1 (keep=id pred rename=(pred=rand_u1));

  predict prob1 out=prob1 (keep=id pred rename=(pred=group_memb));

run;

Appendix B

This example fits model (14) with (13) as the covariance matrix of the conditional distribution of u i |g. The code is formatted similarly to that found in Appendix A. There are two differences to point out. First, parameters that vary widely in terms of scale can sometimes hinder convergence in the estimation procedure; therefore, it is often useful to rescale some of the parameters. This is done here in Section 1. Second, in Section 2 a small constant is added to the denominator of the f term so as to avoid diving by zero in the initial iteration when both t and u1 are equal to zero.

*Section 1;

proc nlmixed data=learning qpoints=30;

  array y{*} y0-y35;

  parms int=9.8 g1_max=51 g2_max=29 half_max=14 s11=14 s22=9

  se=100 p1z=5.1;

     p1 = p1z/10; ph11 = s11*s11; ph22 = s22*s22; ve = se*se;

     ni = 36; nb = 2; pi = constant("pi");

     p2 = 1-p1;

  random u0 u1~ normal([0,0],[1,0,1]) subject=id;

*Section 2;

   s=0;

   do j = 1 to ni;

      t = j-1;

      f = int + (u0*t)/(u1+t+.00001);

      s = s + (y[j]-f)**2;

   end;

*Section 3;

   *overall;

      Q = s/ve;

      dg = ph11*ph22; *determinant of phi;

      dig = ve**ni; *determinant of lambda;

   *population 1;

      v11 = u0-g1_max;

      v21 = u1-half_max;

      qi1 = ((v11**2)*ph22 + (v21**2)*ph11)/dg;

   *population 2;

      v12 = u0-g2_max;

      v22 = u1-half_max;

      qi2 = ((v12**2)*ph22 + (v22**2)*ph11)/dg;

*Section 4;

   Lpart1 = -.5*((ni+nb)*log(2*pi) + log(dig) + log(dg) + Q);

      lna = log(p1) -.5*(qi1);

      lnb = log(p2) -.5*(qi2);

   Lpart2 = log(exp(lna-lnb)+1)+lnb;

   Lpart3 = (-nb/2)*log(2*pi) -.5*(u0**2 + u1**2);

   Li = Lpart1 + Lpart2 - Lpart3;

   dum=1;

   model dum~general(Li);

*Section 5;

   prob1 = (p1*exp(-.5*qi1))/((p1*exp(-.5*qi1))+(p2*exp(-.5*qi2)));

   estimate 'ph11' ph11; estimate 'ph22' ph22; estimate 'p1' p1;

   estimate 've' ve;

   predict u0 out=u0 (keep=id pred rename=(pred=u0));

   predict u1 out=u1 (keep=id pred rename=(pred=u1));

   predict prob1 out=prob1 (keep=id pred rename=(pred=group_memb));

run;

Appendix C

This example uses (15) for the response function, (16) for the variance of the random intercept, and (17) for the variance function of the residuals. The additional code in the following example can be attributed to the fact that the quadratic model has fixed effects that differ between groups and a more complicated error structure than the previous two models. All of the necessary adjustments for these differences are made in Section 2. The differences in fixed effects between groups are accounted for by computing f ig (a i ,b i ,κ g ,τ) separately for each group (f_g1 and f_g2). The linear change in the error variance over time is specified in the ve term. The determinant of Λ i is calculated in the term “dig” and the \(\mathbf{e}'_{ig}\boldsymbol{\Lambda}_{ig}^{ - 1}\mathbf{e}_{ig}\) term from the conditional distribution of the data given the random effects is defined by “Qi1” for group 1 and by “Qi2” for group 2.

*Section 1;

proc nlmixed data=learning qpoints=40;

   array y{*} y0-y35;

   parms int=11.2 g1_slope=.94 g2_slope=1.16 quad=-.01

   ve_int=5.8 ve_slp=-.08

         ph11=11.2 p1=.4;

     ni = 36; nb = 1;

     pi = constant(''pi'');

     p2 = 1-p1;

   random u0 ~ normal([0],[1]) subject=id;

*Section 2;

   Qi1=0; Qi2=0; dig=1;

      do j = 1 to ni;

         t = j-1;

         f_g1 = u0 + g1_slope*t + quad*t*t;

         f_g2 = u0 + g2_slope*t + quad*t*t;

         s_g1 = (y[j]-f_g1)**2;

         s_g2 = (y[j]-f_g2)**2;

         ve = ve_int + ve_slp*t;

         dig = dig * ve; *determinant of lambda;

         Qi1 = Qi1 + (s_g1 / ve);

         Qi2 = Qi2 + (s_g2 / ve);

      end;

*Section 3;

   *overall;

      dg = ph11; *determinant of phi;

      v11 = u0-int;

      num = v11**2;

      qi = num/dg;

*Section 4;

   Lpart1 = -.5*((ni+nb)*log(2*pi) + log(dig) + log(dg) + qi);

        lna = log(p1) -.5*(Qi1);

        lnb = log(p2) -.5*(Qi2);

   Lpart2 = log(exp(lna-lnb)+1)+lnb;

   Lpart3 = (-nb/2)*log(2*pi) -.5*(u0**2);

   Li = Lpart1 + Lpart2 - Lpart3;

   dum=1;

   model dum~general(Li);

*Section 5;

   predict u0 out=u0 (keep=id pred rename=(pred=u0));

run;

Rights and permissions

Reprints and permissions

About this article

Cite this article

Codd, C.L., Cudeck, R. Nonlinear Random-Effects Mixture Models for Repeated Measures. Psychometrika 79, 60–83 (2014). https://doi.org/10.1007/s11336-013-9358-9

Download citation

  • Received:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11336-013-9358-9

Key words

Navigation