Announcement

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

  • How to count the number of panels used in the regression

    I have panel-time series. I want to know how many countries (panels) are used in the regression (not observation numbers) after i run the regression.
    I can to levelsof country if e(sample) but preferably i want the count of total countries.

    Thanks

  • #2
    Various ways.

    Note that levelsof in an up-to-date Stata leaves r(r) in its wake. Type


    Code:
    return list
    or

    Code:
    di r(r)
    to see that number. Otherwise

    Code:
    qui tab country if e(sample) 
    di r(r)
    is another way to do it.

    For yet more, see https://www.stata-journal.com/sjpdf....iclenum=dm0042

    Comment


    • #3
      Also, -xtreg- leaves the number of groups used in the estimation sample in e(N_g).

      Comment

      Working...
      X