|
Size: 1889
Comment:
|
← Revision 3 as of 2025-10-24 17:24:52 ⇥
Size: 2050
Comment: Rewrite
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| the '''`list`''' command lists data. | '''`-list-`''' lists data. |
| Line 23: | Line 23: |
| == Data Formats == | == Display Formats == `-list-` shifts between two output modes based on the width of the output, and on the width of the screen. '''Table format''' is as a columnar table. '''Display format''' is a list of cells that wraps indefinitely across rows. |
| Line 29: | Line 31: |
| The `list` command examines data to (re-)allocate text width. If the longest value for a string variable with format `%18s` is 12 characters long, then `list` will only allocate 12 columns for that variable. This behavior can be disabled using the '''`nocompress`''' option. | `-list-` examines values to allocate the screen's width across columns. If the longest value for a string variable with format `%18s` is 12 characters long, then `-list-` will only allocate 12 columns for that variable. This behavior can be disabled using the '''`nocompress`''' option. |
| Line 43: | Line 45: |
| The `list` command shifts between two output modes based on the width of the output, and on the width of the screen. | In table format, string values are always right-justified. |
| Line 45: | Line 47: |
| In '''table format''', the `list` command right-justifies all string values. In '''display format''', string values are aligned according to the display format. A string value would be left-justified if the variable had a format of `%-18s`. |
In display format however, string values are aligned according to the display format. A string value would be left-justified if the variable had a format of `%-18s`. |
| Line 53: | Line 53: |
| The `list` command abbreviates variable names; by default to 8 characters. To increase that limit, try: | Variable names are abbreviated to 8 characters. To increase that limit, try: |
| Line 63: | Line 63: |
| The `list` command displays labels (as opposed to values) when available. To override this behavior, use the '''`nolabel`''' option. | Value labels (as opposed to values themselves) are displayed. To override this behavior, use the '''`nolabel`''' option. |
| Line 66: | Line 66: |
---- == See also == [[https://www.stata.com/manuals/dlist.pdf|Stata manual for -list-]] |
Stata List
-list- lists data.
Contents
Usage
list foo bar baz list foo bar baz in 1/10 list foo if bar==baz
Display Formats
-list- shifts between two output modes based on the width of the output, and on the width of the screen. Table format is as a columnar table. Display format is a list of cells that wraps indefinitely across rows.
String Length and Truncation
-list- examines values to allocate the screen's width across columns. If the longest value for a string variable with format %18s is 12 characters long, then -list- will only allocate 12 columns for that variable. This behavior can be disabled using the nocompress option.
Note that the default behavior has an impact on performance, especially for large datasets. As such, there is a fast option which is simply an alias for nocompress.
To truncate string values to an explicit length, try:
list comment, string(10)
String Alignment
In table format, string values are always right-justified.
In display format however, string values are aligned according to the display format. A string value would be left-justified if the variable had a format of %-18s.
Variable Name Length and Truncation
Variable names are abbreviated to 8 characters. To increase that limit, try:
list very_long_variable_name, abbreviate(50)
Value Labels
Value labels (as opposed to values themselves) are displayed. To override this behavior, use the nolabel option.
Value labels are aligned in the same way as string values; based on the output mode and the display format. Just as a string value would be left-justified if the variable had a format of %-18s, a label would be justified if the variable had a format of %-8g.
