Announcement

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

  • can variable labels be forced to be longer than 80 characters?

    Greetings everyone,

    I am an intermediate Stata user become familiarized with it's programming. I am trying to generate variable labels for a survey we did but it is telling me that their is a character limit of 80. I used the following code:

    lab var variable "variable label"

    Is there a way to force the command to make the label longer or is this a limitation of Stata?

  • #2
    Yes, that is a limit. (See -help limits- or -help label-.) However, the -notes- command can often satisfy the desire for a long variable label, since (among other things) it allows a note of length up to 67,784 bytes to be attached to a variable.

    Comment


    • #3
      What would you do with the longer label if it were allowed?

      Comment


      • #4
        Hi Nick,

        We would use the longer label for when we generate graphs to have the entire item presented. We have been trying to shorten it but some items lose their meaning when shortened to below 80 characters.

        Comment


        • #5
          You can copy from notes into graph titles. etc.

          Comment


          • #6
            I also need a way to use longer labels. I am using FRED data. I have a do file (previously written and long) that inserts variable descriptions as labels and later uses the labels as CSV export headers. Some of the newly added variables have descriptions with up to 300 characters. It is generally useful to allow for custom-length labels.

            Comment


            • #7
              #6 is the same question and the answer isn't different. In Stata 17 the limit on variable labels remains 80 characters. Longer strings can, and should, be stored using notes if it's important to keep them with the dataset.

              Comment


              • #8
                Hi all, my situation is similar.

                I was trying to add a two-row description of my variable on my esttab command by including the latex code in the variable label. For example:

                Code:
                lab var myvar "\begin{tabular}{@{}l@{}} My var label in \\ \qquad two rows \end{tabular}"
                But that exceeds the 80-character limit, and thus, I need to find another (probably harder) solution to automate this work.

                Is this a bad use of this functionality? Do you know of an alternative way to do it?
                Thanks!

                Comment


                • #9
                  The variable limit is the variable limit. 80 characters. That has not changed. Your question is somewhat specialized and concerns estout from SSC. I would suggest that you begin a new thread and enclose a reproducible example. See FAQ Advice #12 for details.

                  Comment

                  Working...
                  X