Announcement

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

  • Browse if STATA - no error but show nothing in Data Editor

    Hi Guys,

    I try to browse for each category, however, it doesn't show any error code but it doesn't show anything in Data Editor and I sue command count and it shows 17,726 (total of observations).

    Can you please help me why it doesn't show anything?


    . tab AbbrNameProfQualification

    Abbreviated name | Freq. Percent Cum.
    ---------------------+-----------------------------------
    DR | 14 0.08 0.08
    KV | 791 4.47 4.55
    MR | 242 1.37 5.91
    NK | 1,358 7.67 13.58
    PKV | 126 0.71 14.29
    SSS | 1,270 7.17 21.46
    VKV | 320 1.81 23.27
    VS | 1,826 10.31 33.58
    VSS | 11,761 66.42 100.00
    ---------------------+-----------------------------------
    Total | 17,708 100.00

    br if AbbrNameProfQualification == "DR"
    br if AbbrNameProfQualification == "KV"
    ......
    ......
    I doesn't show any error code but it doesn't show anything in Data Editor. Even there is variables in it after tab command. And I use command "count", it shows 17,726 (total of observations).

    It is supposed that "DR" 14, "KV" 791, etc. Please advice.

    Many thanks.
    Waewnet


  • #2
    This is just a guess, but I'm wondering if what is showing up in the -tab- output as "DR", "KV", etc. is actually " DR", " KV", etc. (or some variation on this with blank space padding. What do you see when you type -count if AbbrNameProfQualification == "DR"- Perhaps that shows zero. If so, that would tend to confirm my theory that the values you are seeing in the -tabulate- output are an optical illusion.

    If this is so, then the solution is either to modify your commands so that you also include the blank spaces in them, or, probably better:

    Code:
    replace AbbrNameProfQualification == trim(itrim(AbbrNameProfQualification))
    to eliminate superfluous padding and excessive internal blanks. (Of course, if "DR" and " DR" are both valid and represent different things, then you should not do this.)

    Comment


    • #3
      Hi Clyde,

      Thank you very much for your quick reply. I will try in different way. Next time, I should code them.

      Best,
      Waewnet

      Comment

      Working...
      X