Announcement

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

  • Asdoc command does not return value labels in list table

    Hi,

    Since some time the asdoc command does not return the value labels of variables with the list command (I believe it used to before).

    For example;

    Code:
    sysuse auto, clear
    
    asdoc list make foreign , replace
    The output in Stata shows whether a car is "Foreign" or "Domestic":

    48. | Pont. Firebird Domestic |
    49. | Pont. Grand Prix Domestic |
    50. | Pont. Le Mans Domestic |
    51. | Pont. Phoenix Domestic |
    52. | Pont. Sunbird Domestic |
    53. | Audi 5000 Foreign |
    54. | Audi Fox Foreign |
    55. | BMW 320i Foreign |
    56. | Datsun 200 Foreign |


    but in the word file they are either a 0 or 1:
    Pont. Firebird 0
    Pont. Grand Prix 0
    Pont. Le Mans 0
    Pont. Phoenix 0
    Pont. Sunbird 0
    Audi 5000 1
    Audi Fox 1
    BMW 320i 1
    Datsun 200 1
    Anyone an idea on how asdoc will return value labes again (and not their values)?

    Thanks in advance,

    Victor

  • #2
    Dear Victor,

    Thank you for your question. It is a little weird that asdoc doesn't have a simply remedy for this. After looking at the help file, I found that you need to make the table using a decoded version of foreign in this example. This converts the foreign variable into a string which will then be displayed in the table.

    Code:
    sysuse auto, clear
    
    decode foreign, gen(foreign2)
    
    asdoc list make foreign2, replace
    I hope this helps to solve your problem.

    Best,
    Salvatore

    Comment


    • #3
      Dear Salvatore,

      Thank you so much. The issue is resolved.

      Best,

      Victor

      Comment


      • #4
        asdoc is from SSC. It's always a good idea to ping the author Attaullah Shah for his comments on any matter to do with his commands.

        Comment


        • #5
          Salvatore Viola offered an excellent solution. The feature of value labels was recently added to asdocx (the premium version of asdoc), see this page and the following example.
          Code:
          sysuse auto, clear
          asdocx list foreign price rep78 mpg trunk weight in 1/10, label
          Click image for larger version

Name:	label.JPG
Views:	1
Size:	103.8 KB
ID:	1683563
          Regards
          --------------------------------------------------
          Attaullah Shah, PhD.
          Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
          FinTechProfessor.com
          https://asdocx.com
          Check out my asdoc program, which sends outputs to MS Word.
          For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

          Comment

          Working...
          X