Announcement

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

  • What tests to perform on a Panel Data set?

    Hello,

    I have a panel data set of 4500 firms for the years 2000 - 2017 (around 42,000 firm-year observations) a sample of which is shown below from Excel. I apologize as I do not currently have access to Stata from home.

    I would like to use a panel regression to test the effects of my diversity index on annual risk including controlled variables and year and industry effects.

    Click image for larger version

Name:	Untitled.jpg
Views:	1
Size:	387.3 KB
ID:	1473963



    I used the following codes to perform the regression analysis but am not sure whether this is the right way to perform it. Any advice or feedback is highly appreciated!


    xtset permco YEAR


    xtreg annualized_risk diversity_Index controls i.YEAR i.industry, fe robust cluster (permco)

    I performed a Hausman test using the following codes which gave a P value given 0.000 suggesting the use of a fixed effects model.


    xtreg annualized_risk diversity_Index controls i.YEAR i.industry, fe


    estimates store fe
    xtreg annualized_risk diversity_Index controls i.YEAR i.industry, re


    estimates store re
    hausman fe re

    I also tested for serial autocorrelation using the xtserial code which gave a p-value of 0.000 and tested for heteroskedasticity using the xttest 3 code which also gave a p-value of 0.000 suggesting the presence of both cases. Unfortunately the xttest2 code gave an error that there are not enough observations per panel to perform the test. As such, I included the robust and cluster(permco) options which I believe can be used to accommodate for these cases (please correct me if I'm mistaken).

    Finally, I winsorized all variables
    at the 1st and 99th percentile level due to the presence of extreme observations using the:

    winsor 2 varname, cuts(1,99) by (YEAR) code.

    Are there any other tests that should be performed or are the current tests performed adequate and are the main codes in the right form for my analysis?

    Thank you!


    Last edited by Omar Shal; 07 Dec 2018, 21:36.

  • #2
    Omar:
    I think you should reconsider your statistical strategy for at least three reasons:
    1) minor improvement: invoking both -robust- and -cluster- options in -xtreg- is pleonastic, as they do the very same job;
    2) major improvement: you cannot run -hausman- with non-default standard errors, nor you can run -hausman- with default standard errors and invoke -cluster- (or -robust-) afterwards. If you suspect/detect heteroskedasticity and/or autocorrealtion in your dataset, you should invoke -cluster- (or -robust-) and then compare -fe- vs -re- specification via the user-written command -xtoverid- (type -search xtoverid- from within Stata to spot and install it);
    3) I'm not keen towards eliminating the so called extrem observations (unless they are apparent data entry mishaps), as they may well be part of the data generating process under investigation.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Thank you very much for your feedback and quick response Carlo!

      I just have 1 question to check with you as I’m a bit confused on how to proceed. I apologize if this is too much of a simple question as I’m not very experienced with panel data:

      Since I’m trying to apply year and industry effects, and was advised strongly against firm fixed effects, should I be using xtset industry instead and run the xtreg afterwards or that wouldn’t make sense?

      I cannot use xtset industry YEAR as I have multiple firm observations in the same industry so that gives me an error message on Stata
      Last edited by Omar Shal; 08 Dec 2018, 09:05.

      Comment


      • #4
        Omar:
        if you do not plan to use time-series commands, such as lags and leads, -xtset-ting your data with the -panelid- only it's perfectly legal.
        Kind regards,
        Carlo
        (Stata 18.0 SE)

        Comment


        • #5
          Carlo thank you once again for your answer and patience.

          I am trying to use the xtoverid command on Stata after installing it. I did the following:

          xtset industry

          xtreg annualized_risk diversity_Index controls i.YEAR i.industry, re robust

          xtoverid

          I get the following error message:

          . xtoverid
          2000b: operator invalid
          r(198);

          Thank you!

          Comment


          • #6
            Omar:
            being a bit aged, -xtoverid- does not allow -fvvarlist- notation.
            Take a look at -xi.- prefix to fix the issue:
            Code:
            xi: xtreg annualized_risk diversity_Index controls YEAR industry, re robust
            Last edited by Carlo Lazzaro; 10 Dec 2018, 23:58.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              Thanks Carlo! It works perfectly now. I highly appreciate your help

              Comment

              Working...
              X