Announcement

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

  • Testing for autocorrelation in a logistic regression analysis with panel data

    I am trying scrutinize the relationship between regimetypes (political regimes eg. closed autocracy, hybridregime and liberal democracy) and the risk of civil war onset.

    My data spans from 1946-2006 and includes all independent countries. It is thus panel data and therefore I wish to test for autocorrelation.

    My understanding is that in order to test for autocorrelation in Stata you use the command xtserial after the regression. I used the following procedure:


    . xtset country_name_numeric year
    panel variable: country_name_numeric (unbalanced)
    time variable: year, 1946 to 2006, but with gaps
    delta: 1 unit

    . xtlogit onset i.v2x_regime, or

    . xtserial onset i.v2x_regime
    command xtserial is unrecognized
    r(199);

    What am I doing wrong since Stata does not recognize the command xtserial?

    //Marco Liedecke

    (FYI I am new to the forum)




  • #2
    Marco:
    welcome to this forum.
    As per FAQ, please note that you have to report the use of a community-contributed Stata programme, such as -xtserial-.
    You did nothing wrong, but overlooking that the -helpfile- that comes with -xtserial- states that it works for linear panel data only.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you, Carlo

      Seeing that my dependent variable is binary (no civil war = 0 and civil war = 1) and consequently I wish to run a logistic regression can you point to any commando that will allow me to test for autocorrelation?

      //Marco Liedecke

      Comment


      • #4
        Marco:
        Tricky issue indeed (https://www.statalist.org/forums/for...utocorrelation).
        A basic fix can be to run your regression model with both default and clustered standard errors and see if any difference creeps up between them.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you for your help, Carlo

          If you have any other sources concerning autocorrelation in regards to logistic regression please link

          //Marco Liedecke

          Comment


          • #6
            Marco:
            I simply googled with the following key-words: -autocorrelation xtlogit-.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment

            Working...
            X