This is an R code to compute cross-lagged effects, adjusting for stability and cross-sectional correlation at the first measurement wave, and to compute the corresponding sampling variances.
The computations in this R code are based on the formulation presented in Becker (1992, 2009).
A previous version of this code, together with an explanation of its use, can be found here: Maes, M., Nelemans, S.A., Danneel, S., Fernandez-Castilla, B., Van den Noortgate, W., Goossens, L., & Vanhalst, J. (2019). Loneliness and social anxiety across childhood and adolescence: Multilevel meta-analyses of cross-sectional and longitudinal associations. Developmental Psychology, 55, 1548-1565. [doi:10.1037/dev0000719][1]
This updated version provides the same outcomes, but added a step to construct the matrix of correlations that is needed as input.
[1]: https://pubmed.ncbi.nlm.nih.gov/30896228/