Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using SEM for estimation of a RI-CLPM

    I am trying to estimate a random intercept cross lagged panel model (RI-CLPM), as recommended by Hamaker, Kuiper, and Grasman (2015). This model separates each person’s score on a variable at each wave into the group mean for that wave, an individual’s stable score over all waves (the random intercept) and then an individual level deviation at each wave from the score expected by adding the group-wave-mean and individual trait. In graphic form, the RI-CLPM model for a three-wave panel is:


    Using the notation of the graph, I estimated the following model (translated from Hamaker et al.'s code for MPlus for RI-CLPMs):

    sem (P2 Q2 <- P1 Q1)(P3 Q3 <- P2 Q2)(K -> x1@1 x2@1 x3@1)(W -> y1@1 y2@1 y3@1)(P1 -> x1@1)(P2 -> x2@1)(P3 -> x3@1)(Q1 -> y1@1)(Q2 -> y2@1)(Q3 -> y3@1), cov(K*W P1*Q1 e.P2*e.Q2 e.P3*e.Q3) covstruct(e.P2 e.Q2 e.P3 e.Q3 e.x1 e.x2 e.x3 e.y1 e.y2 e.y3, zero)

    Unfortunately, I get the following error message:

    model not identified;
    too many latent variables
    r(503);

    Can anyone spot what am I doing wrong here?


  • #2
    Sebastian Valenzuela , have you found a solution to this problem in Stata?
    Best wishes

    (Stata 16.1 MP)

    Comment


    • #3
      Felix Bittmann Thank you for asking. Unfortunately, I have not.

      Comment


      • #4
        If you could provide data including those variables, I could try it in Stata 17.

        Comment


        • #5
          Originally posted by Sebastian Valenzuela View Post
          . . .I get the following error message:

          model not identified;
          too many latent variables
          r(503);

          Can anyone spot what am I doing wrong here?
          You need to invoke the noivstart option in order to evade the preliminary checking that gives rise to that error message.

          Originally posted by Felix Bittmann View Post
          have you found a solution to this problem in Stata?
          Yeah, see below for the first worked example from the website of the authors cited by the OP. The authors' example has two more waves than what is shown in the diagram above. I'm not sure whether it would be needed for fewer waves, but with five tweaking the minimization algorithm was better for smooth convergence.

          The output is a little messy, because in the DO-file I intersperse the Stata code among the commented-out corresponding MPlus code that I copied and pasted from the author's website. And I've included the iteration log in order to show that there's no last-moment hiccup ("backed up" etc.).

          .ÿ
          .ÿversionÿ17.0

          .ÿ
          .ÿlogÿcloseÿ_all

          .ÿlogÿusingÿRI-CLPM.smcl,ÿname(lo)ÿnomsg

          .ÿ
          .ÿclearÿ*

          .ÿ
          .ÿ*ÿTITLE:ÿÿÿÿÿÿTheÿbasicÿRI-CLPM,ÿ5ÿwaves.ÿ
          .ÿÿÿÿ
          .ÿ/*ÿDATA:ÿÿÿÿÿÿÿFILEÿ=ÿRICLPM.dat;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
          >ÿVARIABLE:ÿÿÿNAMESÿ=ÿx1-x5ÿy1-y5;ÿ*/
          .ÿcopyÿ"https://raw.githubusercontent.com/JeroenDMulder/RI-CLPM/master/data/RICLPM.dat"ÿ///
          >ÿÿÿÿÿÿÿÿÿ`c(pwd)'/RICLPM.dat

          .ÿquietlyÿinfileÿx1ÿx2ÿx3ÿx4ÿx5ÿy1ÿy2ÿy3ÿy4ÿy5ÿusingÿRICLPM.dat

          .ÿÿÿÿÿ
          .ÿ//ÿANALYSIS:ÿÿÿMODELÿ=ÿNOCOV;ÿ!ÿSetsÿallÿdefaultÿcovariancesÿtoÿzero
          .ÿlocalÿOExÿ_OEx,ÿdiagonal

          .ÿ
          .ÿ/*ÿMODEL:ÿÿÿÿÿÿ!ÿCreateÿbetweenÿcomponentsÿ(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;ÿ*/
          .ÿlocalÿRIÿ(x1@1ÿx2@1ÿx3@1ÿx4@1ÿx5@1ÿ<-ÿRIx)ÿ(y1@1ÿy2@1ÿy3@1ÿy4@1ÿy5@1ÿ<-ÿRIy)

          .ÿ
          .ÿ/*ÿÿÿÿÿÿÿÿÿÿÿÿ!ÿCreateÿwithin-personÿ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;ÿ*/
          .ÿlocalÿPCVÿ///
          >ÿÿÿÿÿÿÿÿÿ(x1@1ÿ<-ÿWX1)ÿ(x2@1ÿ<-ÿWX2)ÿ(x3@1ÿ<-ÿWX3)ÿ(x4@1ÿ<-ÿWX4)ÿ(x5@1ÿ<-ÿWX5)ÿ///
          >ÿÿÿÿÿÿÿÿÿ(y1@1ÿ<-ÿWY1)ÿ(y2@1ÿ<-ÿWY2)ÿ(y3@1ÿ<-ÿWY3)ÿ(y4@1ÿ<-ÿWY4)ÿ(y5@1ÿ<-ÿWY5)

          .ÿ
          .ÿ/*ÿÿÿÿÿÿÿÿÿÿÿÿ!ÿConstrainÿtheÿmeasurementÿerrorÿvariancesÿtoÿzero
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿx1-y5@0;ÿ*/
          .ÿlocalÿOEnÿe._OEn,ÿzero

          .ÿ
          .ÿ/*ÿÿÿÿÿÿÿÿÿÿÿÿ!ÿEstimateÿtheÿlaggedÿeffectsÿbetweenÿ
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿ!ÿtheÿwithin-personÿcenteredÿvariables
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx2ÿwy2ÿONÿwx1ÿwy1;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx3ÿwy3ÿONÿwx2ÿwy2;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx4ÿwy4ÿONÿwx3ÿwy3;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx5ÿwy5ÿONÿwx4ÿwy4;ÿ*/
          .ÿlocalÿlagsÿ///
          >ÿÿÿÿÿÿÿÿÿ(WX2ÿWY2ÿ<-ÿWX1ÿWY1)ÿ///
          >ÿÿÿÿÿÿÿÿÿ(WX3ÿWY3ÿ<-ÿWX2ÿWY2)ÿ///
          >ÿÿÿÿÿÿÿÿÿ(WX4ÿWY4ÿ<-ÿWX3ÿWY3)ÿ///
          >ÿÿÿÿÿÿÿÿÿ(WX5ÿWY5ÿ<-ÿWX4ÿWY4)

          .ÿ
          .ÿ/*ÿÿÿÿÿÿÿÿÿÿÿÿ!ÿEstimateÿtheÿcovarianceÿbetweenÿtheÿrandomÿintercepts
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿRIxÿWITHÿRIy;
          >ÿ
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿ!ÿEstimateÿtheÿcovarianceÿbetweenÿtheÿwithin-person
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿ!ÿcomponentsÿatÿtheÿfirstÿwave
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx1ÿWITHÿwy1;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿ!ÿEstimateÿtheÿcovariancesÿbetweenÿtheÿresidualsÿof
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿ!ÿtheÿwithin-personÿcomponentsÿ(theÿinnovations)
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx2ÿWITHÿwy2;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx3ÿWITHÿwy3;ÿ
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx4ÿWITHÿwy4;
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿwx5ÿWITHÿwy5;ÿÿ*/
          .ÿlocalÿcovariancesÿ///
          >ÿÿÿÿÿÿÿÿÿRIx*RIyÿ///
          >ÿÿÿÿÿÿÿÿÿWX1*WY1ÿ///
          >ÿÿÿÿÿÿÿÿÿRIx*WX1@0ÿRIx*WY1@0ÿRIy*WX1@0ÿRIy*WY1@0ÿ///
          >ÿÿÿÿÿÿÿÿÿe.WX2*e.WY2ÿe.WX3*e.WY3ÿe.WX4*e.WY4ÿe.WX5*e.WY5

          .ÿ
          .ÿ/*ÿOUTPUT:ÿÿÿÿÿTECH1ÿSTDYXÿSAMPSTATÿCINTERVAL;ÿ*/
          .ÿ
          .ÿsemÿ`RI'ÿ`PCV'ÿ`lags',ÿ///
          >ÿÿÿÿÿÿÿÿÿcovariance(`covariances')ÿ///
          >ÿÿÿÿÿÿÿÿÿcovstructure(`OEx')ÿ///
          >ÿÿÿÿÿÿÿÿÿcovstructure(`OEn')ÿ///
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿnoivstartÿtechnique(nrÿbhhh)ÿ///
          >ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿnocnsreportÿnodescribe

          Fittingÿtargetÿmodel:
          (settingÿtechniqueÿtoÿnr)
          Iterationÿ0:ÿÿÿlogÿlikelihoodÿ=ÿ-10600.404ÿÿ(notÿconcave)
          Iterationÿ1:ÿÿÿlogÿlikelihoodÿ=ÿ-10417.783ÿÿ(notÿconcave)
          Iterationÿ2:ÿÿÿlogÿlikelihoodÿ=ÿ-8326.4757ÿÿ(notÿconcave)
          Iterationÿ3:ÿÿÿlogÿlikelihoodÿ=ÿ-6683.2317ÿÿ(notÿconcave)
          Iterationÿ4:ÿÿÿlogÿlikelihoodÿ=ÿ-5375.6071ÿÿ(notÿconcave)
          (switchingÿtechniqueÿtoÿbhhh)
          Iterationÿ5:ÿÿÿlogÿlikelihoodÿ=ÿ-4571.1733ÿÿ
          Iterationÿ6:ÿÿÿlogÿlikelihoodÿ=ÿ-2107.4338ÿÿ
          Iterationÿ7:ÿÿÿlogÿlikelihoodÿ=ÿ-558.36567ÿÿ
          Iterationÿ8:ÿÿÿlogÿlikelihoodÿ=ÿÿ201.67514ÿÿ
          Iterationÿ9:ÿÿÿlogÿlikelihoodÿ=ÿÿ450.94425ÿÿ
          (switchingÿtechniqueÿtoÿnr)
          Iterationÿ10:ÿÿlogÿlikelihoodÿ=ÿÿ523.28982ÿÿ
          Iterationÿ11:ÿÿlogÿlikelihoodÿ=ÿÿ531.68961ÿÿ
          Iterationÿ12:ÿÿlogÿlikelihoodÿ=ÿÿ531.74951ÿÿ
          Iterationÿ13:ÿÿlogÿlikelihoodÿ=ÿÿ531.74952ÿÿ

          StructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ1,189
          Estimationÿmethod:ÿml

          Logÿlikelihoodÿ=ÿ531.74952

          ---------------------------------------------------------------------------------
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿOIM
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿstd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
          ----------------+----------------------------------------------------------------
          Structuralÿÿÿÿÿÿ|
          ÿÿWX2ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX1ÿ|ÿÿÿ.2317878ÿÿÿ.0278778ÿÿÿÿÿ8.31ÿÿÿ0.000ÿÿÿÿÿ.1771484ÿÿÿÿ.2864272
          ÿÿÿÿÿÿÿÿÿÿÿÿWY1ÿ|ÿÿÿ.0086309ÿÿÿ.0262222ÿÿÿÿÿ0.33ÿÿÿ0.742ÿÿÿÿ-.0427636ÿÿÿÿ.0600254
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWX3ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX2ÿ|ÿÿÿ.2412658ÿÿÿ.0370647ÿÿÿÿÿ6.51ÿÿÿ0.000ÿÿÿÿÿ.1686204ÿÿÿÿ.3139112
          ÿÿÿÿÿÿÿÿÿÿÿÿWY2ÿ|ÿÿÿ.0259777ÿÿÿ.0240171ÿÿÿÿÿ1.08ÿÿÿ0.279ÿÿÿÿ-.0210949ÿÿÿÿ.0730504
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWX4ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX3ÿ|ÿÿÿ.2791723ÿÿÿ.0384188ÿÿÿÿÿ7.27ÿÿÿ0.000ÿÿÿÿÿ.2038728ÿÿÿÿ.3544718
          ÿÿÿÿÿÿÿÿÿÿÿÿWY3ÿ|ÿÿÿ.0098477ÿÿÿ.0228255ÿÿÿÿÿ0.43ÿÿÿ0.666ÿÿÿÿ-.0348894ÿÿÿÿ.0545848
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWX5ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX4ÿ|ÿÿÿ.2898962ÿÿÿÿ.035165ÿÿÿÿÿ8.24ÿÿÿ0.000ÿÿÿÿÿ.2209741ÿÿÿÿ.3588184
          ÿÿÿÿÿÿÿÿÿÿÿÿWY4ÿ|ÿÿ-.0040376ÿÿÿ.0216522ÿÿÿÿ-0.19ÿÿÿ0.852ÿÿÿÿ-.0464752ÿÿÿÿÿÿÿ.0384
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWY2ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX1ÿ|ÿÿÿ.1737383ÿÿÿ.0446839ÿÿÿÿÿ3.89ÿÿÿ0.000ÿÿÿÿÿ.0861594ÿÿÿÿ.2613172
          ÿÿÿÿÿÿÿÿÿÿÿÿWY1ÿ|ÿÿÿ.0042467ÿÿÿ.0461541ÿÿÿÿÿ0.09ÿÿÿ0.927ÿÿÿÿ-.0862137ÿÿÿÿ.0947071
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWY3ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX2ÿ|ÿÿÿÿ.155606ÿÿÿ.0541933ÿÿÿÿÿ2.87ÿÿÿ0.004ÿÿÿÿÿ.0493891ÿÿÿÿ.2618228
          ÿÿÿÿÿÿÿÿÿÿÿÿWY2ÿ|ÿÿÿ.2619457ÿÿÿ.0388214ÿÿÿÿÿ6.75ÿÿÿ0.000ÿÿÿÿÿ.1858572ÿÿÿÿ.3380342
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWY4ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX3ÿ|ÿÿÿÿ.184983ÿÿÿ.0549375ÿÿÿÿÿ3.37ÿÿÿ0.001ÿÿÿÿÿ.0773075ÿÿÿÿ.2926584
          ÿÿÿÿÿÿÿÿÿÿÿÿWY3ÿ|ÿÿÿ.2956153ÿÿÿ.0353514ÿÿÿÿÿ8.36ÿÿÿ0.000ÿÿÿÿÿ.2263278ÿÿÿÿ.3649029
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿWY5ÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX4ÿ|ÿÿÿ.1242443ÿÿÿ.0475579ÿÿÿÿÿ2.61ÿÿÿ0.009ÿÿÿÿÿ.0310326ÿÿÿÿÿ.217456
          ÿÿÿÿÿÿÿÿÿÿÿÿWY4ÿ|ÿÿÿ.3920701ÿÿÿ.0310086ÿÿÿÿ12.64ÿÿÿ0.000ÿÿÿÿÿ.3312945ÿÿÿÿ.4528458
          ----------------+----------------------------------------------------------------
          Measurementÿÿÿÿÿ|
          ÿÿx1ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿRIxÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿWX1ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.2408626ÿÿÿÿÿ.00715ÿÿÿÿ33.69ÿÿÿ0.000ÿÿÿÿÿ.2268489ÿÿÿÿ.2548763
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿx2ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX2ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIxÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1730133ÿÿÿ.0058987ÿÿÿÿ29.33ÿÿÿ0.000ÿÿÿÿÿ.1614521ÿÿÿÿ.1845745
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿx3ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX3ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIxÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1859763ÿÿÿ.0058768ÿÿÿÿ31.65ÿÿÿ0.000ÿÿÿÿÿÿ.174458ÿÿÿÿ.1974945
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿx4ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX4ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIxÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1167706ÿÿÿ.0060542ÿÿÿÿ19.29ÿÿÿ0.000ÿÿÿÿÿ.1049046ÿÿÿÿ.1286366
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿx5ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWX5ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIxÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1105762ÿÿÿ.0060007ÿÿÿÿ18.43ÿÿÿ0.000ÿÿÿÿÿÿ.098815ÿÿÿÿ.1223374
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿy1ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿRIyÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿWY1ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3362376ÿÿÿ.0090632ÿÿÿÿ37.10ÿÿÿ0.000ÿÿÿÿÿÿ.318474ÿÿÿÿ.3540011
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿy2ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWY2ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIyÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3484393ÿÿÿ.0092458ÿÿÿÿ37.69ÿÿÿ0.000ÿÿÿÿÿ.3303178ÿÿÿÿ.3665608
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿy3ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWY3ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIyÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3190852ÿÿÿ.0096406ÿÿÿÿ33.10ÿÿÿ0.000ÿÿÿÿÿÿÿ.30019ÿÿÿÿ.3379804
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿy4ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWY4ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIyÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3842175ÿÿÿ.0098273ÿÿÿÿ39.10ÿÿÿ0.000ÿÿÿÿÿ.3649563ÿÿÿÿ.4034787
          ÿÿ--------------+----------------------------------------------------------------
          ÿÿy5ÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿWY5ÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿÿÿRIyÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
          ÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.3877367ÿÿÿ.0096799ÿÿÿÿ40.06ÿÿÿ0.000ÿÿÿÿÿ.3687644ÿÿÿÿÿ.406709
          ----------------+----------------------------------------------------------------
          ÿÿÿÿÿÿÿvar(e.x1)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.x2)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.x3)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.x4)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.x5)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.y1)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.y2)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.y3)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.y4)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿÿvar(e.y5)|ÿÿÿÿÿÿÿÿÿÿ0ÿÿ(constrained)
          ÿÿÿÿÿÿvar(e.WX2)|ÿÿÿ.0292552ÿÿÿÿ.001407ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0266236ÿÿÿÿÿ.032147
          ÿÿÿÿÿÿvar(e.WX3)|ÿÿÿÿ.029753ÿÿÿ.0014537ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.027036ÿÿÿÿ.0327431
          ÿÿÿÿÿÿvar(e.WX4)|ÿÿÿ.0317536ÿÿÿ.0014807ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0289802ÿÿÿÿ.0347925
          ÿÿÿÿÿÿvar(e.WX5)|ÿÿÿ.0307097ÿÿÿ.0014165ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0280552ÿÿÿÿ.0336153
          ÿÿÿÿÿÿvar(e.WY2)|ÿÿÿ.0683993ÿÿÿÿ.003908ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0611531ÿÿÿÿ.0765041
          ÿÿÿÿÿÿvar(e.WY3)|ÿÿÿ.0723824ÿÿÿ.0033945ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.066026ÿÿÿÿ.0793508
          ÿÿÿÿÿÿvar(e.WY4)|ÿÿÿ.0735421ÿÿÿ.0033617ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0672398ÿÿÿÿ.0804352
          ÿÿÿÿÿÿvar(e.WY5)|ÿÿÿ.0648296ÿÿÿ.0028882ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0594088ÿÿÿÿ.0707449
          ÿÿÿÿÿÿÿÿvar(RIx)|ÿÿÿ.0092574ÿÿÿ.0010614ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0073943ÿÿÿÿÿÿ.01159
          ÿÿÿÿÿÿÿÿvar(RIy)|ÿÿÿ.0316548ÿÿÿ.0025628ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.02701ÿÿÿÿ.0370983
          ÿÿÿÿÿÿÿÿvar(WX1)|ÿÿÿ.0515269ÿÿÿ.0024459ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0469494ÿÿÿÿ.0565508
          ÿÿÿÿÿÿÿÿvar(WY1)|ÿÿÿ.0660118ÿÿÿ.0036703ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0591962ÿÿÿÿ.0736122
          ----------------+----------------------------------------------------------------
          cov(e.WX2,e.WY2)|ÿÿÿÿ.008785ÿÿÿ.0016999ÿÿÿÿÿ5.17ÿÿÿ0.000ÿÿÿÿÿ.0054533ÿÿÿÿ.0121167
          cov(e.WX3,e.WY3)|ÿÿÿ.0127028ÿÿÿ.0016208ÿÿÿÿÿ7.84ÿÿÿ0.000ÿÿÿÿÿ.0095261ÿÿÿÿ.0158795
          cov(e.WX4,e.WY4)|ÿÿÿ.0133838ÿÿÿ.0016367ÿÿÿÿÿ8.18ÿÿÿ0.000ÿÿÿÿÿ.0101759ÿÿÿÿ.0165917
          cov(e.WX5,e.WY5)|ÿÿÿ.0071168ÿÿÿ.0014477ÿÿÿÿÿ4.92ÿÿÿ0.000ÿÿÿÿÿ.0042794ÿÿÿÿ.0099543
          ÿÿÿÿcov(RIx,RIy)|ÿÿÿÿ.010049ÿÿÿ.0012573ÿÿÿÿÿ7.99ÿÿÿ0.000ÿÿÿÿÿ.0075847ÿÿÿÿ.0125133
          ÿÿÿÿcov(WX1,WY1)|ÿÿÿ.0212337ÿÿÿ.0022657ÿÿÿÿÿ9.37ÿÿÿ0.000ÿÿÿÿÿÿ.016793ÿÿÿÿ.0256744
          ---------------------------------------------------------------------------------
          LRÿtestÿofÿmodelÿvs.ÿsaturated:ÿchi2(21)ÿ=ÿ25.81ÿÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.2140

          .ÿ
          .ÿquietlyÿlogÿcloseÿlo

          .ÿ
          .ÿexit

          endÿofÿdo-file


          .


          The fitted results are essentially (within rounding) identical between the two software products. In case you care to examine them more closely, I've attached the DO-file, Stata log file and MPlus output file to this post (the latter I've had to rename the file suffixe to .txt in order for the forum's software to accept it as an attachment).
          Attached Files

          Comment


          • #6
            Dear Joseph, many thanks for this example! While it is too late for my own project I believe there will be a growing interest in the RI-CLPM in general. To show that Stata can do it is a great achievement since I have not seen any example until now. Potentially, this could even be a contribution to the Stata Journal.
            Best wishes

            (Stata 16.1 MP)

            Comment


            • #7
              Originally posted by Felix Bittmann View Post
              . . .many thanks for this example! While it is too late for my own project I believe there will be a growing interest in the RI-CLPM in general.
              I hadn't noticed that the thread was begun a year ago nearly to the day. I don't recall seeing it last year, and we have John Transue to thank for reviving the thread.

              Comment


              • #8
                Originally posted by Joseph Coveney View Post
                The fitted results are essentially (within rounding) identical between the two software products. In case you care to examine them more closely, I've attached the DO-file, Stata log file and MPlus output file to this post (the latter I've had to rename the file suffixe to .txt in order for the forum's software to accept it as an attachment).
                This is awesome, Joseph Coveney! So glad you found the way to estimate RI-CLPMs in Stata. Thank you!

                Comment


                • #9
                  Thank you so very much for this helpful thread and code! I am currently adapting it for my own project! I was wondering, Joseph Coveney, whether you had any insight on how to use full-maximum likelihood [method (mlmv)] in STATA with this code?

                  Comment


                  • #10
                    In Joeseph's RI-CLPM.do file where he runs the model, lines 80-85, simply add the following to line 85 (text in red):
                    Code:
                    sem `RI' `PCV' `lags', ///
                        covariance(`covariances') ///
                        covstructure(`OEx') ///
                        covstructure(`OEn') ///
                            noivstart technique(nr bhhh) ///
                            method(mlmv) nocnsreport nodescribe

                    Comment


                    • #11
                      I have a question on how to add time-constant control variables to such a model (e.g. IQ score of a person). I have attempted to adapt the code like so (where IQ is a manifest variable):

                      Code:
                      local lags ///
                          (WX2 WY2 <- WX1 WY1) ///
                          (WX3 WY3 <- WX2 WY2) ///
                          (WX4 WY4 <- WX3 WY3) ///
                          (WX5 WY5 <- WX4 WY4) ///
                          (WX1 WY1 WX2 WY2 WX3 WY3 WX4 WY4 WX5 WY5 <- iqscore)
                      However, this adaption makes both WX1 and WY1 dependent variables, which requires also an adaption of this part:

                      Code:
                      local covariances ///
                          RIx*RIy ///
                          WX1*WY1 ///
                          RIx*WX1@0 RIx*WY1@0 RIy*WX1@0 RIy*WY1@0 ///
                          e.WX2*e.WY2 e.WX3*e.WY3 e.WX4*e.WY4 e.WX5*e.WY5
                      I am not really sure how to proceed here. Maybe Joseph Coveney has a solution to this issue, many thanks!
                      Best wishes

                      (Stata 16.1 MP)

                      Comment


                      • #12
                        Originally posted by Felix Bittmann View Post
                        I am not really sure how to proceed here.
                        I don’t work with this model and so don’t have anything to suggest based upon experience, but if you’re having trouble with a MIMIC-like approach (mimic-like?), then maybe consider pointing the IQ score predictor directly to the manifest endogenous (indicator) variables, bypassing the latent factors altogether.

                        Inasmuch as the covariate is time-invariant, you could impose equality constraints on all, or subsets of, its regression coefficients when that facilitates interpretation or aids in convergence.

                        Comment


                        • #13
                          I agree with Joseph Coveney. Although the main point of these models is to focus on within-group cross-lagged relations, introducing between-group predictors/outcomes is possible. See Extension 1 here for Mplus and lavaan (R) code but not sem (Stata), unfortunately.

                          Comment

                          Working...
                          X