Announcement

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

  • XTDPDQML: new Stata command for quasi-maximum likelihood estimation of linear dynamic panel models

    Dear Statalisters,

    I have developed a new Stata estimation command for quasi-maximum likelihood estimation of linear dynamic panel data models with a short time horizon, in particular the random-effects ML estimator by Bhargava and Sargan (1983) and the fixed-effects transformed ML estimator by Hsiao, Pesaran, and Tahmiscioglu (2002).

    The program can be installed by typing
    net from "http://www.kripfganz.de/stata/"
    in Stata’s command window.

    A help file that documents the command syntax and the available options can be accessed by typing
    help xtdpdqml

    Postestimation commands can be used as well, see
    help xtdpdqml postestimation

    A preliminary background note is available at www.kripfganz.de

    Comments and suggestions are welcome.

    Literature:
    - Bhargava, A. and J. D. Sargan (1983). Estimating Dynamic Random Effects Models from Panel Data Covering Short Time Periods. Econometrica 51 (6), 1635-1659.
    - Hsiao, C., M. H. Pesaran, and A. K. Tahmiscioglu (2002). Maximum likelihood estimation of fixed effects dynamic panel data models covering short time periods. Journal of Econometrics 109 (1), 107-150.

  • Sebastian Kripfganz
    replied
    You can use the xtdpdqml command with the option re to estimate a dynamic random-effects model by quasi-maximum likelihood.

    Regarding my GMM command, xtdpdgmm, you can always specify appropriate instruments that would satisfy a random-effects assumption. (Just instrument all exogenous variables by themselves with the iv() option but notice that the lagged dependent variable is always correlated with the unobserved effects by construction. The usual GMM-type instruments need to be employed. The advantage of the xtdpdqml command is that this correlation is built in the likelihood function and no instruments are needed.)

    Leave a comment:


  • pierre christian
    replied
    Dear Sebastian

    Please, It don't know if it is possible to have the Xtsqgmm command with random effect.

    Thanks

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Sorry, I have misinterpreted your previous question. My earlier answer is only helpful if the initial values are infeasible.

    Concergence problems are indeed more likely in the random-effects than the fixed-effects model, in particular if you have many regressors. There might be some other peculiarities of your data that add to the complications. You could try to run the estimation with fewer regressors to see if there are any particular variables that cause the convergence problems.

    Leave a comment:


  • Binh Pham
    replied
    Dear Sebastian,

    Thank for your reply. I have adjusted (a b c d) as above but it is not successful. Instead, I modified some deep options as such techniques = bfgs, tolerance = 0.001. It converges after 400 iterations! Maybe, default tolerance is too low, say 10E-06. I am not very sure it is a correct way.

    BTW, I guess the default algorithm is NR (Newton-Raphson). Perhaps, BFGS performs better in this case.

    Best,
    Last edited by Binh Pham; 16 May 2017, 13:17.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Did you try the advise that I give in the remarks section of the xtdpdqml help file?
    In the random-effects model, specifying different initial values for the variance parameters with the option initval() may help, in particular increasing the first or second value, or decreasing the third or fourth value such that the following inequality holds for each group:

    b + (a - c * d^2) * T > 0

    where a, b, c, and d refer to the first, second, third, and fourth element specified with the initval() option, respectively. When the option stationary is invoked, this condition
    might not be sufficient to yield feasible initial values. In such a situation, further increasing b can be helpful.

    Leave a comment:


  • Binh Pham
    replied
    Dear Sebastian,

    Thank for your guide above. Could you show me the way fix random effect not concave, i.e., non-convergence when estimating with xtdpdqml.

    In some case, I cannot get RE estimate due to non-converging although FE is always successful.

    Thank you and regards,

    Leave a comment:


  • Sebastian Kripfganz
    replied
    In my previous post, I have carelessly linked to other commands that perform serial correlation testing for panel data. The results of these test should not be relied on in the context of xtdpdqml. The reason is that these tests rely on a strict exogeneity assumption which is naturally not satisfied in dynamic models with a lagged dependent variable.

    Thanks to Kit Baum, an update is now available on SSC (and on my personal website) to version 1.4.3 that fixes some minor bugs and introduces the postestimation command estat serial for use after xtdpdqml. This computes test statistics for the absence of serial correlation in the first-differenced residuals. The test is valid for dynamic models as estimated by xtdpdqml. In the absence of serial correlation in the idiosyncratic errors in levels, it is expected that there is first-order serial correlation in the first-differenced errors, while there should be no serial correlation of order 2 or higher.
    Code:
    adoupdate xtdpdqml, update
    Last edited by Sebastian Kripfganz; 04 Mar 2017, 09:54.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I should add that you should use the regress command with the vce(cluster id) instead of the vce(robust) option in the testing procedure that I have outlined in my previous post.

    Alternatively, you might want to have a look at three new commands written by Jesse Wursten for serial correlation testing:
    - xthrtest - now on SSC: Heteroskedasticity Robust LM(k) test for serial correlation in a fixed effect panel setting
    - xtistest - now on SSC: Portmanteau IS test for serial correlation in a fixed effect panel setting
    - xtqptest - now on SSC: Bias-corrected Q(P) test for serial correlation in a fixed effect panel setting

    These commands should also work after xtdpdqml (without the mlparams option).

    Leave a comment:


  • Binh Pham
    replied
    Thank you Sebastian very much. You explanations are very clear as it works now.
    Instead, I set the initval = .1 .1 .1 .2 then get the identical outputs between two computer.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Originally posted by Binh Pham View Post
    In your paper, the assumption of e_it should not be AR1 ones. So, could your estimator will deliver biased estimates in case of AR1 existence ? And, because xtdpdqml does not provide autocorrelation tests as xtabond2, how we can test AR in disturbances?
    Indeed, if there is remaining serial correlation in the error term, the estimates obtained with xtdpdqml will no longer be consistent. Tests for serial correlation might be added as a postestimation feature at some time in the future. For now, you could easily implement a test following the procedure outlined by Jeff Wooldridge in his textbook "Econometric Analysis of Cross Section and Panel Data", chapter 10.6.3. This is a test whether the first-differenced residuals exhibit a serial correlation of -0.5 which would correspond to a serially uncorrelated idiosyncratic error component in the original levels.
    Code:
    webuse abdata
    xtdpdqml n w k yr1978-yr1984, vce(robust)
    predict e, e
    regress D.e LD.e, vce(robust)
    test LD.e = -0.5
    Alternatively, since predict with the option e gives you a prediction of the idiosyncratic error component excluding the fixed effects, you could directly test in a similar way for the absence of serial correlation in the levels:
    Code:
    regress e L.e, vce(robust)
    test L.e

    Concerning the infeasible initial values with the re option: This is not unlikely to happen for the random-effects model and it requires to specify alternative initial values for the variance parameters with the initval() option, e.g.
    Code:
    xtdpdqml n w k yr1978-yr1984, re vce(robust) initval(.1 .2 .2 .3)
    This option specifies initial values for the variance parameters \(\sigma_u^2\), \(\sigma_e^2\), \(\sigma_0^2\), and \(\phi\) in this particular order. To be feasible, the following condition needs to be satisfied:
    \[(\sigma_u^2 - \phi^2 \sigma_0^2) \max (T_i) > - \sigma_e^2\]
    Please see the paper and the online appendix available on my webpage for details.

    Regarding your different observations on two different computers, my guess is that you have different versions of xtdpdqml installed on those computers. There has been some smaller change to the computation of the default initial values for the variance parameters with the latest update, version 1.3.1, that can cause initial values that have been feasible before to be no longer feasible (or the other way round). Please make sure that you are running the latest version of xtdpdqml on both computers by checking its version and by updating it if necessary:
    Code:
    which xtdpdqml
    adoupdate xtdpdqml, update

    Leave a comment:


  • Binh Pham
    replied
    I have notified error code like below:
    Code:
    Quasi-maximum likelihood estimation
    initial values not feasible
    r(1400);
    when running xtdpdqml with re option but not fe. It did appear in STATA 13.1. Interestingly, when I run it in another computer this error was not replicated. I don't know why. So, please check your code for sure, Mr Sebastian! Thanks in advance.
    Last edited by Binh Pham; 02 Sep 2016, 05:57.

    Leave a comment:


  • Binh Pham
    replied
    Dear Sebastian,

    I have used xtdpdqml to estimate linear DPD for my MRes project. I set up a model for banks as such:
    y_it = y_i,t-1*lamda + x_it*Beta + z_it*Delta + u_i + e_it, where z_it is a vector of time-invariant variables, saying, unemployment rate,...
    I am doubting on e_it may subject to AR1 because in my banking application, individuals' performance is highly persistent.

    In your paper, the assumption of e_it should not be AR1 ones. So, could your estimator will deliver biased estimates in case of AR1 existence ? And, because xtdpdqml does not provide autocorrelation tests as xtabond2, how we can test AR in disturbances?

    Hope to receive your reply! Thanks in advance.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Thanks to Kit Baum, the xtdpdqml command is now also available from SSC (in addition to my own website, see above):
    Code:
    ssc install xtdpdqml
    The latest version 1.3.1 comes with some minor bug fixes, additional display options, and improved help files.

    I will present the package soon at the UK Stata Users Group Meeting in London.
    • Kripfganz, S. (forthcoming). xtdpdqml: Quasi-maximum likelihood estimation of linear dynamic short-T panel data models. Stata Journal (accepted manuscript).

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Sorry, I misinterpreted your first enquiry. The command automatically does a first-difference transformation in the fixed-effects case but not for the random-effects model.

    You do not necessarily have to have stationary variables. The other way round, if all variables are stationary you could get more efficient estimates with the stationary option.

    Leave a comment:

Working...
X