Announcement

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

  • sem piecewise latent growth model code checking accuracy and improving efficiency

    Hello all,

    I want to run the below sem code. I don't want to wait hours for it to run and then tell me that it failed. Does any of you with more experience see any problems with the code that will make it fail? Does anyone have any suggestions for changes to the code that will make the processing more efficient?

    I am essentially repeating the same code for 15 time points. Five latent variables (fitness, enjoyment, competence, appearance, social) predicting observed variables (all the m_#_# variables), and then 8 latent variables (Intercept, Slope beginning at cycle 0, Slope beginning at cycle 6, fitness, enjoyment, competence, appearance, and social) predicting the outcome (avpawk).

    Thank you for your time,

    Code:
    sem (Fitness0 -> m_1_0 m_13_0 m_16_0 m_19_0 m_23_0) ///
        (Enjoyment0 -> m_11_0 m_2_0 m_22_0 m_7_0) ///
        (Competence0 -> m_14_0 m_3_0 m_9_0) ///
        (Appearance0 -> m_10_0 m_17_0 m_20_0 m_24_0 m_27_0 m_5_0) ///
        (Social0 -> m_15_0 m_21_0 m_30_0 m_6_0) ///
        (Intercept@1 Slope@0 Slope1@0 Fitness0 Enjoyment0 Competence0 ///
        Appearance0 Social0 -> avpawk0) ///
        (Fitness1 -> m_1_1 m_13_1 m_16_1 m_19_1 m_23_1) ///
        (Enjoyment1 -> m_11_1 m_2_1 m_22_1 m_7_1) ///
        (Competence1 -> m_14_1 m_3_1 m_9_1) ///
        (Appearance1 -> m_10_1 m_17_1 m_20_1 m_24_1 m_27_1 m_5_1) ///
        (Social1 -> m_15_1 m_21_1 m_30_1 m_6_1) ///
        (Intercept@1 Slope@1 Slope1@0 Fitness1 Enjoyment1 Competence1 ///
        Appearance1 Social1 -> avpawk1) ///
        (Fitness2 -> m_1_2 m_13_2 m_16_2 m_19_2 m_23_2) ///
        (Enjoyment2 -> m_11_2 m_2_2 m_22_2 m_7_2) ///
        (Competence2 -> m_14_2 m_3_2 m_9_2) ///
        (Appearance2 -> m_10_2 m_17_2 m_20_2 m_24_2 m_27_2 m_5_2) ///
        (Social2 -> m_15_2 m_21_2 m_30_2 m_6_2) ///
        (Intercept@1 Slope@2 Slope1@0 Fitness2 Enjoyment2 Competence2 ///
        Appearance2 Social2 -> avpawk2) ///
        (Fitness3 -> m_1_3 m_13_3 m_16_3 m_19_3 m_23_3) ///
        (Enjoyment3 -> m_11_3 m_2_3 m_22_3 m_7_3) ///
        (Competence3 -> m_14_3 m_3_3 m_9_3) ///
        (Appearance3 -> m_10_3 m_17_3 m_20_3 m_24_3 m_27_3 m_5_3) ///
        (Social3 -> m_15_3 m_21_3 m_30_3 m_6_3) ///
        (Intercept@1 Slope@3 Slope1@0 Fitness3 Enjoyment3 Competence3 ///
        Appearance3 Social3 -> avpawk3) ///
        (Fitness4 -> m_1_4 m_13_4 m_16_4 m_19_4 m_23_4) ///
        (Enjoyment4 -> m_11_4 m_2_4 m_22_4 m_7_4) ///
        (Competence4 -> m_14_4 m_3_4 m_9_4) ///
        (Appearance4 -> m_10_4 m_17_4 m_20_4 m_24_4 m_27_4 m_5_4) ///
        (Social4 -> m_15_4 m_21_4 m_30_4 m_6_4) ///
        (Intercept@1 Slope@4 Slope1@0 Fitness4 Enjoyment4 Competence4 ///
        Appearance4 Social4 -> avpawk4) ///
        (Fitness5 -> m_1_5 m_13_5 m_16_5 m_19_5 m_23_5) ///
        (Enjoyment5 -> m_11_5 m_2_5 m_22_5 m_7_5) ///
        (Competence5 -> m_14_5 m_3_5 m_9_5) ///
        (Appearance5 -> m_10_5 m_17_5 m_20_5 m_24_5 m_27_5 m_5_5) ///
        (Social5 -> m_15_5 m_21_5 m_30_5 m_6_5) ///
        (Intercept@1 Slope@5 Slope1@0 Fitness5 Enjoyment5 Competence5 ///
        Appearance5 Social5 -> avpawk5) ///
        (Fitness6 -> m_1_6 m_13_6 m_16_6 m_19_6 m_23_6) ///
        (Enjoyment6 -> m_11_6 m_2_6 m_22_6 m_7_6) ///
        (Competence6 -> m_14_6 m_3_6 m_9_6) ///
        (Appearance6 -> m_10_6 m_17_6 m_20_6 m_24_6 m_27_6 m_5_6) ///
        (Social6 -> m_15_6 m_21_6 m_30_6 m_6_6) ///
        (Intercept@1 Slope@6 Slope1@0 Fitness6 Enjoyment6 Competence6 ///
        Appearance6 Social6 -> avpawk6) ///
        (Fitness7 -> m_1_7 m_13_7 m_16_7 m_19_7 m_23_7) ///
        (Enjoyment7 -> m_11_7 m_2_7 m_22_7 m_7_7) ///
        (Competence7 -> m_14_7 m_3_7 m_9_7) ///
        (Appearance7 -> m_10_7 m_17_7 m_20_7 m_24_7 m_27_7 m_5_7) ///
        (Social7 -> m_15_7 m_21_7 m_30_7 m_6_7) ///
        (Intercept@1 Slope@6 Slope1@1 Fitness7 Enjoyment7 Competence7 ///
        Appearance7 Social7 -> avpawk7) ///
        (Fitness8 -> m_1_8 m_13_8 m_16_8 m_19_8 m_23_8) ///
        (Enjoyment8 -> m_11_8 m_2_8 m_22_8 m_7_8) ///
        (Competence8 -> m_14_8 m_3_8 m_9_8) ///
        (Appearance8 -> m_10_8 m_17_8 m_20_8 m_24_8 m_27_8 m_5_8) ///
        (Social8 -> m_15_8 m_21_8 m_30_8 m_6_8) ///
        (Intercept@1 Slope@6 Slope1@2 Fitness8 Enjoyment8 Competence8 ///
        Appearance8 Social8 -> avpawk8) ///
        (Fitness9 -> m_1_9 m_13_9 m_16_9 m_19_9 m_23_9) ///
        (Enjoyment9 -> m_11_9 m_2_9 m_22_9 m_7_9) ///
        (Competence9 -> m_14_9 m_3_9 m_9_9) ///
        (Appearance9 -> m_10_9 m_17_9 m_20_9 m_24_9 m_27_9 m_5_9) ///
        (Social9 -> m_15_9 m_21_9 m_30_9 m_6_9) ///
        (Intercept@1 Slope@6 Slope1@3 Fitness9 Enjoyment9 Competence9 ///
        Appearance9 Social9 -> avpawk9) ///
        (Fitness10 -> m_1_10 m_13_10 m_16_10 m_19_10 m_23_10) ///
        (Enjoyment10 -> m_11_10 m_2_10 m_22_10 m_7_10) ///
        (Competence10 -> m_14_10 m_3_10 m_9_10) ///
        (Appearance10 -> m_10_10 m_17_10 m_20_10 m_24_10 m_27_10 m_5_10) ///
        (Social10 -> m_15_10 m_21_10 m_30_10 m_6_10) ///
        (Intercept@1 Slope@6 Slope1@4 Fitness10 Enjoyment10 Competence10 ///
        Appearance10 Social10 -> avpawk10) ///
        (Fitness11 -> m_1_11 m_13_11 m_16_11 m_19_11 m_23_11) ///
        (Enjoyment11 -> m_11_11 m_2_11 m_22_11 m_7_11) ///
        (Competence11 -> m_14_11 m_3_11 m_9_11) ///
        (Appearance11 -> m_10_11 m_17_11 m_20_11 m_24_11 m_27_11 m_5_11) ///
        (Social11 -> m_15_11 m_21_11 m_30_11 m_6_11) ///
        (Intercept@1 Slope@6 Slope1@5 Fitness11 Enjoyment11 Competence11 ///
        Appearance11 Social11 -> avpawk11) ///
        (Fitness12 -> m_1_12 m_13_12 m_16_12 m_19_12 m_23_12) ///
        (Enjoyment12 -> m_11_12 m_2_12 m_22_12 m_7_12) ///
        (Competence12 -> m_14_12 m_3_12 m_9_12) ///
        (Appearance12 -> m_10_12 m_17_12 m_20_12 m_24_12 m_27_12 m_5_12) ///
        (Social12 -> m_15_12 m_21_12 m_30_12 m_6_12) ///
        (Intercept@1 Slope@6 Slope1@6 Fitness12 Enjoyment12 Competence12 ///
        Appearance12 Social12 -> avpawk12) ///
        (Fitness13 -> m_1_13 m_13_13 m_16_13 m_19_13 m_23_13) ///
        (Enjoyment13 -> m_11_13 m_2_13 m_22_13 m_7_13) ///
        (Competence13 -> m_14_13 m_3_13 m_9_13) ///
        (Appearance13 -> m_10_13 m_17_13 m_20_13 m_24_13 m_27_13 m_5_13) ///
        (Social13 -> m_15_13 m_21_13 m_30_13 m_6_13) ///
        (Intercept@1 Slope@6 Slope1@7 Fitness13 Enjoyment13 Competence13 ///
        Appearance13 Social13 -> avpawk13) ///
        (Fitness14 -> m_1_14 m_13_14 m_16_14 m_19_14 m_23_14) ///
        (Enjoyment14 -> m_11_14 m_2_14 m_22_14 m_7_14) ///
        (Competence14 -> m_14_14 m_3_14 m_9_14) ///
        (Appearance14 -> m_10_14 m_17_14 m_20_14 m_24_14 m_27_14 m_5_14) ///
        (Social14 -> m_15_14 m_21_14 m_30_14 m_6_14) ///
        (Intercept@1 Slope@6 Slope1@8 Fitness14 Enjoyment14 Competence14 ///
        Appearance14 Social14 -> avpawk14), ///
        method(mlmv) noconstant means(Intercept Slope Slope1)

  • #2
    Quick update. I ran the code and it gave the following error
    Code:
    Fitting saturated model:
    
    initial values not feasible
    r(1400);
    
    end of do-file
    
    r(1400);
    Stata explain the 1400 error as something too large for stata to deal with.

    [P] error . . . . . . . . . . . . . . . . . . . . . . . . Return code 1400
    numerical overflow;
    You have attempted something that, in the midst of the
    necessary calculations, has resulted in something too large
    for Stata to deal with accurately. Most commonly, this is
    an attempt to estimate a model (say with regress) with more
    than 2,147,483,647 effective observations. This effective
    number could be reached with far fewer observations if you
    were running a frequency-weighted model.
    Is there anything that I can do to make my code work?

    Thank you
    ​​​​​​​Patrick

    Comment


    • #3
      You didn't inform the sample size. I fear such a model would pose problems under small samples.

      That said, generally speaking, I feel there are too many variables (observed and latent) which prompt to a huge output. Indeed, perhaps a mind-boggling one.

      I also suggest to start with "pieces" of the full model. Meanwhile, you could check (and curb) convergence issues separately.

      Not to neglect, if you consider it reasonable, parcelling may be helpful as well. For at least a couple of reasons: increase speed of iterations and simplify the output.

      In short, maybe the Latin sentence "divide and conquer" would "fit" (sorry for the pun) nicely here.

      Hopefully that helps.
      Best regards,

      Marcos

      Comment


      • #4
        Hello Marcos,

        I have 937 participants. Would that be considered small for the analysis that I am attempting?

        As far as I know, parceling would impose an equivalent weight of each variable used in the sum or mean of the factor it represents. I will think a little more about this suggestion and discuss it with my colleagues.

        Would using a more powerful computer to conduct the analysis make a difference?

        Is another software such as Mplus, better equipped to handle this analysis?

        Thank you for your time,
        Patrick

        Comment


        • #5
          Some of your questions are far from my expertise. For example, I have no experience with Mplus and other softwares concerning SEM. I have just used Stata for this. And I'm quite satisfied with the results. So far so good.

          This is also far from my expertise (for I use "standard computers"), but I doubt the issue is related to chip speed.

          You may wish to search in the Web about the main reasons for failure of convergence.

          Hopefully you will get further advice for other members as well.

          I still think you have too many variables to reach a comprehensive model, and need to check the steps remarked in #3.
          Best regards,

          Marcos

          Comment

          Working...
          X