Announcement

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

  • Durbin-Watson test

    Dear all,

    I have time series and panel data for which I conduct an event study. In order to check for autocorrelation prior to my analysis, I need to do a Durbin-Watson test. However, I keep getting the error "time variable not set, use tsset varname..."
    I applied the following code:

    tsset Gvkey Date_

    whereby Gvkey is the identifier for my panel data and the Date_ the time series identifier.

    Could you maybe tell me what I did wrong?

    Best

    Anna

  • #2
    As you have panel data, you cannot test for serial correlation using the Durbin-Watson test. See https://www.stata.com/support/faqs/s...tocorrelation/

    Code:
    search xtserial

    Comment


    • #3
      Dear Andrew,

      Thank you for your fast reply. I tried the following code as suggested by you:

      xtserial cumul_abn_ret dif

      where cumul_abn_ret is my dependent variable and dif my independent one (time series).
      Nevertheless, I receive the error message "command xtserial is unrecognized". Is there any alternative that I can use? PS: I use STATA version 18.0.

      Kind regards

      Anna

      Comment


      • #4
        Anna:
        as Andrew's helpul reply implies, -xtserial- is not a built-in Stata command, but a community-contributed module.
        Therefore, you should type -search xtserial- from within Stata and follow the instructions to install it.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X