Announcement

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

  • Equivalent code in STATA 17

    Hi all,

    I have made some tables to compare characteristics after running a propensity score model in STATA 13.1 as below:

    Code:
    *table binary variable if _weight==1, c(n time5 sum time5 sum _d) row
    _d is a variable created when stsetting, time5 is my 'time to death' variable from survival analysis, and n represents the number of subjects in each group.

    In STATA 17, 'contents' (the little c in the above line of code) is not allowed and the code won't run. I was wondering if anyone would happen to know how to write code in STATA 17 so I could produce tables as I have in STATA 13.1 using the above code?

    Many thanks, Oliver

  • #2
    I am not fluent in the new table syntax but I know that you can continue to use the old syntax in Stata 17 under version control. I can't imagine that if qualifiers are supported differently.

    Code:
    . sysuse auto, clear 
    (1978 automobile data)
    
    . 
    . version 16: table foreign, c(n mpg sum mpg sum weight) row
    
    -------------------------------------------------
    Car       |
    origin    |      N(mpg)     sum(mpg)  sum(weight)
    ----------+--------------------------------------
     Domestic |          52         1031       172490
      Foreign |          22          545        50950
              | 
        Total |          74         1576       223440
    -------------------------------------------------

    Comment

    Working...
    X