Announcement

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

  • Why do we use , clear ??

    Hello Everyone! I am totally new to STATA... and for all of you this might be a dumb question...
    but sometimes I see people including ,clear at the end of their code... can someone tell me why?? To me,, it doesn't seem to be a difference between including ,clear or not...

  • #2
    The output of help use explains the difference.

    clear specifies that it is okay to replace the data in memory, even though the current data have not
    been saved to disk.
    Here's a demonstration.
    Code:
    . use gnxl
    
    . sysuse auto
    (1978 Automobile Data)
    
    . use gnxl
    
    . generate y = x+1
    
    . sysuse auto
    no; dataset in memory has changed since last saved
    r(4);
    
    . sysuse auto, clear
    (1978 Automobile Data)
    
    .
    It's always good to start with the help command when you have a question about why a command works the way it does. It would have gotten you an answer an hour earlier, in this case.

    Comment

    Working...
    X