Announcement

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

  • reshape - variable x1-xn implied name too long

    Dear all,

    I am facing a problem with the comand reshape long because the name of many variables is too long (up to 15 digits). I have 3 rounds datasets and i want to construct a panel but everytime i run the camand stata turns the same error and since i have more than 100 vars for each round I was wondering if there is a way of making STATA to accept such long names.

    Thank you in advance

    Federica

  • #2
    I think the short answer to your specific question is no, there is no way to exceed Stata's variable name limit of 32 characters.

    But, I'm not entirely sure how reshaping a 15 character variable name results in a variable name exceeding the 32 character limit (are the values more than 15 digits?). Perhaps you can provide specific examples, the code you are using (within code delimiters), and sample data (using dataex--see FAQ #12).

    Is renaming the current variables out of the question?
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      Federica:
      you do not provide the list with an excerpt of your dataset, so it is difficult (for me, at least) to comment on your query positively.
      The first Stata command that I would consider in your instance is -foreach- to try to loop over observations and reduce (if feasible) their names.

      PS: Cyber-crossed with Carole's reply.
      Last edited by Carlo Lazzaro; 20 Apr 2016, 07:03.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        We can better help you if we know what commands you have tried and what Stata told you to indicate that there was a problem. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ.

        PS - Crossed in cyberspace with both Carlo's and Carole's replies.

        Comment


        • #5
          Thank you all for your message...eventually i have discovered that it was the problem of few vars and I have changed the name.
          Thanks again
          Federica

          Comment


          • #6
            Hello,

            I have a similar problem, but my understanding of why I get this error is probably limited. In fact, Stata says my "excessively long names" would be in "the 1968' variables". Let me show you:

            Click image for larger version

Name:	dele.JPG
Views:	2
Size:	27.6 KB
ID:	1527356


            However, here's my brief list of variables for 68: ER1968 RELNUM1968 PERSID1968 REL1968 FAMINC1968 EMPH1968 RSHD1968 NCHILD1968 REL2HD1968 EDU1968

            How can these names be too long? Theoretically, the suffix _1968 should be also taken away in the RESHAPE LONG process, so the names would be even shorter, no?
            Thanks in advance,

            Francesco

            Comment


            • #7
              where did the period in the ".1968" error message come from? periods are not allowed in variable names and you don't show enough for me to figure out what is going on

              Comment


              • #8
                Originally posted by Rich Goldstein View Post
                where did the period in the ".1968" error message come from? periods are not allowed in variable names and you don't show enough for me to figure out what is going on

                Apologies.

                Probably my naivete, but I don't understand your doubt. What do you need to know more?

                My database is in wide format, with time running horizontally and variables (columns) having suffix #### ( = year), that is needed in order for reshape to run (and create the additional variable j = years).

                It starts in 1968, and in my previous post I included the list of variables that are likely generating this error.

                Thanks a lot for your reply, please let me know how can I provide more info.

                Comment

                Working...
                X