Announcement

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

  • xtdpdml (Dynamic Panel Data Modeling using Maximum Likelihood) is now available from SSC

    Thanks to Kit Baum, the first official release of xtdpdml is now available on SSC. Anyone who has installed an earlier beta version will want to uninstall it first and replace it with the SSC version.

    Overview. Paul Allison, Enrique Moral-Benito, and Richard Williams are currently working on a project entitled "Dynamic Panel Data Modeling using Maximum Likelihood." Panel data have many advantages when trying to make causal inferences but can also be difficult to work with. We show that ML provides an alternative to widely used GMM methods such as Arellano-Bond and is superior in many cases. We have prepared a Stata command called xtdpdml that greatly simplifies the process of estimating our models.

    Description. Panel data make it possible both to control for unobserved confounders and to include lagged, endogenous regressors. Trying to do both at the same time, however, leads to serious estimation difficulties. In the econometric literature, these problems have been solved by using lagged instrumental variables together with the generalized method of moments (GMM). In Stata, commands such as xtabond and xtdpdsys have been used for these models. xtdpdml addresses the same problems via maximum likelihood estimation implemented with Stata's structural equation modeling (sem) command. The ML (sem) method is substantially more efficient than the GMM method when the normality assumption is met and suffers less from finite sample biases. xtdpdml greatly simplifies the SEM model specification process; makes it possible to test and relax many of the constraints that are typically embodied in dynamic panel models; unlike most related methods, allows for the inclusion of time-invariant variables in the model; takes advantage of Stata's ability to use full information maximum likelihood (FIML) for dealing with missing data; provides an overall goodness of fit measure by default and provides easy access to others; and can also generate code for use with Mplus.

    For more information. The support page for xtdpdml can be found at

    http://www3.nd.edu/~rwilliam/dynamic/index.html

    It includes works in progress, suggested readings, and replicable examples. Many of the examples and readings are targeted at Economists. However, other social scientists may be especially interested in the examples where we show how models suggested by sociologists Kenneth Bollen and Jennie Brand for panel models with random and fixed effects can be easily estimated with xtdpdml.

    Any comments on the program or its documentation are welcome. Contact information is included in the help file and on the support page.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

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

  • #2
    Thank you. very useful.

    Comment


    • #3
      Dear Richard,
      thank you for the command.
      I am trying to run it on an unbalanced panel. The code only works if I specify "fiml". However, it is running for hours.
      I know, this is a highly unspecific question and depends on the data, but do you have any experience how long it might take?
      Other suggestions to deal with unbalanced panel data?

      Thank you. Florian

      Comment


      • #4
        Florian, your question is very well timed. xtdpdml can indeed be painfully slow (or not converge at all) with larger models or models that use fiml. We added the MPlus option largely because of this. I have examples on the xtdpdml support page where Stata took nearly two hours to estimate a model and Mplus took less than a minute. If you have Mplus, definitely try out the Mplus option of xtdpdml.

        However, if you don't have Mplus, it looks like good news is on the way. I had earlier sent some examples to Stata and got a message last night saying they have made major improvements and the next update should run dramatically faster, e.g. take minutes instead of hours. I don't know when that release will be and I haven't had a chance to try it yet, but I have very high hopes! If I still run into situations where Mplus can easily estimate a model while Stata has problems I will continue communicating with Stata's tech people. I would much rather be able to do everything in Stata than in Mplus, even if Stata takes a little longer to execute. And, while Mplus is a great program, it is also an expensive one, and I don't think many people will want to buy it just so they can run xtdpdml.

        That doesn't mean that success is guaranteed. With extremely unbalanced panels, even Mplus can fail to converge. But at least you find out almost immediately that you have a problem instead of hours later. Hopefully that will be true of Stata too.

        The help file also has a section on dealing with convergence problems. Hopefully most of the advice there will soon be obsolete, at least if you have Stata 14.1.

        I will post an update to this thread once the latest upgrade is out and I have had a chance to test it. Or you can if you want! I will be out of town soon so I may not be able to check it out right away.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        Stata Version: 17.0 MP (2 processor)

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

        Comment


        • #5
          great, thank you very much for your response. I am looking forward to the update and will post it here.

          Comment


          • #6
            Stata 14.2 came out today. With some bigger models using full information maximum likelihood I am seeing huge improvements, e.g. one model that took nearly 2 hours to estimate now takes about 11 minutes. Other models now run around 5 times faster.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            Stata Version: 17.0 MP (2 processor)

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

            Comment


            • #7
              Dr. Williams,
              Many thanks to you and your colleagues for developing this helpful command. If I am understanding correctly based on the Stata help file and Bollen and Brand (2010) replication, xtdpml is intended for continuous dependent variables, correct? Are there any extensions for other types of outcomes? I am tying to find a work around for conducting zero-inflated Poisson regressions using both fixed effects and multi-level modeling frameworks. Specifically, I have an outcome with excess zeroes (frequency of exposure to violence) for children nested in neighborhoods across three survey waves. I know Dr. Allison has posted on the Statistical Horizons cautioning against zero-inflated models and negative binomial fixed effects models. With the option to conduct xtdpml in Mplus, however, I am wondering if this SEM approach can be combined with Mplus procedures for ZIP models and multi-level data.
              Thank you,
              Chelsea

              Comment


              • #8
                Dear Richard, this command is extremely useful. Thank you. One question is why the first dependent variable is not used to produce the latent fixed effects (or the Alpha)? I am reading the MPlus code converted. The measurement model is modeled through "Alpha by y2@1 y3@1 y4@1 ;" rather than "Alpha by y1@1 y2@1 y3@1 y4@1 ;", for example?
                Last edited by MZ Chow; 28 Sep 2016, 09:51.

                Comment


                • #9
                  Chelsea -- yes, xtdpdml is intended for continuous dependent variables. If you wanted to apply it in other situations, I suppose you could generate the code (there is a semfile option) and then try modifying it for your purposes. I can't vouch for whether or not it would work or even be appropriate, nor do i even know if there is existing work along these lines. That is the sort of thing I could see us tackling in the long run but if so it would be a while.

                  Incidentally, if you come up with anything workable, we would love to see it.
                  Last edited by Richard Williams; 28 Sep 2016, 12:00.
                  -------------------------------------------
                  Richard Williams, Notre Dame Dept of Sociology
                  Stata Version: 17.0 MP (2 processor)

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

                  Comment


                  • #10
                    Dear Richard, this command is extremely useful. Thank you. One question is why the first dependent variable is not used to produce the latent fixed effects (or the Alpha)? I am reading the MPlus code converted. The measurement model is modeled through "Alpha by y2@1 y3@1 y4@1 ;" rather than "Alpha by y1@1 y2@1 y3@1 y4@1 ;", for example?
                    MZ -- without seeing all your code, my guess is that y1 is NOT your first dependent variable. Rather, y2 is. In a typical model, the first equation has y2 being regressed on y1. Only if you had specified ylag(0) would y1 be the first dependent variable. (And if you are doing more than Lag 1, then y3 or later might be the first dependent variable.)
                    -------------------------------------------
                    Richard Williams, Notre Dame Dept of Sociology
                    Stata Version: 17.0 MP (2 processor)

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

                    Comment


                    • #11
                      Dear Richard, Thank you and your colleagues very much for developing this code!. Just one question, does -xtdpdml - suitable to estimate panel error corrections model?
                      Anat

                      Comment


                      • #12
                        Dear Richard, Thank you and your colleagues very much for developing this code!. Just one question, does -xtdpdml - suitable to estimate panel error corrections model?
                        Well, I don't know what a panel error corrections model is, so I guess I have to say I don't know! However, I have been pleasantly surprised a couple of times to discover that various models were special cases of what xtdpdml can do. If it doesn't do exactly what you want, you may be able to get it to generate much of the sem code and then tweak it from there.
                        -------------------------------------------
                        Richard Williams, Notre Dame Dept of Sociology
                        Stata Version: 17.0 MP (2 processor)

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

                        Comment


                        • #13
                          Thank you for the advice, Richard!

                          Comment


                          • #14
                            Thank you for this great command, Richard. Question: Do you have any examples of this command using latent variables with multiple indicators?

                            I'm thinking something like this (code in Mplus): http://www.longitudinalsem.com/ex5-6.inp


                            Comment


                            • #15
                              Do you have any examples of this command using latent variables with multiple indicators?
                              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.
                              -------------------------------------------
                              Richard Williams, Notre Dame Dept of Sociology
                              Stata Version: 17.0 MP (2 processor)

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

                              Comment

                              Working...
                              X