Announcement

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

  • How to add time controls for PMG estimation

    Hi,

    I'm pretty new to STATA.

    I have a panel data ranging from 1970-2004 - various variables such as per capita gdp, gfcf, avg schooling etc in STATA 16

    I'm running a PMG estimation with the following command:
    xtpmg d.lpcgdp d.lcapitalgfcf d.lavg_schooling d.popgrowthrate , lr(l.lpcgdp lcapitalgfcf lavg_schooling popgrowthrate) ec(ec) replace pmg

    I wanted to know how I can incorporate non-linear time controls in order to control for the effects of business cycles? The table below shows the 5-year dummyies included in the results table (1970-75, 1976-80, 1981-85...)

    My questions are:
    1. How can I create those dummy variables for each of those time periods?
    2. How can I incorporate those time control dummy variables into the PMG regression shown above?

    I'd really really appreciate a prompt reply! Deadline is fast approaching... Thank you so much!

    Kind regards,
    Mohammed

    Click image for larger version

Name:	example.png
Views:	4
Size:	189.8 KB
ID:	1605598


    Last edited by Mohammed Hussein; 24 Apr 2021, 12:43.

  • #2
    I am not familiar with the -xtpmg- command. In fact, I don't even know what a PMG estimation is. But your actual questions don't seem to depend on that, so I'll hazard a suggestion that will be helpful on the assumption that -xtpmg- follows the same syntax as normal Stata estimation commands.

    I wanted to know how I can incorporate non-linear time controls in order to control for the effects of business cycles? The table below shows the 5-year dummyies included in the results table (1970-75, 1976-80, 1981-85...)

    My questions are:
    1. How can I create those dummy variables for each of those time periods?
    2. How can I incorporate those time control dummy variables into the PMG regression shown above?
    You do not show any example data, but I will assume that your data is in long layout and that there is a variable, called year, that shows the year for the observation. There is no need to create dummy variables for this (nor any other Stata estimation command) if you are using any reasonably recent version of Stata. What you do need to do is create a multi-level category variable that marks the five year intervals. Factor variable notation will handle this automatically for you (-help fvvarlist- for details).

    Code:
    gen interval = ceil((year-1970)/5) if year > 1970
    replace interval = 1 if year == 1970
    
    xtpmg d.lpcgdp d.lcapitalgfcf d.lavg_schooling d.popgrowthrate i.interval , lr(l.lpcgdp lcapitalgfcf lavg_schooling popgrowthrate) ec(ec) replace pmg
    I note that your choice of intervals from years is a bit odd in that your first interval 1970-1975 encompasses 6 years, whereas your other intervals encompass only 5. Perhaps in your context there is good reason to do that, but in most situations it would be more natural to group them as 1970-1974, 1975-1979, 1980-1984, etc. In that case the interval variable would be created by:

    Code:
    gen interval = floor((year-1970)/5)
    Added:
    I ran -findit xtpmg- and learned that it is available on SSC. And -ssc describe xtpmg- shows that it was written to be run with version 9 or later. Version 9 is by now fairly ancient, and though I cannot be certain, I think it pre-dates factor variable notation. So if trying the above gets you an error message about factor variables not being allowed, then here is a workaround to be used after generating the variable interval as shown above:

    Code:
    tab interval, gen(intvl)
    xtpmg d.lpcgdp d.lcapitalgfcf d.lavg_schooling d.popgrowthrate intvl* , lr(l.lpcgdp lcapitalgfcf lavg_schooling popgrowthrate) ec(ec) replace pmg
    Last edited by Clyde Schechter; 24 Apr 2021, 13:38.

    Comment


    • #3
      Clyde Schechter Thanks Clyde, you were right - the first way gave me an error message about factor variables not being allowed. I used the second method and it worked out.

      But I have a question - since the first half of the xtpmg equation above represents the short run results and anything in the lr(l.pcgdp....) side represents the long run results, do I include the intvl* in both sides, as below?

      Code:
      xtpmg d.lpcgdp d.lcapitalgfcf d.lavg_schooling d.popgrowthrate intvl* , lr(l.lpcgdp lcapitalgfcf lavg_schooling popgrowthrate intvl*) ec(ec) replace pmg
      When I include intvl* in both sides, it gives me a message of
      numerical derivatives are approximate flat or discontinuous region encountered

      Also, even when I run on one side, it gives me a long list of iterations that keep going forever, until I break 'break'. Is there any particular reason for this?

      I'm attaching my data file if that helps you in any way


      Attached Files

      Comment


      • #4
        Joro Kolev Hi Joro, perhaps you'd be able to help with this? Thank you!

        Comment

        Working...
        X