Announcement

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

  • Simple commands not working....wonder why (Stata/IC 15.1)

    Hi,

    I wanted to run a simple command for moving one of my variables called "comment" to the end of my dataset. I picked this command verbatim from the Stata User Manual. When I tried, this is what I get:

    . order comment [,last] (**without space)
    weights not allowed
    r(101);

    . order comment [, last] (**with space between comma and last)
    weights not allowed


    For both variants of the "order" command, I get an error saying weights not allowed. I get the same error when I use this command with multiple variables:


    . order gvkey cusip coname ticker execid co_per_rol exec_fullname nameprefix exec_fname exec_mname exec_lname gender pag
    > e age joined_co PrevExp title year titleann ceoann execrank execrankann salary bonus becameceo pceo PositionTenure le
    > ftofc leftco reason rejoin releft [,first]
    weights not allowed


    What may be going wrong?



    Regards,

    Tushar
    Last edited by Tushar Shah; 12 Jun 2020, 17:45.

  • #2
    do not use square brackets except when you have actual weights - here "first" and "last" are options and that is why they are in brackets in at least some documentation but the brackets in that case just mean they are options; if you actually use the option, as you did, you do not type the brackets

    Comment


    • #3
      It would help you to read at least the start of chapter 10 of the Getting Started with Stata PDF included with your Stata installation and accessible from Stata's Help menu. That explains Stata command syntax.

      When I began using Stata in a serious way, I started - as others here did - by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. All of these manuals are included as PDFs in the Stata installation and are accessible from within Stata - for example, through Stata's Help menu. The objective in doing this was not so much to master Stata as to be sure I'd become familiar with a wide variety of important basic techniques, so that when the time came that I needed them, I might recall their existence, if not the full syntax, and know how to find out more about them in the help files and manual.

      Stata supplies exceptionally good documentation that amply repays the time spent studying it - there's just a lot of it. The path I followed surfaces the things you need to know to get started in a hurry and to work effectively.


      Comment

      Working...
      X