Announcement

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

  • how could the difference of number of a variable in a panel data be shown in stata

    hello,
    i want to see how many people' living status(dummy variable) have been changed using a 2-period panel data?
    what command should i use?

    thank you

  • #2
    Yiwen:
    welcome to this forum.
    You may want to consider something along the following lines:
    Code:
    . use "https://www.stata-press.com/data/r17/nlswork.dta"
    (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
    
    . xttrans msp if year<=69, freq
    
          1 if |
      married, | 1 if married, spouse
        spouse |        present
       present |         0          1 |     Total
    -----------+----------------------+----------
             0 |       396        105 |       501
               |     79.04      20.96 |    100.00
    -----------+----------------------+----------
             1 |        30        320 |       350
               |      8.57      91.43 |    100.00
    -----------+----------------------+----------
         Total |       426        425 |       851
               |     50.06      49.94 |    100.00
    
    .
    See -xttab- entry, Stata .pdf manual for further details.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Mr. Lazzaro , thank you for your speedy answer!
      problem's solved by using the code you suggested.

      Comment

      Working...
      X