Stata 15 help for clear

[D] clear -- Clear memory

Syntax

clear

clear [ mata | results | matrix | programs | ado | rngstream ]

clear [ all | * ]

Description

clear, by itself, removes data and value labels from memory and is equivalent to typing

. version 15.1 . drop _all (see [D] drop) . label drop _all (see [D] label)

clear mata removes Mata functions and objects from memory and is equivalent to typing

. version 15.1 . mata: mata clear (see [M-3] mata clear)

clear results eliminates stored results from memory and is equivalent to typing

. version 15.1 . return clear (see [P] return) . ereturn clear (see [P] return) . sreturn clear (see [P] return) . _return drop _all (see [P] _return)

clear matrix eliminates from memory all matrices created by Stata's matrix command; it does not eliminate Mata matrices from memory. clear matrix is equivalent to typing

. version 15.1 . return clear (see [P] return) . ereturn clear (see [P] return) . sreturn clear (see [P] return) . _return drop _all (see [P] _return) . matrix drop _all (see [P] matrix utility) . estimates drop _all (see [R] estimates)

clear programs eliminates all programs from memory and is equivalent to typing

. version 15.1 . program drop _all (see [P] program)

clear ado eliminates all automatically loaded ado-file programs from memory (but not programs defined interactively or by do-files). It is equivalent to typing

. version 15.1 . program drop _allado (see [P] program)

clear rngstream eliminates from memory stored random-number states for all mt64s streams (including the current stream). It resets the mt64s generator to the beginning of every stream, based on the current mt64s seed. clear rngstream does not change the current mt64s seed and stream. The mt64s seed and stream can be set with set seed and set rngstream, respectively.

clear all and clear * are synonyms. They remove all data, value labels, matrices, scalars, constraints, clusters, stored results, sersets, and Mata functions and objects from memory. They also close all open files and postfiles, clear the class system, close any open Graph windows and dialog boxes, drop all programs from memory, and reset all timers to zero. However, they do not call clear rngstream. They are equivalent to typing

. version 15.1 . drop _all (see [D] drop) . label drop _all (see [D] label) . matrix drop _all (see [P] matrix utility) . scalar drop _all (see [P] scalar) . constraint drop _all (see [R] constraint) . cluster drop _all (see [MV] cluster utility) . file close _all (see [P] file) . postutil clear (see [P] postfile) . _return drop _all (see [P] _return) . discard (see [P] discard) . program drop _all (see [P] program) . timer clear (see [P] timer) . putdocx clear (see [P] putdocx) . putpdf clear (see [P] putpdf) . mata: mata clear (see [M-3] mata clear)

Examples

--------------------------------------------------------------------------- Setup . sysuse auto . describe . label list

Drop all data and value labels from memory . clear

Show that data and value labels have been eliminated from memory . describe . label list

--------------------------------------------------------------------------- Setup . sysuse auto . regress price mpg rep78 foreign . summarize price . ereturn list . return list

Eliminate stored results from memory . clear results

Show that stored results have been eliminated from memory . ereturn list . return list ---------------------------------------------------------------------------


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index