Announcement

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

  • Error using estpost and esttab command

    Hi

    I am using estout module. When using following command it give error "invalid syntax in not found'. Same syntax works fine on my friend PC. Please see output below. Any suggestion will be appreciated.

    estpost svy linearized, subpop(if sex == 1): tabulate type2_dm agec6, row percent
    esttab . using 2014.csv, cell("b(f(4)) lb ub se") plain unstack varlabels(`e(labels)') eqlabels(`e(eqlabels)') title(FI, by age in males) addnote ("Source: new 2014")





  • #2
    I do not recognize the syntax of the title option you specified
    Code:
    title(FI, by age in males)
    If I understand the help estout results from my installation of the latest version of estout (20170202) the argument should be a simple string, e.g.
    Code:
    title("by age in males")
    Or did you mean to specify a font
    Code:
    title("\f1 by age in males")
    To improve your future posts to Statalist, please take the time to 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. Note especially sections 9-12 on how to best pose your question. In particular, posting screen shots of Stata commands, data, or output is discouraged for reasons explained in the FAQ.

    Comment


    • #3
      I meant the code
      title("by age in males")

      I tried the syntax by replacing with above code and even deleting this part from the syntax. I still get the following error

      invalid syntax
      in not found
      r(111);

      end of do-file

      Comment


      • #4
        Hi

        I found that it gives this error for some variables but not for others.For example if I run the same syntax for for other variable than type2_dm in the above example, syntax runs fine.

        Any suggestion?

        Comment


        • #5
          This probably isn't the answer, based on your screen shot, but it still may be worth a try. The key, to me, is that if it depends on the variable, it's probably a function of the variable labels in e(labels) and e(eqlabels).

          The discussion of svy tabulate in the output of help estpost tells us that e(labels) and e(eqlabels) are not always created; to ensure they are created you need to use the elabels option on the command. Experimentation shows that when they are created, svy tablulate includes information about them in the output following the list of saved vectors. That does not appear in your screenshot.

          In case this doesn't solve your problem, include the command
          Code:
          ereturn list
          following the estpost command. That will tell you what is stored the two returned macros. Perhaps that will indicate the source of the problem.

          Comment


          • #6
            Thanks for the reply. It did not resolve the issue. Same syntax works fine on my friend's same Stata version. The syntax also works for some variables on my PC's Stata.

            Comment


            • #7
              I am having a similar problem. For me this problem seems to be related to apostrophe's in variable labels. My solution was to relabel all variables making sure to use no apostrophes. I suspect a more savvy individual would be able to solve this problem with something like nested quotation marks, but I haven't been successful with that thus far.

              In your case, it may work to change "Don't know" to "Do not know".

              Comment

              Working...
              X