Announcement

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

  • Stata dropping first year from panel dataset

    Hello,

    I am using Stata 19 SE.

    I have a panel dataset from 2015-2024 with one DV, 3 IVs and 7 CVs. I am running an OLS regression with year and industry fixed effects. But when I run the regression I can only see results form 2016-2024 - im not sure where my data from 2015 has gone. I haven't lagged any variables.

    I would appreciate any help.

    Thank you,
    Harmeet

  • #2
    Show us the results of the -xtset- for your panel -- it might be informative. (Given the little information you provide, it's hard to be more helpful.)

    Comment


    • #3
      xtset id year, yearly

      Panel variable: id (strongly balanced)
      Time variable: year, 2015 to 2024
      Delta: 1 year

      I then used the command:
      regress esgc b_indep bgd bsize leverage roa liquidity ceoduality bmf bt ln_fs i.year i.industrycode, vce(robust)
      Last edited by Harmeet Sehgal; 19 Mar 2026, 09:32.

      Comment


      • #4
        Can you explain what you mean by "only see[ing] results form 2016-2024?" Does the number of observations used in your regression differ from the number in the whole sample, including 2015? Have you used e(sample) to verify that the missing observations come from 2015? Or are you missing a coefficient for the 2015 dummy? Stata typically omits the first category from the output.
        Devra Golbe
        Professor Emerita, Dept. of Economics
        Hunter College, CUNY

        Comment


        • #5
          Seems like 2015 is the reference category for your i.year variable.

          Comment


          • #6
            These are my (e)sample results.
            year | Freq. Percent Cum.
            ------------+-----------------------------------
            2015 | 135 8.30 8.30
            2016 | 139 8.54 16.84
            2017 | 142 8.73 25.57
            2018 | 149 9.16 34.73
            2019 | 159 9.77 44.50
            2020 | 168 10.33 54.82
            2021 | 182 11.19 66.01
            2022 | 186 11.43 77.44
            2023 | 185 11.37 88.81
            2024 | 182 11.19 100.00
            ------------+-----------------------------------
            Total | 1,627 100.00



            When I run my regression (below) the part of the regression results that is by year, there is only 2016-2024.

            Linear regression Number of obs = 1,627
            F(29, 1597) = 17.76
            Prob > F = 0.0000
            R-squared = 0.3241
            Root MSE = 21.26

            ------------------------------------------------------------------------------
            | Robust
            esgcs | Coefficient std. err. t P>|t| [95% conf. interval]
            -------------+----------------------------------------------------------------
            b_indep | -.0366825 .043487 -0.84 0.399 -.1219802 .0486152
            bgd | -.0169863 .057001 -0.30 0.766 -.128791 .0948184
            bsize | .6369739 .3178877 2.00 0.045 .0134529 1.260495
            leverage | .0634554 .0350305 1.81 0.070 -.0052552 .1321659
            roa | -20.36302 6.071272 -3.35 0.001 -32.27152 -8.454516
            liquidity | .4739907 .4346322 1.09 0.276 -.3785188 1.3265
            ceoduality | -3.685138 1.928008 -1.91 0.056 -7.46683 .0965534
            bmf | -.8864662 .2217089 -4.00 0.000 -1.321337 -.4515952
            bt | .0289759 .2601261 0.11 0.911 -.4812486 .5392003
            ln_fs | -8.414731 .5659114 -14.87 0.000 -9.524738 -7.304723
            |
            year |
            2016 | .1727795 2.455818 0.07 0.944 -4.644185 4.989744
            2017 | .4437581 2.495395 0.18 0.859 -4.450835 5.338351
            2018 | 1.67385 2.447305 0.68 0.494 -3.126418 6.474117
            2019 | -.8569423 2.528297 -0.34 0.735 -5.816072 4.102188
            2020 | -1.237642 2.572449 -0.48 0.631 -6.283374 3.80809
            2021 | .9449458 2.481083 0.38 0.703 -3.921576 5.811468
            2022 | -.5474989 2.55903 -0.21 0.831 -5.56691 4.471912
            2023 | -.9306513 2.644163 -0.35 0.725 -6.117046 4.255743
            2024 | -8.252582 2.814483 -2.93 0.003 -13.77305 -2.732112
            |
            industrycode |
            15 | -16.48295 4.563881 -3.61 0.000 -25.43478 -7.531127
            20 | -1.775139 2.760052 -0.64 0.520 -7.188846 3.638567
            30 | 24.15412 2.706654 8.92 0.000 18.84516 29.46309
            35 | 7.210148 1.80629 3.99 0.000 3.667199 10.7531
            40 | -1.949735 1.708239 -1.14 0.254 -5.30036 1.400891
            45 | -6.309971 2.432422 -2.59 0.010 -11.08105 -1.538895
            50 | -1.813302 1.642618 -1.10 0.270 -5.035216 1.408612
            55 | -7.278477 2.813872 -2.59 0.010 -12.79775 -1.759207
            60 | -15.2268 4.181579 -3.64 0.000 -23.42876 -7.024844
            65 | -.9028132 3.528564 -0.26 0.798 -7.823917 6.018291
            |
            _cons | 279.7961 10.81416 25.87 0.000 258.5847 301.0076
            ------------------------------------------------------------------------------

            Comment


            • #7
              Your posted results are difficult to read, because you have not followed the advice in the FAQs (12.3) to use CODE delimiters for your code and output. That said, as Daniel and I proposed, the output indicates that 2015 is your omitted year category. If you check your industry variable I bet you will see that a reference category has been omitted there as well.
              Devra Golbe
              Professor Emerita, Dept. of Economics
              Hunter College, CUNY

              Comment


              • #8
                oh okay thank you very much

                Comment

                Working...
                X