Announcement

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

  • Counting Cross sections within panel

    I have a set of observations on Institutions and these institutions fall under 3 main organizational categories: 1= Investor owned companies. 2= NGOs and 3= Cooperative organizations. In total I have 630 individual institutions but I would like to know how many organizations represent each category

  • #2
    Kwame:
    you may want to try something along the following lines:
    Code:
    egen flag=tag(institutions)
    tab categories if flag==1
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Carlo already provided the solution to the problem.

      Just as an alternative, after the command - xtset id year - we can type:

      Code:
      xttab institutions
      The results are the same. To check how the results are on the same verge, please see the example below:

      Code:
      .  webuse nlswork
      (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
      
      . egen flag = tag (idcode)
      
      . tab race if flag ==1
      
             race |      Freq.     Percent        Cum.
      ------------+-----------------------------------
            white |      3,329       70.66       70.66
            black |      1,325       28.13       98.79
            other |         57        1.21      100.00
      ------------+-----------------------------------
            Total |      4,711      100.00
      
      .   xtset id year
             panel variable:  idcode (unbalanced)
              time variable:  year, 68 to 88, but with gaps
                      delta:  1 unit
      
      . xttab race
      
                        Overall             Between            Within
           race |    Freq.  Percent      Freq.  Percent        Percent
      ----------+-----------------------------------------------------
          white |   20180     70.72      3329     70.66         100.00
          black |    8051     28.22      1325     28.13         100.00
          other |     303      1.06        57      1.21         100.00
      ----------+-----------------------------------------------------
          Total |   28534    100.00      4711    100.00         100.00
                                    (n = 4711)
      Best regards,

      Marcos

      Comment

      Working...
      X