Message/Author 


The topic of crosslagged panel modeling has come up a couple of times recently. I recommend the article by Hamaker et al (2015) in Psych Methods: A critique of crosslagged panel modeling. Here is Hamaker's Mplus input for the proposed RICLPM in Figure 1: MODEL: ! Create two individual factors (random intercepts kappa and omega) mu_x BY x1@1 x2@1 x3@1 x4@1; mu_y BY y1@1 y2@1 y3@1 y4@1; ! Create withinperson centered variables cx1 BY x1@1; cx2 BY x2@1; cx3 BY x3@1; cx4 BY x4@1; cy1 BY y1@1; cy2 BY y2@1; cy3 BY y3@1; cy4 BY y4@1; ! Constrain the measurement error variances to zero y1x4@0; ! Optional: Constrain observed means per variable over time ! [x1 x2 x3 x4] (mx); ! [y1 y2 y3 y4] (my); ! Specify the lagged effects between the withinperson centered variables ! Optional: constrain them to be invariant over time cx2 ON cy1 cx1; cx3 ON cy2 cx2; cx4 ON cy3 cx3; cy2 ON cy1 cx1; cy3 ON cy2 cx2; cy4 ON cy3 cx3; ! Withinperson centered variables at the first wave correlated cx1 WITH cy1; ! Allow the residuals (dynamic errors) at subsequent waves to be correlated cx2 WITH cy2; cx3 WITH cy3; cx4 WITH cy4; ! Fix the correlation between the random intercepts and the withinperson centered ! variables at the first wave to zero (as by default these would be estimated) mu_x WITH cx1@0 cy1@0; mu_y WITH cx1@0 cy1@0; Note that the cx and cy factors behind each outcome are used to represent the withinlevel (withinsubject) part of the outcomes  the betweensubject part is captured by the random intercepts  so that the crosslagged regressions refer to relationships on the within level. 

claudia cs posted on Thursday, July 05, 2018  6:31 am



Hi there, I am running the RICLPM for motivation and different emotions. I have two questions/concerns: a) I am confused why some autoregressive paths are not significant (I also ran the models according to the traditional CLPM, and they were all significant). I am aware that the autoregressive parameters in the traditional CLPM are usually higher, however, I would not know how to interpret these findings. b) How do I account for measurement invariance using the RICLPM? Can I still do latent modelling for the scales using the items (and enforcing equal factor loadings across the three measurement points). Your help is much appreciated! Thank you 


a) This is surprising  are you sure you set it up correctly? Or, perhaps your time points are not close in time so that the intercept factor captures most of the correlation across time. b) Yes. 

claudia cs posted on Friday, July 06, 2018  5:39 am



Thank you for your response. I agree, this is a surprising result  especially given that the traditional CLPM show significant effects. Unfortunately, my syntax is too big to paste in here. May I send it? Thank you very much. 


Send your output  and data if possible  to Support along with your license number. 


Hello, Thank you very much for posting the code to apply RICLPM in Mplus. It was very helpful, and I got it working for my panel (longitudinal) data. I am used to analyzing longitudinal data in multilevel models; therefore, the terminology that I will use below will be quite similar. For my model, I would like to add a moderator for the crosslagged paths (e.g., for cx1 on cy2). In multilevel terms, this would be an interaction between a level 2 variable and a level 1 variable (or: an interaction of a betweenperson variable that has been measured once and the withinperson part of a repeated measure). I checked the multilevel moderation and mediation sources for Mplus. However, as the RICLPM does not seem to take the typical multilevel approach, I'm having a hard time to integrate the moderation models with RICLPM. I was wondering whether someone has any thoughts/ideas on this. Thank you for your consideration. 


I hope to have some thoughts on that from Hamaker herself before too long. 


When the moderator is invariant over time, you have several options: a) a multiple group approach based on a median split of the moderator, and then compare parameters across the two groups; this does involve overruling some of the Mplus multiple group defaults though; b) a DSEM (i.e., multilevel time series) approach (this requires your data to be in long format, rather than in wide format); adding a crosslevel interaction is really simple then (you just add the moderator as a between level predictor for the random slopes); the disadvantage is that it automatically assumes that all the parameters are invariant over time (e.g., the lagged relationships between waves, or the residual variances), which may be problematic when the intervals between the waves vary, and/or if the time intervals between the waves are relatively large and developmental changes are may have occurred during the study; however, some of these constraints may be overcome by adding dummy variables for the different waves, and interaction terms between these and the lagged predictors; c) add the actual interaction terms to the RICLPM (with data in wide format); this would require the interaction between the moderator and the withinperson centered latent variables (e.g., cy1); I believe this could be done using the XWITH statement. Note that the latter would also be the goto option if you have a timevarying moderator. 


Thank you very much for your response, it was very helpful. I worked on option c) and started with just one moderated path, however I got the following message: THE ESTIMATED COVARIANCE MATRIX COULD NOT BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1. CHANGE YOUR MODEL AND/OR STARTING VALUES. I added the following lines to the code in the opening post, to show how I defined my timeinvariant moderator and interaction terms. analysis: TYPE=RANDOM; ALGORITHM = INTEGRATION !(to use the XWITH statement) cm1 BY m1@1 m1@0 cx3 ON cy2 cx2 m1; cy2xcm1  cy1 XWITH cm1; cx3 ON cy2xcm1;  I'm already quite skeptical that I can reach convergence with this particular model with my current data (917 observations), however I can not pinpoint at the moment whether that is an issue right now or whether I overlooked something with my code. Thank you for pointing me into the direction of option b), which could also be viable in my case. 


Send your output to Support along with your license number so we can take a close look at it. Otherwise, option a) is down to earth. 


Thank you for this code, very helpful. I have a model that does not converge (I have tried increasing the number of iterations already) and I think that the problem is with one of the new within person centered variables. I had previously run a normal CLPM with no problems. What can I try to get convergence? 


That depends. Send your output to Support along with your license number. 


Dear Is it a necessary part of the model to constrain the measurement error variances to zero? (in the example: y1x4@0;) Would it bias the model if they were not constrained? Many thanks in advance. 


Here is Hamaker's answer on this: You can estimate measurement error variance, although you need som constraint for identification(e.g., all measurement error variances are held equal; or the first and last are equal to the second and second last respectively. Adding measurement error results in Kenny and Zautra’s trait state error (TSE) model (formerly known as the STARTS model). In general it requires a larger number of repeated measurements (say 8 waves or more), to be empirically identified. 


Dear Muthen, I am running an RICLPM model with two variables and two waves, and 3 covariates. I wonder if my syntax is correct? model cant converge. what can i do? thanks! MODEL: RI_PORCSB BY PORCSB1@1 PORCSB2@1; RI_FTS BY FTS1@1 FTS2@1; cPORCSB1 BY PORCSB1@1; cPORCSB2 BY PORCSB2@1; cFTS1 BY FTS1@1; cFTS2 BY FTS2@1; PORCSB1FTS2@0; cPORCSB2 ON cPORCSB1 cFTS1 AGE1 SEX1 BMI1; cFTS2 ON cPORCSB1 cFTS1 AGE1 SEX1 BMI1; cPORCSB1 WITH cFTS1; cPORCSB2 WITH cFTS2; RI_PORCSB WITH cPORCSB1@0 cFTS1@0; RI_FTS WITH cPORCSB1@0 cFTS1@0; OUTPUT: TECH1 STDYX SAMPSTAT; 


A RICLPM with only two waves is not identified (as the traditional CLPM is already saturated then, so adding two latent variables with a covariance is not possible then). While having some covariates here may ensure that the number of parameters does not exceed the number of sample statistics (such that the model is not resulting in a negative number of df), the model is probably still not identified, because with only two waves, it is not possible to tell the difference between stability due to autoregression versus stability due to a trait. In contrast, when you have three waves, you can tell the difference between these two forms of stability, because they imply different covariance structures (i.e., the typical simplex structure versus the one factor structure). 


Thank you for your response. My understanding is that i have to go with a traditional clpm. here is what i have now: MODEL: PORCSB2 ON PORCSB1 FTS1 AGE1 BMI1 SEX1; FTS2 ON PORCSB1 FTS1 AGE1 BMI1 SEX1; PORCSB1 WITH FTS1; PORCSB2 WITH FTS2; However, age and bmi are time variant covariates. how do i account for this in the model? my alternative would be: PORCSB2 ON PORCSB1 FTS1 AGE2 BMI2 SEX1; FTS2 ON PORCSB1 FTS1 AGE2 BMI2 SEX1; PORCSB1 ON AGE1 SEX1; FTS1 ON AGE 1 SEX1; PORCSB1 WITH FTS1; PORCSB2 WITH FTS2; is correct? thanks 

yuxiong posted on Tuesday, October 02, 2018  9:40 am



I am trying to use RICLPM in multigroup comparison, however I got identification issues. I read the post in the comment that "a) a multiple group approach based on a median split of the moderator, and then compare parameters across the two groups; this does involve overruling some of the Mplus multiple group defaults though" can I ask what specifically needs to be overruled? I only know that reference factor mean is set to 0 by default but it does not seem to influence this one. 


Here is Hamaker's answer: Mplus will impose the following default constraints (related to strong factorial invariance): a) equal factor loadings across groups; this is no problem here, because all factor loadings are constrained to be 1 anyway b) equal intercepts across groups; this you typically do not want, so you need to free the intercepts in the second group; you can simply do this by specifying them as free parameters; when you have x1 to y3, you simply include for the second group: [x1y3]; c) free latent means in the second group; this leads to trying to estimate more parameters for the mean structure than that there are observed means (hence the identification problems); you need to constrain all the means of the latent variables in the second group to zero; this includes the means of the random intercept factors, and the means of the withinperson centered variables per occasion 

yuxiong posted on Tuesday, October 02, 2018  6:14 pm



Thanks! It works! 


Hi there, I’m running the RICLPM for 16 separate models: 8 different predictors, and 2 different outcome variables. When I run the 8 models for the first outcome variable, everything goes smoothly. When I run the models with the second outcome variable, nearly all of the models produce the following error: THE LATENT VARIABLE COVARIANCE MATRIX (PSI) IS NOT POSITIVE DEFINITE. THIS COULD INDICATE A NEGATIVE VARIANCE/RESIDUAL VARIANCE FOR A LATENT VARIABLE, A CORRELATION GREATER OR EQUAL TO ONE BETWEEN TWO LATENT VARIABLES, OR A LINEAR DEPENDENCY AMONG MORE THAN TWO LATENT VARIABLES. CHECK THE TECH4 OUTPUT FOR MORE INFORMATION. PROBLEM INVOLVING VARIABLE MU_Y. It is generally the same variable (the random intercept of the second outcome variable) that has a negative variance. Any thoughts why this might be the case? Both outcome variables are measures of social anxiety, so I’m not sure why this is occuring  they are very similar. One idea I’ve had is to fix the variance of the random intercept of the second outcome variable to be similar to that of the first outcome variable. I know it’s recommended to fix it to zero, but doesn’t that defeat the whole purpose of the RICLPM? 


A negative variance estimate typically means a model is too complex for the data you have. In this case, I would conclude that the second outcome variable is not characterized by stable betweenperson differences; rather, everyone varies around the same mean (or trend) on this variable. Hence, you can do one of two things: 1) You can set the variance of this random intercept to zero, and also set the covariance between this random intercept and the other to zero, while still estimating the random intercept of the predictor freely; this will still result in a warning about the covariance matrix, but then you can just ignore it. 2) You can adjust the model by taking the random intercept for this outcome variable out of the model, and model the lagged relationship between the withinperson part of the predictor variable (note that for that variable you keep the random intercept in the model), and the original (i.e., nondecomposed) outcome variable. These two options are statistically identical (same fit etc.), and should lead to the same lagged parameter estimates. 

EH posted on Sunday, October 07, 2018  1:00 am



Dear dr Muthen, for RICLPM with latent variables, can i (1) use factor scores as person centered variables, or should i make a new bystatement of the factors?(2)does my input seem right? 1) WRLFT1, T2,T3 by the items (factor loadings = across time) same for WRLIT1,2,3; PEET1,2,3 and for PEIT1,2,3 2) Intercepts of items = across time 3) RI_WRLF by WRLFT1@1,T2@1,T3@1;(same for WRLI, PEE and PEI) 4) [RI_WRLF]; [RI_WRLI]; [RI_PEE]; ... 5) Intercept of all factors = 0: [WRLFT1@0 WRLFT2@0 WRLFT3@0]...; 6) All measurement error variances =0: WRLFT1@0 WRLFT2@0 WRLFT3@0 PEET1@0… 7) Aur effects: WRLFT3 ON WRLFT2 (WRLF); WRLFT2 ON WRLFT1 (WRLF); WRLIT3 ON WRLIT2 (WRLI)...; 8) All possible crosslagged effects: even if not hypothesized 9) Corr within person variables: PEET1 WITH PEIT1 WRLFT1 WRLIT1 WRLNT1; PEIT1 WITH WRLFT1 WRLIT1 WRLNT1;...; 10) Corr residuals at subsequent waves 11) Corr between the RI's and the other exogenous var =0: e.g., RI_WRLF WITH PEET1@0 PEET2@0...; 


You can find a pdf that explains how to specify a multiple indicator RICLPM (including Mplus input files and simulated data) here: https://www.statmodel.com/RICLPM.shtml 

Philipp Alt posted on Wednesday, February 13, 2019  6:42 am



Hello, I am tinking about setting up an RICLPM to study the development of two processes. However, I am not quite sure if this approach is quite fitting, because of my datastructure: I have data from 9 waves with an agerange within each wave from 8 to 15 years. Because I want to study the processes as a function of age rather than wave, I restructured all the data and basically pooled the different age groups from all waves and then remerged them into one wide dataset, giving me a large dataset with age in the columns rather than wave. But this leaves me with a couple of question before setting up a RICLPM: 1) Is there a possibilty to control for the cohort, that the person is from with the RICLPM? I would think that this mandatory. 2) Is there a way to control for the fact that people had different participation rates? Some people were measured in all 9 waves, some just once. This would also have to be addressed, I think. Is this possible wih the RICLPM approach? 3) I also have siblings in the data set. Rather than excluding them, I was wondering if I could keep them in the data set and control for the nonindepence via TYPE=COMPLEX,for example, in the RICLPM approach? Kind regards and thank you in advance, Philipp 


1) Right, age and not wave should be the time axis. You can handle this in 2 different ways, either using a dummy variable influencing the personspecific intercept or using a multiplegroup approach where group correspond to cohort. The UG ex 6.18 shows how to do the latter approach which is very flexible so that you can consider which RICLPM parameters are cohort invariant. The ex6.18 approach is also discussed in our Short Course Topic 4 on our website; see slides 48 and on. 2) Yes, this would be handled by standard ML under the usual MAR assumption, also called FIML. Just give missing data flags for the missing values. 3) Right, Type=Complex can be used to adjust the SEs. This assumes of course that subjects with siblings have the same parameter values as subject without siblings (Complex does not allow for different parameter values). 


Hello, I am testing an RICLPM model but the random intercept for one of my variables does not have significant variance across individuals. The covariance between my two random intercepts is also not significant. If I estimate variances of both random intercepts and the covariance, I get an error message that says that the latent variable covariance matrix is nonpositive definite. If I constrain the variance (and covariance) to 0 for the one variable, the error message disappears. I am still estimating variance in the random intercept for my other variable (which is significant). I understand that if I constrain both random intercepts my model is identical to the CLPM. But in this case, I am only constraining one. Is it okay to estimate the RICLPM in this way? It seems to make no substantive difference to the results. In general, if there is no traitlike aspect in one variable but there is in the other, is it okay to still use RICLPM and just constrain the variance of the intercept for that variable? Thanks in advance. 


When the variance of a random intercept is not significant, this implies there is not really evidence that there are individual differences in this term. Hence, fixing the variance to zero is a reasonable next step. Alternatively, you can decide to remove the entire random intercept from your model: This is actually the same thing, but it will also make the error message disappear. Either way, it means the new model does not include stable, timeinvariant differences between individuals in that particular variable, while there may still be timeinvariant, traitlike individual differences on the other variable, which are adequately captured by the remaining random intercept. 


Hi When we run a RICLPM using mplus with an option of STDYX, are the resulting standardized coefficient from withinperson standardization (or values from BP or GP)? Thank you in advance, Yeonjeong 


STDYX will standardize each regression coefficient using the variances (or standard deviations) of the predictor and the outcome variable that are associated with this regression coefficient. Since in the RICLPM, the lagged coefficients are included between the withinperson components, the standardization also occurs using only withinperson variance. Hence, this implies it is withinperson standardization. 


Hello, I wonder whether if it's possible to run RICLPM with 3 levels (L1 withinperson, L2 betweenperson, and L3 betweenclassroom)? If yes, how does the syntax looks like for a 3level model with a random slope at L2? Thank you in advance. 


I haven not done or seen this done before, but it should be possible in Mplus with multilevel SEM (use TYPE = TWOLEVEL, possibly also RANDOM if you want random regression parameters). Note that the regular RICLPM is in wideformat (meaning: it is not specified as a multilevel model but as a regular SEM model). In your case you would thus have time points (level 1) as variables and persons (level 2) as cases (i.e., rows in your datafile), just as in the regular RICLPM. Then you can include classroom (level 3) as the between level clusters, and decide whether you want random lagged parameters or not. You can check UG example 9.5 for an illustration of a 2level path model with random regression coefficients. 


Thank you for your response. Would RICLPM syntax look like this?: USEVARIABLES IS x1 x2 x3 z1 z2 z3; CLUSTER=id classroom; ANALYSIS: TYPE=threelevel random; MODEL: %within% Ix1 BY x1@1; Ix2 BY x2@1; Ix3 BY x3@1; Iz1 BY z1@1; Iz2 BY z2@1; Iz3 BY z3@1; x1@0; x2@0; x3@0; z1@0; z2@0; z3@0; Ix3 ON Ix2; Ix2 ON Ix1; Iz3 ON Iz2; Iz2 ON Iz1; Ix3 ON Iz2; Ix2 ON Iz1; Iz3 ON Ix2; Iz2 ON Ix1; Ix3 WITH Iz3; Ix2 WITH Iz2; Ix1 WITH Iz1; 


continued: %between id% RIx BY x1@1 x2@1 x3@1; RIz BY z1@1 z2@1 z3@1; SLx BY x1@0 x2@1 x3@2; SLz BY z1@0 z2@1 z3@2; RIx; RIz; SLx; SLz; RIx WITH Ix1@0 Iz1@0; RIz WITH Ix1@0 Iz1@0; %between classroom% RIx BY x1@1 x2@1 x3@1; RIz BY z1@1 z2@1 z3@1; RIx; RIz; RIx WITH Ix1@0 Iz1@0; RIz WITH Ix1@0 Iz1@0; 


We need to see your full output  please send your output to Mplus Support along with your license number. We ask that postings be limited to one window. 

ywang posted on Tuesday, July 23, 2019  1:25 pm



Dear Dr. Muthen, We used a CLPM model to assess two variables across three waves. The two interval is about 10.5 and 13.5 months, separately. Is there a way to account for the differences in the length of the time? Any Mplus syntax example for continuoustime CLPM? Thanks! 


When intervals in a CLPM design are of different length, the parameters should not be constrained to be identical over time. Such constraints are only sensible when the intervals are identical, and you assume the underlying process remains the same over time. To determine whether the underlying dynamics remain the same even though the intervals are different, a continuous time perspective is needed. This is explained in more detail here: https://ryanoisin.github.io/files/RyanKuiperHamaker_preprint.pdf To summarize the main issue: The constraints that are needed are on the matrix with lagged parameters, rather than on separate lagged parameters, making it difficult to impose them in Mplus. Alternatively, one could first estimate the model in the conventional way (without the constraints), and then convert the parameters obtained for the two intervals to refer to an interval of the same length (e.g. 12 months, see also https://ryanoisin.github.io/files/KuiperRyan_2018_DrawingConclusions_SEM.pdf). However, there is at this point no test to determine whether these converted parameters are significantly different from one another. Alternatively, you could use software that was specifically designed for contrinuous time modeling, such as ctsem in R. 


Hello, I have tried the code above to model RICLPM with 2 variables (anxiety and insomnia) across 4 time points (equal 10 week intervals), using Estimator = ML, and did not constrain observed means per variable over time  but receive the following message: NO COVERGENCE. NUMBER OF ITERATIONS EXCEEDED. This persists even when I increase iterations to 20000. Is there anything else I can adjust in the code to get it to converge? Thank you 


We need to see your full output  and data if possible  send to Support along with your license number. 

shonnslc posted on Wednesday, October 02, 2019  9:27 am



Hi, I am wondering if it is necessary to specify the dynamic errors in RICLPM: cx2 WITH cy2; cx3 WITH cy3; cx4 WITH cy4; What happens if this part is not specified in the model? I am doing power analysis for RICLPM and I encountered replication error when I specified dynamic errors but when I removed this part, there was no error message for each replication. Thanks. 


Those error covariances are standard and should not cause the problem you are seeing. But we need to see your full output to see what's going on  send to Support along with your license number. 

shonnslc posted on Monday, November 04, 2019  9:56 am



Hi, I am wondering if this is a correct way to add covariates to RICLPM (https://www.statmodel.com/download/RICLPM%20Hamaker%20input.pdf): RI_x RI_y on sex income; #A1 cx1 cy1 on sex income; #A2 Because if I only added covariates to either A1 or A2, my model did not converge. Thanks! 


We need to see your full output to say  send to Support along with your license number. 

Philipp Alt posted on Tuesday, January 21, 2020  4:59 am



I have more of a conceptual question about the RICLPM: My understanding of the RICLPM is that you control for stable between person differences in the between part of the model. Therefore it does not make sense to control stable covariates (variables that do not change) in the within part of the model anymore, as they are already controlled for in the betweenpart. Is this assumption right? 


Hi Philipp, your reasoning is mostly correct. However, you could also consider regressing the observed variables on a timeinvariant covariate directly (rather than through the random intercepts); this would allow for the effect of this covariate to change over time. If you’d constrain the regression parameters in this model to be invariant over time, the model ibecomed identical to the model in which the random intercept is regressed on the timeinvariant covariate. Hence, you can do a chisquare test to compare these two options (timevarying effect vs constant effect). 


Dear Drs. Muthen, I’m analyzing data for ~14,000 weighted cases across three timepoints using Hamaker’s RICLPM. I’m hoping to break this sample into subgroups to ascertain whether the crosslagged paths operate in the same way across groups. My code for the full sample works perfectly fine, and if I create separate datasets by subgroup the code again works just fine (e.g., dataset for White, dataset for Black, etc.). However, when I use the GROUPING command, I get warnings that the model is not identified. Is it possible to use the GROUPING option in order to use DIFFTEST without splitting the sample into separate datasets? Thank you! Here's the error message: THE MODEL ESTIMATION TERMINATED NORMALLY THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES COULD NOT BE COMPUTED. THE MODEL MAY NOT BE IDENTIFIED. CHECK YOUR MODEL. PROBLEM INVOLVING THE FOLLOWING PARAMETER: Parameter 24, Group DISAB: [ CACH1 ] THE CONDITION NUMBER IS 0.688D12. THE ROBUST CHISQUARE COULD NOT BE COMPUTED. 


I believe you are trying to run a multiple group version of the RICLPM. This is a little tricky, as it requires you to overrule the multiplegroupfactoranalysisdefaults that Mplus imposes. Specifically, Mplus will constrain the intercepts of observed variables to be identical across the groups, and free the latent means (i.e., for all the variables defined by a BY statement) in the second group; this leads to a model that is unidentified in this case. You can find the correct code for this (and other extensions of the RICLPM) here: https://ellenhamaker.github.io/RICLPM/mplus.html 


Hi, I wonder whether there is a way to conduct statistical testing that compares the strengths of crosslagged parameters (rather than just descriptively compare the standardized coefficients) when two sets of variables are not on the same metric? I was thinking about running a model after standardizing all variables, and directly test whether the different score is greate than zero. But it is difficult to do WP standardization on variables because of the large amount of missing values. If I use the BP standardization, I think I can interpret the results using the relative order changes, but not sure this would be a good approach. Thanks in advance! 


You can express the standardized coefficients as new parameters in Model Constraint and then a difference parameter  that gives you a test. But it can be cumbersome to express those formulas. 


Hello Dr. Hamaker, Thank you for your reply above. I am now able to run the multiple group analysis using the syntax on your website. I have two further questions: 1) why do the estimates differ when using the GROUPING command vs. when estimating separately by subsample (i.e., after creating separate datasets by subgroup)? 2) what is the syntax for testing whether, overall, the model fits differently across the subgroups? Thank you again! 


1) Grouping runs impose certain invariance constraints that your separategroup analyses won't have  check your output, e.g. Tech1 to see if you have any equalities between parameters. 2) You can only compare the fit indices  you can't test whether a model fits better in one group or another. 

Craig Sewall posted on Tuesday, February 25, 2020  12:12 pm



Hello, I am planning a 3wave study and will be analyzing the data with a RICLPM. I would like to run a power analysis before collecting data, however, I am unsure how to run the RICLPM using Montecarlo simulation. Any suggestions or resources on how to do this are greatly appreciated! 


You can find Mplus code for running the RICLPM (and several frequently asked for extensions) here: https://ellenhamaker.github.io/RICLPM/mplus.html#setup You can quite easily adjust this code for a Monte Carlo study (we don't have that code up thereyet). In some preliminary and unpublished simulations that we ran, we found that three waves of data can lead to considerable bias in the estimates of the lagged effects, although this also depends on the actual parameter values. My advice would be to opt for four waves of data, as this was much better in terms of reducing the bias (and increasing power). 

Craig Sewall posted on Wednesday, February 26, 2020  8:43 am



Thank you, Dr. Hamaker, for your quick and helpful response. I have attempted to run a Monte Carlo simulation using the code provided in the link you sent. However, I get an error message saying that the population covariance matrix is not positive definite. Here (and in the next post) is my code, can you identify where I am making an error? MONTECARLO: NAMES = x1x5 y1y5; NOBSERVATIONS = 300; NREPS = 100; MODEL POPULATION: ! Create two individual factors (random intercepts) RIx BY x1@1 x2@1 x3@1 x4@1 x5@1; RIy BY y1@1 y2@1 y3@1 y4@1 y5@1; ! Estimate means of random intercepts [RIx*0.5]; [RIy*0.4]; ! Estimate covariance between the RIs RIx WITH RIy*.3; ! Estimate variances for RIs RIx*.1 RIy*.1 

Craig Sewall posted on Wednesday, February 26, 2020  8:44 am



! Create withinperson centered variables wx1 BY x1@1; wx2 BY x2@1; wx3 BY x3@1; wx4 BY x4@1; wx5 BY x5@1; wy1 BY y1@1; wy2 BY y2@1; wy3 BY y3@1; wy4 BY y4@1; wy5 BY y5@1; x1y5@0; ! Estimate the lagged effects between ! the withinperson centered variables wy5 ON wy4*.8 wx4*.3; wx5 ON wx4*.8 wy4*.3; wy4 ON wy3*.8 wx3*.3; wx4 ON wx3*.8 wy3*.3; wy3 ON wy2*.8 wx2*.3; wx3 ON wx2*.8 wy2*.3; wy2 ON wy1*.8 wx1*.3; wx2 ON wx1*.8 wy1*.3; wx1 WITH wy1*.5; wx2 WITH wy2*.2; wx3 WITH wy3*.2; wx4 WITH wy4*.2; wx5 WITH wy5*.2; My MODEL section looks identical to the above. Thank you for your help! 


I think there are two problems with your code. First, you cannot set the covariance between the random intercepts to 0.3 when you set the variances of the random intercepts to 0.1; that combination would imply a correlation larger than 1. I suggest setting the variances to 1. Second, you have to specify the variances of the withinperson components at wave 1; and the residual variances of the withinperson components of all waves from wave 2 and onward. I suggest setting the variances at wave 1 to 1, and at later waves smaller (as part of the variances will be explained through the lagged relations). 

Craig Sewall posted on Wednesday, February 26, 2020  2:02 pm



This worked! Thanks again for all your help, Dr. Hamaker. I look forward to reading your future work with these kinds of models. 

KL posted on Saturday, February 29, 2020  4:57 pm



I am new to RICLPM and just have a few questions about the model specifications. In particular, I was wondering what 1) constraining observed means per variable over time and 2) fixing the correlation between the random intercepts and the withinperson centered variables at the first wave to zero means for the assumptions made by the model? Further, I was wondering how constraining the means and fixing the correlation to zero affect the interpretation of the results? 


Timeinvariant group means are attractive because in these models, the random intercepts can be interpreted as individualspecific stable deviations from a constant, rather than as individualspecific stable deviations from a timevarying group mean. When you visualize this, it implies the group mean is a horizontal line over time, and an individual's random intercept is characterized by a horizontal line above or below this line. As stated in Hamaker, Kuiper and Grasman (2015, p. 210): "Models in which the group means do not change over time facilitate interpretation, although timeinvariant means are no prerequisite for the models considered here." 


When the measurements start at an arbitrary point in time during an ongoing process, there is no reason to assume that the temporary deviations from the persons' trait scores (i.e., the withinperson components) at the first wave are related to these trait scores (i.e., the betweenperson components, or random intercepts). We need to fix the covariances to zero, as by default Mplus will allow the random intercepts and the withinperson components at the first wave to be correlated (since these are all exogenous latent variables). Note there are other models that are closely related, in which it is actually critical to include the covariances between the stable personcomponents and the temporary withinperson deviation at the first wave (e.g., the Autoregressive Latent Trajectory model by Bollen and Curran, or the Crosslagged Panel Models with Fixed Effects by Allison, Williams and MoralBenito). This critically depends on whether the stable personparts are separated from the withinperson dynamics (as is the case in the RICLPM), or that the stable betweenperson parts have indirect effects through the lagged relations in the model. You can read more about this in Usami, Kou and Hamaker (2019). A unified framework of longitudinal models to examine reciprocal relations. Psychological Methods, 24(5), 637657. http://dx.doi.org/10.1037/met0000210 

KL posted on Tuesday, March 03, 2020  6:01 pm



Hi Dr. Hamaker, Thanks so much for the very helpful responses! I ran several RICLPM analyses and have found that the chisquare test of model fit is not significant. In contrast, the chisquare test was significant when I just ran the CLPM analyses. I'm wondering if this means that the traditional CLPM is a better fit for the data (i.e., traitlike differences are not critical)? 


As with any SEM analysis, a significant chitest implies that the model fits significantly worse than the saturated model, whereas a nonsignificant test implies it does not fit significantly worse. In your case, it implies that the traditional CLPM does not provide an adequate description of the data (the model is rejected), whereas the RICLPM seems to describe the data well (that model is not rejected). You can also do a chisquare difference test, as these models are nested (see also the empirical illustration in Hamaker et al., 2015). 

KL posted on Wednesday, March 04, 2020  8:30 pm



Thank you so much for all your help, Dr. Hamaker! 

KL posted on Monday, March 09, 2020  1:35 pm



I have been referencing the RICLPM and Extensions resource posted here. I just have a quick question about adding timeinvariant covariates. I was wondering if the following code would work to regress my observed outcomes on two separate covariates in the same model. x1x3 ON z1 (s1); s1s3 ON z1 (s2); x1x3 ON z2 (s3); s1s3 ON z2 (s4); 


Hello, I ran the Hamaker model today, but came across several problems: 1. THE STANDARD ERRORS FOR H1 ESTIMATED SAMPLE STATISTICS COULD NOT BE COMPUTED. THIS MAY BE DUE TO LOW COVARIANCE COVERAGE. THE ROBUST CHISQUARE COULD NOT BE COMPUTED. 2. THE STANDARD ERRORS OF THE MODEL PARAMETER ESTIMATES MAY NOT BE TRUSTWORTHY FOR SOME PARAMETERS DUE TO A NONPOSITIVE DEFINITE FIRSTORDER DERIVATIVE PRODUCT MATRIX.....THIS IS MOST LIKELY DUE TO HAVING MORE PARAMETERS THAN THE SAMPLE SIZE. I expect these warnings to be a result of my small sample size (I have 15 time points and only 47 participants) as they disappear if I include only part of the time points (thereby having less parameters). I have several questions following this output: I. Is it correct to assume that problem 1 is also the result of having more parameters than the sample size ? II. If so, is it oké to ignore both warnings? If not, would it be a good solution to include only every second time point, so as to have the whole range, but less parameters? III. As the chisquare is not computed, I use AIC and BIC to compare model fit between different models (I try to make the model more parsimonious by constraining certain paths to be equal). Is this an appropriate solution? Thanks for your help! Kind regards, Aurelie Lange 


We need to see your full output  send to Support along with your license number. 


In RICLPM, is indirect effect (ab): cm2 on cx1 (a path) and cy3 on cm2 (b path)? MODEL: RI_x BY x1@1 x2@1 x3@1; RI_m BY m1@1 m2@1 m3@1; RI_y BY y1@1 y2@1 y3@1; cx1 BY x1@1; cx2 BY x2@1; cx3 BY x3@1; cm1 BY m1@1; cm2 BY m2@1; cm3 BY m3@1; cy1 BY y1@1; cy2 BY y2@1; cy3 BY y3@1; x1y3@0; cx2 ON cx1 cm1 cy1; cx3 ON cx2 cm2 cy2; cm2 ON cx1 cm1 cy1; cm3 ON cx2 cm2 cy2; cy2 ON cx1 cm1 cy1; cy3 ON cx2 cm2 cy2; cx1 WITH cm1 cy1; cm1 WITH cy1; cx2 WITH cm2 cy2; cx3 WITH cm3 cy3; cm2 WITH cy2; cm3 WITH cy3; RI_x WITH cx1@0 cm1@0 cy1@0; RI_m WITH cx1@0 cm1@0 cy1@0; RI_y WITH cx1@0 cm1@0 cy1@0; 


Longitudinal mediation is a complex topic. You want to read MaxwellCole (2007) in Psych Methods and same authors in a 2011 MBR special issue. More has been written more recently but I don't have those refs handy right now. 

Back to top 