Announcement

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

  • Number of firm-year observations in unbalanced panel data

    Hello,


    I am dealing with unbalanced panel data, My sample period is from 1962 to 2017 and I have 16 explanatory variables.

    I am trying to calculate the number of firm-year observations in my sample according to the following formula:

    (Number of firms * sample period in years * number of variables) - number of missing values

    but my results are somewhat weird.


    Does anybody know a formula that calculates the number of firm-year observations in STATA?

    Thank you for taking your time to help me

  • #2
    I do not understand what you mean by "firm-year observations" since your formula seems to be at the "variable" level rather than the "firm" level.

    The general guidance is that Stata omits observations that have a missing value for any variable included in the model. But this means that if you use, for example, only 12 of your 16 independent variables in a model, you will probably have more observations that if you use all 16, because missing values in the four omitted variables will not cause Stata to omit those observations.

    But it is even more complicated since if you have a variable that is lagged, the missing value will be the value in the observation for that firm one year earlier than the observation with the dependent variable.

    Of course, if you simply fit your model, the output will report the number of observations used after all missing values are taken into account.

    Comment

    Working...
    X