Announcement

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

  • 'table' command in version 16 to version 17

    This should be a simple issue but I couldn't figure out in version 17.

    I had this command in version 16 with all string variables:
    table COLLEGE FT_PT LEVL, by(TERM) column row
    where COLLEGE is different colleges, FT_PT is full-time or part-time, and LEVL is undergraduate or graduate.

    now version 17 says that
    option by() not allowed since Stata 17
    string variables not allowed in layout

    would you guide me what command I need version 17 to get a similar n-table with string variables?
    Thank you in advance.

  • #2
    You should still have version control. I don't have version 17 to tell you what other options are.

    Code:
    version 16: table COLLEGE FT_PT LEVL, by(TERM) column row

    Comment


    • #3
      Thank you, Andrew. It works.
      Doesn't version 17 support n-table with string variables using 'table' command anymore? 'table' command is one of my favorites and it is useful for lots of daily ad-hoc requests.

      Comment


      • #4
        I couldn't tell you as I have no access to version 17. In any case, this thread is open to others who may know the answer to your question.

        Comment


        • #5
          Stata 17 does not appear to support string variables anymore. The typical way around this is to encode this information into a labelled numeric variable. Beyond that, I haven't spent much time trying to learn the new table command.

          Comment


          • #6
            Code:
            program table16 
                version 16 : table `0' 
                end
            is an example of how you can have your own work-around.

            Comment


            • #7
              Nick has provided a nice workaround. I should have clarified that I was referring to the "reimagined" table command (which runs collect under the hood).

              Comment


              • #8
                Thank you Leo and Nick!
                So I tried to understand the fancy and concise code Nick provided. How does table `0' work in program ~ end? Specifically, what does `0' mean if you don't mind?

                Comment


                • #9
                  Nick's program provides a simple alternative to using version control. So the following two lines are perfectly equivalent:

                  Code:
                  version 16: table  ....
                  table16 ...
                  Inside of Stata programs, all the text following the command name is stored in an automatic macro called "0". So you can think of Nick's code as performing a kind of copy-paste procedure. If Stata programming interests you, there's a whole Programming manual included with the Stata documentation for you.

                  Comment


                  • #10
                    Thank you again, Leo. That explains a lot!

                    Comment


                    • #11
                      I find this very disappointing. One cannot use all the new capabilities of the Stata 17 -table- command without creating value labels for all categorical string variables. Furthermore, one cannot even use the old -table- command without the version 16 modifier or Nick's trick Makes me wonder why I bothered to listen to the webinar on -table- and -collect-. Is there no hope that Stata Corp. will eventually update -table-to allow string variables?

                      Comment


                      • #12
                        There is hope, and I can't say exactly when this will happen, but we do intend to make table support string variables in rowspec, colspec, and tabspec for Stata 17.

                        Comment


                        • #13
                          It would be helpful if -table- (version 17) would leave the scalar r(N) behind (as did -table- up to version 16.1).

                          Comment


                          • #14
                            Another REALLY annoying aspect of table (version 17): a variable formatted as %d when tabled does not display the date - instead showing the numerical version of the same

                            (3 versions shown below -- tabulate; table (version 17) and table (version 16))

                            Seems that they have dropped the ball here.

                            .
                            Click image for larger version

Name:	stata.PNG
Views:	1
Size:	52.4 KB
ID:	1612234

                            Comment


                            • #15
                              Dirk Enzmann we will make table post r(N) in the next update to Stata 17.

                              Tom Moultrie thank you for pointing this out. We will try to add this header formatting feature back to table in a future update to Stata 17.

                              Comment

                              Working...
                              X