Announcement

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

  • Error when using -summtab-

    Hi!

    I use Stata 15 on a Windows PC (Word 2013), and I am trying to make a descriptive table with the user-written –summtab- (John Gallis). After running the code:

    Code:
    summtab, by(PCT_5mC_cat) cont_vars(PCT_5mC As_ug_L Cd_ug_L Hg_ug_L Mn_ug_L Pb_ug_L Se_ug_L Maternal_age) cat_vars(Maternal_edu Sex Parity) mean pmiss incmiss total landscape replace wordname(summary_table) title(Table 1)
    I get the error message:
    Code:
    too few quotes
    r(132);
    I also tried to use summtab with the auto dataset. This happened:
    Code:
    summtab, by(foreign) cont_vars(price mpg weight length) cat_vars(rep78) mean median landscape replace
    
    invalid specification; row misspecified
    r(198);
    Does anoyone have any idea what is going on here?



    Best regards,

    Kjell Vegard Weyde

  • #2
    Kjell:
    as far as your second code is concerned, I was not able to replicate the error message Stata gave you back:
    Code:
    . summtab, by(foreign) cont_vars(price mpg weight length) cat_vars(rep78) mean median landscape replace
    
    Table 'table1.docx' created in current working directory.
    However, I have had to install -distinct- from SSC to make the user-written programme -summtab- works.

    A second thought: is your Stata software fully updated?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      distinct should be cited as coming from the Stata Journal:


      Code:
      SJ-15-3 dm0042_2  . . . . . . . . . . . . . . . . Software update for distinct
              (help distinct if installed)  . . . . . .  N. J. Cox and G. M. Longton
              Q3/15   SJ 15(3):899
              improved table format and display of large numbers of
              observations
      
      SJ-12-2 dm0042_1  . . . . . . . . . . . . . . . . Software update for distinct
              (help distinct if installed)  . . . . . .  N. J. Cox and G. M. Longton
              Q2/12   SJ 12(2):352
              options added to restrict output to variables with a minimum
              or maximum of distinct values
      
      SJ-8-4  dm0042  . . . . . . . . . . . .  Speaking Stata: Distinct observations
              (help distinct if installed)  . . . . . .  N. J. Cox and G. M. Longton
              Q4/08   SJ 8(4):557--568
              shows how to answer questions about distinct observations
              from first principles; provides a convenience command
      The version on SSC is not maintained.

      Comment


      • #4
        Nick:
        thanks for the update.
        However, after my first attempt to run -summtab- Stata gave me back what follows:
        Code:
        . summtab, by(foreign) cont_vars(price mpg weight length) cat_vars(rep78) mean median landscape replace
        Please install package distinct from SSC in order to run this program;
        you can do so by clicking this link: auto-install distinct
        r(499);
        Admittedly, my mention of -SSC- was conditioned on the error text.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          I will send a note to the author.

          Comment


          • #6
            Thanks, Nick.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Kjell has emailed me directly and I'm working with him on the issue. I'll let everyone know of the outcome here once we figure out what's going on. In the meantime, I have updated summtab so that it no longer relies on "distinct", and plan to upload the updated version within the next month or so.

              Comment


              • #8
                For the error r(132), this may be a system issue, although I've noticed in the past an error when there are too many categories in the "by" variable. I will look into this.

                For the error r(198): unfortunately, since this error shows up for some people and not for most (see also my discussion here: https://www.statalist.org/forums/for...tables-table-1), it appears to be a system-specific issue with part of the putdocx call within summtab, rather than a bug in my code. However, I'm not sure what system setting is causing the issue. (Please make sure your Stata 15 is up-to-date, though.) I've examined the log files of those having issues with the code, and I cannot figure it out, since most people who run the exact same code do not have the error.

                So, for next steps, I will plan to update summtab so that it allows the export of Excel tables only (which relies on putexcel rather than putdocx). Currently, summtab does not allow only exporting Excel tables, so putdocx must be used when using summtab. Realistically, this update will not occur until March. In the meantime, everyone having this issue may need to run the code on another computer with Stata or do without summtab for now. Hopefully whatever is going on with system compatibility with putdocx will be fixed as Stata updates in the future.

                Comment


                • #9
                  New version of summtab is now online (thanks, again, to Kit Baum). This version removes the dependence on the distinct package, and allows for outputting only an Excel file. Outputting only an Excel file will avoid the use of putdocx, which appears to be causing issues for some users. Please let me know if you have any questions.

                  Comment

                  Working...
                  X