Announcement

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

  • Getting rid of na observables

    Hi,

    How do I get rid of na and scotsup,ms observables please?

    Click image for larger version

Name:	capture.PNG
Views:	1
Size:	16.0 KB
ID:	1506841

  • #2
    Code:
    // Attempt to duplicate Nitu Pun's frequency table
    clear *
    input gpcon n
    -2 55
    -1 332
    0 59757
    26 11218
    52 1729
    78 301
    104 75
    130 14
    156 14
    182 5
    234 1
    end
    
    label define gplabs -2 "na" -1 "scotsup,ms"
    label values gpcon gplabs
    tabulate gpcon [fw=n]
    // Now omit the rows with gpcon < 0
    tabulate gpcon [fw=n] if gpcon >= 0
    Output from last -tabulate- command:

    Code:
    . tabulate gpcon [fw=n] if gpcon >= 0
    
          gpcon |      Freq.     Percent        Cum.
    ------------+-----------------------------------
              0 |     59,757       81.73       81.73
             26 |     11,218       15.34       97.07
             52 |      1,729        2.36       99.44
             78 |        301        0.41       99.85
            104 |         75        0.10       99.95
            130 |         14        0.02       99.97
            156 |         14        0.02       99.99
            182 |          5        0.01      100.00
            234 |          1        0.00      100.00
    ------------+-----------------------------------
          Total |     73,114      100.00

    --
    Bruce Weaver
    Email: [email protected]
    Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
    Version: Stata/MP 18.0 (Windows)

    Comment


    • #3
      Thanks a lot Bruce Weaver

      Comment

      Working...
      X