Announcement

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

  • collapse error

    Dear all,
    I would like to collapse a dataset using the following command.
    ----------------------------------------------------------------------------------------------------------------
    collapse (sum) qty (max) date_of_death, by(pat_id drug supp_date index_date)


    ----------------------------------------------------------------------------------------------------------------
    However, I receive the following error :
    ----------------------------------------------------------------------------------------------------------------
    Click image for larger version

Name:	collapse_error.png
Views:	2
Size:	18.9 KB
ID:	1438209
    ----------------------------------------------------------------------------------------------------------------




    What might cause the error?
    Any help how to deal with this issue is much appreciated.


    Best wishes,
    Oyun
    Attached Files
    Last edited by Buyadaa Oyunchimeg; 08 Apr 2018, 00:38.

  • #2
    Buyadaa:
    please do not post screenshots and use CODE delimiters instead. Thanks.
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Expanding on Carlo's advice, perhaps you have not previously read 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. While you're reading the FAQ, also pay special attention to #12 for instructions on showing code and output bound in code delimiters, and using the dataex command when showing data examples.

      The more you help others understand your problem, the more likely others are to be able to help you solve your problem.

      To assure maximum readability of results that you post, please copy them from the Results window or your log file into a code block in the Forum editor, as explained in section 12 of the Statalist FAQ. You can use the "#" button on the Advanced Editor toolbar, or you can type the code delimiters manually. In either case, for example, the following:

      [code]
      . sysuse auto, clear
      (1978 Automobile Data)

      . describe make price

      storage display value
      variable name type format label variable label
      -----------------------------------------------------------------
      make str18 %-18s Make and Model
      price int %8.0gc Price
      [/code]

      will be presented in the post as the following:
      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . describe make price
      
                    storage   display    value
      variable name   type    format     label      variable label
      -----------------------------------------------------------------
      make            str18   %-18s                 Make and Model
      price           int     %8.0gc                Price

      Comment

      Working...
      X