Announcement

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

  • xtdpdml (Dynamic Panel Data Modeling using Maximum Likelihood)

    Hi everyone,

    I'm trying to estimate a dynamic model for explaining the spread behavior of 5 loan categories in Brazil. I'm using panel data comprising 7 banks and 28 quarters. In order to estimate a single panel (instead of five panels, one for each loan category), I stacked up the five panels and labeled each combination of bank/loan category as a different individual. Since I'm using 7 banks and 5 loan categories, I have 35 units and used dummies to distinguish among the five loan categories. So I interacted the dummies with the explanatory variables..

    But I'm facing a problem using the xtdpdml command below
    Code:
    xtdpdml Spread Spread1 Spread2 RkAv RkAv1 RkAv2 End End1 End2 MktSha MktSha1 MktSha2 ItRkb ItRkb1 ItRkb2 OpCost OpCost1 OpCost2 MgmQty MgmQty1 MgmQty2 Size Size1 Size2 Infl Infl1 Infl2 ImpInt ImpInt1 ImpInt2 OppCost OppCost1 OppCost2 NTA NTA1 NTA2 GDPg GDPg1 GDPg2 LiqRk LiqRk1 LiqRk2 Selic Selic1 Selic2, ylags(1)
    Stata (version 13.1) returns the message "variable Spread1 already defined r(110);". Does anyone have any idea of what exactly this means? Spread1 is the interaction between dummy 1 and the lagged dependent variable (as RkAv1 is the interaction between RkAv and dummy 1 and so on). This message also appears if I remove Spread1 and Spread2, and it keeps popping up relating to every interaction between the dummies and the variables.

    What if I remove all the interactions between the dummies and the variables? In this case, Stata returns the message "model not identified; no paths from latent variable Spread28 to observed variables r(503);"

    Does anyone have any clue about these issues?

    Thank you all in advance.

    José

  • #2
    First off, observed variable names should user lowercase letters. Otherwise Stata thinks they are latent variables.

    2nd, be careful of vars that end in numbers that don't stand for the time period. When xtdpdml reshapes the data it will create vars called spread1, spread2, etc. Name the interactions other wat.

    Clean up these problems and see what happrns. T = 28 may not be possible to estimate, and N seems pretty small, so I'm not optimistic xtdpdml is the way to go. But get past the syntax errors first and you can tell better.

    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

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

    Comment


    • #3
      Thank you very much for the timely response, professor.

      In fact, with the corrections in the syntax Stata returns the message "no observations r(2000);". I suppose that N is indeed too small. I can increase this number to, say, N=60. Beyond that the panel gets unbalanced. I realize that I can use the "fiml" option in this case, but what is the minimum figure I should aim for N and T for the command to work?

      Comment


      • #4
        Jose, I would check my variables first. There might, for example, be a variable that is missing for every case, It looks like you computed a lot of variables and you may have erred along the way.

        You might also start very simply, perhaps using only y and lagged y, If that model is too large to run then a more complicated model won't have a chance.

        In general, I find T > 10 can be problematic, and will likely be even more so with the large number of variables you want to use. Unless you can really simplify things and perhaps cut down T (e.g. use years instead of quarters) I would not be optimistic.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

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

        Comment


        • #5
          I got an output using only y and lagged y as suggested, professor. But when I included a second variable, Stata returned the message:

          "matsize too small
          You have attempted to create a matrix with too many rows or columns or attempted to fit a model with too many variables. You
          need to increase matsize; it is currently 400. Use set matsize; see help matsize.

          If you are using factor variables and included an interaction that has lots of missing cells, either increase matsize or set
          emptycells drop to reduce the required matrix size; see help set emptycells.

          If you are using factor variables, you might have accidentally treated a continuous variable as a categorical, resulting in lots
          of categories. Use the c. operator on such variables.
          r(908);"

          So, what if I reduce T to, say, 7, and increase N to, say, 60, could that work (I'm sorry to ask you instead of performing the test, but that is because I'll have lots of work on changing those figures, so it would be really helpful to have an insight a priori)? In this scenario, could I use a larger number of variables?

          PS: Stata took about 15 minutes to return the above message when I added the second variable. I wonder how long will it take when I increase the number of variables in the model...

          Comment


          • #6
            First off, like the message says, I would increase matsize, e.g.

            set matsize 8000

            If you get Stata 16, matsize will be taken care of for you.

            Cutting T down to 7 should not be hard. And remember there are programs like xtreg out there which may be fine if T is large.
            -------------------------------------------
            Richard Williams, Notre Dame Dept of Sociology
            StataNow Version: 19.5 MP (2 processor)

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

            Comment

            Working...
            X