Commenced in January 2007
Frequency: Monthly
Edition: International
Paper Count: 32718
dynr.mi: An R Program for Multiple Imputation in Dynamic Modeling

Authors: Yanling Li, Linying Ji, Zita Oravecz, Timothy R. Brick, Michael D. Hunter, Sy-Miin Chow


Assessing several individuals intensively over time yields intensive longitudinal data (ILD). Even though ILD provide rich information, they also bring other data analytic challenges. One of these is the increased occurrence of missingness with increased study length, possibly under non-ignorable missingness scenarios. Multiple imputation (MI) handles missing data by creating several imputed data sets, and pooling the estimation results across imputed data sets to yield final estimates for inferential purposes. In this article, we introduce dynr.mi(), a function in the R package, Dynamic Modeling in R (dynr). The package dynr provides a suite of fast and accessible functions for estimating and visualizing the results from fitting linear and nonlinear dynamic systems models in discrete as well as continuous time. By integrating the estimation functions in dynr and the MI procedures available from the R package, Multivariate Imputation by Chained Equations (MICE), the dynr.mi() routine is designed to handle possibly non-ignorable missingness in the dependent variables and/or covariates in a user-specified dynamic systems model via MI, with convergence diagnostic check. We utilized dynr.mi() to examine, in the context of a vector autoregressive model, the relationships among individuals’ ambulatory physiological measures, and self-report affect valence and arousal. The results from MI were compared to those from listwise deletion of entries with missingness in the covariates. When we determined the number of iterations based on the convergence diagnostics available from dynr.mi(), differences in the statistical significance of the covariate parameters were observed between the listwise deletion and MI approaches. These results underscore the importance of considering diagnostic information in the implementation of MI procedures.

Keywords: Dynamic modeling, missing data, multiple imputation, physiological measures.

Digital Object Identifier (DOI):

Procedia APA BibTeX Chicago EndNote Harvard JSON MLA RIS XML ISO 690 PDF Downloads 734


[1] N. Bolger and J.-P. Laurenceau, Intensive Longitudinal Methods: An Introduction to Diary and Experience Sampling Research. New York, NY: Guilford Press, 2013.
[2] T. H. Walls and J. L. Schafer, Models for intensive longitudinal data. Oxford: University Press, 2006.
[3] S. Shiffman, A. A. Stone, and M. R. Hufford, “Ecological momentary assessment.” Annual Review of Clinical Psychology, vol. 4, pp. 1–32, 2008.
[4] A. Stone, S. Shiffman, A. Atienza, and L. Nebeling, The Science of Real-Time Data Capture: Self-Reports in Health Research. NY: Oxford University Press, 2008.
[5] L. Ou, M. D. Hunter, and S.-M. Chow, “What’s for dynr: A package for linear and nonlinear dynamic modeling in R,” The R Journal, 2019, in press.
[6] D. B. Rubin, “Inference and missing data,” Biometrika, vol. 63, no. 3, pp. 581–592, 1976.
[7] L. Ji, S.-M. Chow, A. C. Schermerhorn, N. C. Jacobson, and E. M. Cummings, “Handling missing data in the modeling of intensive longitudinal data,” Structural Equation Modeling: A Multidisciplinary Journal, pp. 1–22, 2018.
[8] D. B. Rubin, Multiple imputation for nonresponse in surveys. John Wiley & Sons, 2004, vol. 81.
[9] S. van Buuren and C. Oudshoorn, “Multivariate imputation by chained equations,” MICE V1. 0 user’s manual. Leiden: TNO Preventie en Gezondheid, 2000.
[10] S. van Buuren and K. Groothuis-Oudshoorn, “mice: Multivariate imputation by chained equations in R,” Journal of Statistical Software, vol. 45, no. 3, pp. 1–67, 2011.
[Online]. Available:
[11] T. E. Raghunathan, J. M. Lepkowski, J. Van Hoewyk, P. Solenberger et al., “A multivariate technique for multiply imputing missing values using a sequence of regression models,” Survey methodology, vol. 27, no. 1, pp. 85–96, 2001.
[12] T. W. Anderson, “Maximum likelihood estimates for a multivariate normal distribution when some observations are missing,” Journal of the American Statistical Association, vol. 52, pp. 200–203, June 1957.
[Online]. Available:
[13] J. A. Russell, “Core affect and the psychological construction of emotion,” Psychological Review, vol. 110, pp. 145–172, 2003.
[14] P. Kuppens, Z. Oravecz, and F. Tuerlinckx, “Feelings change: Accounting for individual differences in the temporal dynamics of affect,” Journal of Personality and Social Psychology, vol. 99, pp. 1042–1060, 2010.
[15] U. Ebner-Priemer, M. Houben, P. Santangelo, N. Kleindienst, F. Tuerlinckx, Z. Oravecz, G. Verleysen, K. V. Deun, M. Bohus, and P. Kuppens, “Unraveling affective dysregulation in borderline personality disorder: a theoretical model and empirical evidence.” Journal of abnormal psychology, vol. 124 1, pp. 186–98, 2015.
[16] J. A. Russell and L. F. Barrett, “Core affect, prototypical emotional episodes, and other things called emotion: dissecting the elephant,” Journal of Personality and Social Psychology, vol. 76, pp. 805–819, 1999.
[17] R. W. Picard, S. Fedor, and Y. Ayzenberg, “Multiple Arousal Theory and Daily-Life Electrodermal Activity Asymmetry,” Emotion Review, pp. 1–14, Mar. 2015.
[Online]. Available:
[18] N. L. Sin, R. P. Sloan, P. S. McKinley, and D. M. Almeida, “Linking daily stress processes and laboratory-based heart rate variability in a national sample of midlife and older adults,” Psychosomatic medicine, vol. 78(5), pp. 573–582, 2016.
[19] T. Bossmann, M. K. Kanning, S. Koudela-Hamila, S. Hey, and U. Ebner-Priemer, “The association between short periods of everyday life activities and affective states: A replication study using ambulatory assessment,” Frontiers in Psychology, vol. 4, 2013.
[20] G. F. Dunton, J. Huh, A. M. Leventhal, N. R. Riggs, D. Hedeker, D. Spruijt-Metz, and M. A. Pentz, “Momentary assessment of affect, physical feeling states, and physical activity in children.” Health psychology : official journal of the Division of Health Psychology, American Psychological Association, vol. 33 3, pp. 255–63, 2014.
[21] M. K. Kanning and D. Schoebi, “Momentary affective states are associated with momentary volume, prospective trends, and fluctuation of daily physical activity,” Frontiers in Psychology, vol. 7, 2016.
[22] C. Y. N. Niermann, C. Herrmann, B. von Haaren, D. H. H. V. Kann, and A. Woll, “Affect and subsequent physical activity: An ambulatory assessment study examining the affect-activity association in a real-life context,” Frontiers in Psychology, vol. 7, 2016.
[23] Y. Liao, C.-P. Chou, J. Huh, A. M. Leventhal, and G. F. Dunton, “Examining acute bi-directional relationships between affect, physical feeling states, and physical activity in free-living situations using electronic ecological momentary assessment,” Journal of Behavioral Medicine, vol. 40, pp. 445–457, 2016.
[24] S.-M. Chow, M.-H. R. Ho, E. J. Hamaker, and C. V. Dolan, “Equivalences and differences between structural equation and state-space modeling frameworks,” Structural Equation Modeling, vol. 17, pp. 303–332, 2010.
[25] J. Durbin and S. J. Koopman, Time Series Analysis by State Space Methods. Oxford, United Kingdom: Oxford University Press, 2001.
[26] S.-M. Chow, L. Ou, A. Ciptadi, E. Prince, M. D. Hunter, D. You, J. M. Rehg, A. Rozga, and D. S. Messinger, “Representing sudden shifts in intensive dyadic interaction data using differential equation models with regime switching,” Psychometrika, vol. 83, no. 2, pp. 476–510, 2018.
[27] R. E. Kalman, “A new approach to linear filtering and prediction problems,” Journal of Basic Engineering, vol. 82, no. 1, pp. 35–45, 1960.
[28] P. De Jong, “The likelihood for a state space model,” Biometrika, vol. 75, no. 1, pp. 165–169, March 1988.
[29] A. C. Harvey, Forecasting, Structural Time Series Models and the Kalman Filter. Cambridge, United Kingdom: Cambridge University Press, 1989.
[30] J. D. Hamilton, Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.
[31] S.-M. Chow and G. Zhang, “Nonlinear regime-switching state-space (RSSS) models,” Psychometrika, vol. 78, no. 4, pp. 740–768, 2013.
[32] H. Akaike, “Information theory and an extension of the maximum likelihood principle,” in Second International Symposium on Information Theory, B. N. Petrov and F. Csaki, Eds. Budapest: Akademiai Kiado, 1973, pp. 267–281.
[33] G. Schwarz, “Estimating the dimension of a model,” The Annals of Statistics, vol. 6, no. 2, pp. 461–464, 1978.
[34] F. Thoemmes and N. Rose, “A cautious note on auxiliary variables that can increase bias in missing data problems,” Multivariate Behavioral Research, vol. 49, no. 5, pp. 443–459, 2014.
[35] L. M. Collins, J. L. Schafer, and C.-M. Kam, “A comparison of inclusive and restrictive strategies in modern missing data procedures.” Psychological methods, vol. 6, no. 4, p. 330, 2001.
[36] A. Gelman and D. B. Rubin, “Inference from iterative simulation using multiple sequences,” Statistical science, vol. 7, no. 4, pp. 457–472, 1992.
[37] S. Brooks and A. Gelman, “Some issues for monitoring convergence of iterative simulations,” Computing Science and Statistics, pp. 30–36, 1998.
[38] R. W. Picard, “Recognizing Stress, Engagement, and Positive Emotion,” in Proceedings of the 20th International Conference on Intelligent User Interfaces, ser. IUI ’15. New York, NY, USA: ACM, 2015, pp. 3–4.
[Online]. Available:
[39] P. Kuppens, N. B. Allen, and L. B. Sheeber, “Emotional inertia and psychological maladjustment,” Psychological Science, 2010.
[40] P. Royston, “Multiple imputation of missing values,” The Stata Journal, vol. 4, no. 3, pp. 227–241, 2004.
[41] K. Lu, “Number of imputations needed to stabilize estimated treatment difference in longitudinal data analysis,” Statistical methods in medical research, vol. 26, no. 2, pp. 674–690, 2017.
[42] R. J. Little and D. B. Rubin, Statistical analysis with missing data. Wiley, 2019, vol. 793.