Announcement

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

  • Panel Data Regression in Stata

    Hello All,

    I have just started using STATA 13 for a Project and I have to perform a correlation and panel data regression analysis for a data from 130 companies.

    Description of the data
    Sample size - 130
    data for 130 companies available for 5 continuous years
    time period - yearly
    unbalanced data
    Dependant variable - Quantitative variable (it is a score as %)
    Independant variable - categorical variable
    5 Control variables - includes quantitative, categorical and discrete variables

    As I did not have any classes in statistics, I could only go through some YouTube videos for an initial understanding.

    It would be really great if someone could help me with the steps that needs to be followed in STATA to perform a regression on this data. Any pointers to short and clear videos / books that explains panel data regression for the above data specifications is highly appreciated.

    Hoping for a quick and helpful response. Many thanks in advance.

    Best regards,
    Julia

  • #2
    Julia:
    welcome to the list.
    I assume that you're not searching help with a class/homework (which is highly deprecated on this forum).
    Anyway, the following advice is unavoidably limited. Hence, I do not feel as supporting any breaching of integrity agreement you might have signed with your institution if your project were actually a statistical assignment.
    As per your saying, your task is really tough.
    A very good first place to start off your journey through panel data regression models with continuous dependent variable is -xtreg- entry in Stata .pdf manual.
    I would focus my attention on -xtreg, fe- and -xtreg, re- and related differences.
    The same entry will also give you lots of references, such as: http://www.stata.com/bookstore/micro...ata/index.html
    Good luck.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      To add my 2 cents worth, I would strongly encourage you to find someone who understands panel analysis and related methods. While you can run these things reasonably easily in Stata, you're very likely to misinterpret then results or make some other error.

      Comment


      • #4
        Thank you both for the advice.

        I already tried the analysis in Stata with my limited knowledge from YouTube Videos. But as Phil mentioned, something is wrong with my procedure. I am getting a very low R-squared value (<1). I really hope this could be resolved quickly. I am stilll trying to read more and understand the right method.

        Thanks,
        Julia

        Comment


        • #5
          Julia:
          when we talk about R-sq and panel regression models, we usualy specify which one of them we refer to (within; between; total), as they measure different stuff.
          As an aside, a low R-sq per se in neither good nor evil.
          Eventually, if you do not post what you typed and what Stata gave you back, nobody on the list can be more helpful.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thank you for the quick response Carlo.
            Following are the commands and outputs (used with very limited Knowledge):

            1. tabulate GS, gen(g) - As the Independent variable is a categorical variable
            2. xtset ID
            panel variable: ID (balanced)
            3. xtset ID year, yearly
            panel variable: ID (strongly balanced)
            time variable: year, 2008 to 2012
            delta: 1 year


            Comment


            • #7
              4. xtreg GovernanceCSR g1 g2 g3


              After seeing these results, I understood my method is somehow not correct.
              Many Thanks,
              Julia

              Comment


              • #8
                Julia:
                -xtset ID year. should suffice;
                - unfortunately no results is visible (hence no hints on what went possibly wrong can be made). Take a look at the FAQ about using CODE delimiters (
                Code:
                this text is written within CODE delimiters
                ).
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Code:
                  xtreg GovernanceCSR g1 g2 g3
                  note: g3 omitted because of collinearity
                  
                  Random-effects GLS regression                   Number of obs      =       198
                  Group variable: ID                              Number of groups   =        35
                  
                  R-sq:  within  = 0.0020                         Obs per group: min =         1
                         between = 0.0058                                        avg =       5.7
                         overall = 0.0266                                        max =         6
                  
                                                                  Wald chi2(2)       =      0.61
                  corr(u_i, X)   = 0 (assumed)                    Prob > chi2        =    0.7380
                  
                  ------------------------------------------------------------------------------
                  Governance~R |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                            g1 |  -2.898186   4.024193    -0.72   0.471    -10.78546    4.989086
                            g2 |  -1.478133    4.71079    -0.31   0.754    -10.71111    7.754845
                            g3 |          0  (omitted)
                         _cons |   55.03076   3.546831    15.52   0.000      48.0791    61.98242
                  -------------+----------------------------------------------------------------
                       sigma_u |  8.9003016
                       sigma_e |  6.1425199
                           rho |  .67736753   (fraction of variance due to u_i)
                  ------------------------------------------------------------------------------

                  Comment


                  • #10
                    Again thank you Carlo for your time and guiding me into using CODE delimiters.

                    It would be really great if you could help me find what is wrong!

                    Best,
                    Julia

                    Comment


                    • #11
                      Julia:
                      as far as I can get your output, one dummy has been omitted due to collinearity: nothing sinister, it is the famous dummy trap that bites (https://en.wikipedia.org/wiki/Dummy_...le_(statistics)).
                      Hence, there's nothing apparently wrong in your model.
                      However, I would draw your attention on the following issues:
                      - having only categorical predictors in a panel dataset is quite unusual;
                      - you have a little sample, so your inference my suffers from that (ie, you cannot easily reject the null that your coefficients differs from zero, as per your wide 95% confidence intervals);
                      - you chose the -re- specification: did you rule out the fixed effect one due to the result of the -hausman- test (see -help hausman- if this name sounds strange)?
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment

                      Working...
                      X