Stata 11 help for display

help display dialog: display -------------------------------------------------------------------------------

Title

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

Syntax

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(#) , ,,

Menu

Data > Other utilities > Hand calculator

Description

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.

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 code #

, displays one blank between two directives

,, places no blanks between two directives

Examples

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)

Also see

Manual: [R] display, [P] display

Help: [P] capture, [D] format, [D] list, [D] outfile, [P] quietly, [P] return, [P] smcl


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