Announcement

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

  • #16
    Thanks Richard.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #17
      Originally posted by Richard Williams View Post

      No. However you can have xtdpdml generate a file that has the Stata code. For that matter it can create code for mPlus and for R's lavaan too. You could then hand-tweak it. It probably wouldn't be easy, but it would probably be easier than trying to write all the code from scratch.
      Yes, I agree. Thanks for your answer, Richard.

      Comment


      • #18
        Hello

        I am currently trying to estimate a dynamic panel model but I get the error
        Code:
        initial values not feasible
        r(1400);
        .I have tried to balance the panel and work with the altstart option. I also checked that no time period is missing and they are correctly specified.

        My panel covers 8
        periods for N= 25

        What could be the reason of the error message?


        Thanks in advance
        Last edited by Luis Menendez; 23 Jun 2019, 11:07.

        Comment


        • #19
          What was the command given?
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          Stata Version: 17.0 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #20
            On page 8 of the Willams et al (2018) preprint of “Dynamic Panel Data Modeling using Maximum Likelihood”, error terms for Y variables (υi)are specified as equal for all waves except the last (i.e. E2@1 E3@1 etc are specified, but there is no specification of E7). Specifying errorinv would in principal make all error terms equal, but it is noted that this would cause convergence problems (I get a “not allowed” when I try in my analyses, using mlmv). I tried including an error term for the final Y in SEM “by hand” (in a model I am working with) and got the message “model not identified, too many latent variables”. I wonder if this suggest that way error terms are specified by default though xtdpdml may not be as much a convergence issue (as noted on page 12 with regard to the errorinv constraint), but an identification issue? If a final error term (specified in the figure on page 6, but not clear in the SEM code generated) is actually not in the standard model, is the last error term absorbed into the final alpha? Is so, would freeing final alpha make sense? (freeing all alphas leads to convergence issues in what I am trying to do in my own analyses…)

            Williams, Richard, Paul D Allison and Enrique Moral-Benito. 2018. "Linear Dynamic Panel-Data Estimation Using Maximum Likelihood and Structural Equation Modeling." The Stata Journal18(2):293-326.

            Finally, thank you so much for xtdpdml!

            Comment


            • #21
              BTW -- with regard to Luis Menendez post of today, I get the same when I specify age as a a time varying variable in a model with individual level panel data. I assume this is because age is isomorphic with the temporal structure of the data, so I dropped age as a time varying variable from my analyses.

              Comment


              • #22
                Originally posted by Richard Williams View Post
                What was the command given?
                My command was

                Code:
                xtdpdml lgdpc , pre(`exog') fiml
                `exog' contains 6 control variables thought to be predetermined. As I thought I might be adding to much variables I limited them but the error message keeps appearing even if I only include one control variable.

                Thanks for the answer

                Comment


                • #23
                  Luis Menendez -- N = 25 is pretty small, T = 8 is relatively large, and the fact that you are using fiml means you are trying to deal with missing data and that doesn't make things any easier either. xtdpdml just may not be well suited for your purposes.

                  Before giving up, though, check the section in the help file about convergence problems and try some of the other options. Adding the -difficult- option occasionally does wonders. The -std- option sometimes helps a lot too.

                  If you have mPlus or else R and its lavaan program (both free but with a learning curve attached) you can have xtdpdml output the necessary code and try them. My guess is they won't be happy either but the error messages may be more helpful.

                  The xtdpdml support page is at https://www3.nd.edu/~rwilliam/dynamic/index.html.

                  Again, I am not optimistic xtdpdml will work well for you given the nature of your data, but try a few more things first.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

                  EMAIL: [email protected]
                  WWW: https://www3.nd.edu/~rwilliam

                  Comment


                  • #24
                    Bill Magee -- the klutzy way xtdpdml has to handle the error terms is a source of irritation for us. mPlus and R's lavaan are more straightforward for handling this. Further, given that we have to zero out and replace some error terms I wish we could just zero out and replace all of them. But if we do that, we get (erroneous) messages about identification, perhaps the same one you got. If it looks like some of the programming choices are a little weird, it may be because we tried another way that we thought should be equivalent but more straightforward but that way didn't work.

                    In any event, all the Y's do have error terms -- either the Es that xtdpdml creates or the ones that are in there by default. As we note, errorinv often tends to not work. I suppose you could try something like alphafree and see what happens but I wouldn't be optimistic.

                    I also don't think it is bad to not use errorinv. It makes the model less restrictive and if they really are about the same the estimates should show that.

                    You could also try the suggestions I gave to Luis about dealing with convergence problems. mPlus is generally far faster than Stata (or any other program I am aware of). You may still get errors but at least you get them more quickly.

                    As far as age goes, you probably want to use age at time 1 and treat it as time invariant. If you treat it as time-varying and collect data annually, then age2 = age1 + 1, age3 = age1 + 2, etc. In other words all the age variables will be perfectly correlated with each other.

                    Hopefully these comments are helpful. If you post more code and output I may be able to further advise -- but often I need the data and code to figure out what is really going on.
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

                    EMAIL: [email protected]
                    WWW: https://www3.nd.edu/~rwilliam

                    Comment


                    • #25
                      Bill Magee -- try this code:

                      Code:
                      use https://www3.nd.edu/~rwilliam/statafiles/wages, clear
                      xtdpdml wks L.lwage, inv(ed) pre(L.union) ti(Baseline Model) show
                      xtdpdml wks L.lwage, inv(ed) pre(L.union) ti(Baseline Model) show errorinv
                      The latter includes this bit of generated code:

                      Code:
                      var(E2@v1 E3@v1 E4@v1 E5@v1 E6@v1 e.wks7@v1)
                      This constrains the variance of the E terms xtdpdml creates for the first 5 Ys to be equal to the error variance of the last Y variable.

                      Again, if I ruled the world, these E terms would not be necessary, just like they are not necessary in mPlus. Or, given that they are necessary, I would replace e.wks7 with E7. But, the last time I tried to do this I got an (erroneous) identification error. I suspect Stata has some rules built in to just automatically say some code is problematic without actually checking to see if it works.

                      Incidentally, mPlus doesn't require all these gymnastics with the Y error terms:

                      Code:
                            ! Correlations between Ys and predetermined variables
                           union3 with
                                wks2;
                           union4 with
                                wks2 wks3;
                           union5 with
                                wks2 wks3 wks4;
                           union6 with
                                wks2 wks3 wks4 wks5;
                           ! Error variances constrained to be equal across waves
                           wks2 (5)
                           wks3 (5)
                           wks4 (5)
                           wks5 (5)
                           wks6 (5)
                           wks7 (5)
                           ;
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      Stata Version: 17.0 MP (2 processor)

                      EMAIL: [email protected]
                      WWW: https://www3.nd.edu/~rwilliam

                      Comment


                      • #26
                        I have tried the xtdpdml command with the code below
                        xtdpdml bind crcomind fenex feric femex femric fexric fbric inrel rsanc cbmeet banksize flev totd dveq, predetermined(trisk) tfix errorinv fiml

                        however, the command returns the below error
                        initial values not feasible

                        what went wrong and how can I correct it.

                        Comment


                        • #27
                          Without knowing more about the data it is hard to say. What are N and T? The program works best with large N small T.

                          The problem looks pretty big. You have several variables and are using FIML, which can be quite demanding. Simplify the model and gradually add variables to it. This may help you identify a variable that is giving you grief. If even the simplest model bombs then there may be a problem with your data or the model.
                          -------------------------------------------
                          Richard Williams, Notre Dame Dept of Sociology
                          Stata Version: 17.0 MP (2 processor)

                          EMAIL: [email protected]
                          WWW: https://www3.nd.edu/~rwilliam

                          Comment


                          • #28
                            Dear Prof Williams,

                            first of all, I'd like to thank you very much for creating xtdpdml!!

                            I'm currently writing my master's thesis in which I inter alia explore the effect of trust in government (share of people who report having confidence in the national government) and income distribution (Palma Ratio) on Quality of Governance (Worldwide Governance Indicators). I also would like to include trade openness (trade-to-GDP ratio) in my model as an intervening/modifying variable. My Dataset consists of 37 OECD countries and spans 2006 - 2019. In the (T=14). The trust in government variable unfortunately has 42 missing values.

                            One of the main issues I obviously have to deal with is reverse causality. While looking for a proper econometric solution, I came across a paper written by Leszczensky & Wolbring which proposed an ML-SEM approach to deal with reverse causality in panel data. This is how I came across xtdpdml command.

                            After trying it out a bit (without the modifying variable), I have a growing suspicion that my dataset might not be suited for the ML-SEM approach.

                            My question now is: Do you think xtdpdml is appropriate to deal with my data? If not, would you have any alternative suggestions?

                            Thank you so much in advance!!!

                            Kind regards.

                            Comment


                            • #29
                              Eimen, xtdpdml works best with large N and small T, so with N = 37 and T = 14 you may be pushing it a bit, especially if the model has a lot of variables. 42 missing values doesn't help either, but may be ok if you use the fiml option. If you have further Qs, you might email me directly with more information on any issues you are encountering.
                              -------------------------------------------
                              Richard Williams, Notre Dame Dept of Sociology
                              Stata Version: 17.0 MP (2 processor)

                              EMAIL: [email protected]
                              WWW: https://www3.nd.edu/~rwilliam

                              Comment


                              • #30
                                Dear Prof. Williams,

                                Thank you for the effort on this package. I have a question regarding the constraint on coeffcients. Let's say if I wish to set a predetermined independent variable's coefficient to 1 as an additional constraint, does xtdpdml support the following kind of coding in the current version? For example like the following or maybe using the
                                Code:
                                nl
                                command in STATA?

                                Code:
                                constraint 1 x1 = 1
                                Thank you!

                                Comment

                                Working...
                                X