Stata 15 help for display

[P] display -- Display strings and values of scalar expressions


display [display_directive [display_directive [...]]]

where display_directive is

"double-quoted string" `"compound double-quoted string"' [%fmt] [=]exp as { text | txt | result | error | input } in smcl _asis _skip(#) _column(#) _newline[(#)] _continue _dup(#) _request(macname) _char(#) , ,,


Data > Other utilities > Hand calculator


display displays strings and values of scalar expressions. display produces output from the programs that you write.

Interactively, display can be used as a substitute for a hand calculator; see [R] display. You can type things such as display 2+2.


display's display_directives are used in do-files and programs to produce formatted output. The directives are

"double-quoted string" displays the string without the quotes

`"compound double-quoted string"' display the string without the outer quotes; allows embedded quotes

[%fmt] [=] exp allows results to be formatted; see [U] 12.5 Formats: Controlling how data are displayed

as style sets the style ("color") for the directives that follow; there may be more than one as style per display

in smcl switches from _asis model to smcl mode

_asis switches from smcl model to _asis mode

_skip(#) skips # columns

_column(#) skips to the #th column

_newline goes to a new line

_newline(#) skips # lines

_continue suppresses automatic newline at end of display command

_dup(#) repeats the next directive # times

_request(macname) accepts input from the console and places it into the macro macname

_char(#) displays the character for ASCII and extended ASCII code #, where # > 127 is treated as a Latin1-encoded character and will be converted to the corresponding UTF-8 character

, displays one blank between two directives

,, places no blanks between two directives


As a hand calculator:

. display 2 + 2

As might be used in do-files and programs:

. sysuse auto . summarize mpg . display as text "mean of mpg = " as result r(mean)

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