⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _tab.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
📖 第 1 页 / 共 2 页
字号:
{smcl}
{* 10mar2005}{...}
{cmd:help _tab}{right:also see:  {help undocumented}}
{hline}

{title:Title}

{p 4 14 2}
{hi:_tab} {hline 2} Generating simple tables


{title:Syntax}

{pstd}
Declaring a {cmd:_tab} object:

{p 8 27 2}
{cmd:.}{it:obj} = {cmd:._tab.new} [{cmd:,} {it:options} ]


{pstd}
Setting default parameters:

{p 8 22 2}
{cmd:.}{it:obj}{cmd:.reset} [{cmd:,} {it:options} ]

	{cmd:.}{it:obj}{cmd:.width}{col 26}{...}
{it:width_1} ...   {it:width_k} [{cmd:,} {opt noref:ormat} ]

	{cmd:.}{it:obj}{cmd:.titlefmt}{col 26}{...}
 {it:sfmt_1} ...    {it:sfmt_k}

	{cmd:.}{it:obj}{cmd:.strfmt}{col 26}{...}
 {it:sfmt_1} ...    {it:sfmt_k}

	{cmd:.}{it:obj}{cmd:.numfmt}{col 26}{...}
 {it:nfmt_1} ...    {it:nfmt_k}

	{cmd:.}{it:obj}{cmd:.pad}{col 26}{...}
      {it:#} ...         {it:#}

	{cmd:.}{it:obj}{cmd:.ingore}{col 26}{...}
 {it:item_1} ...    {it:item_k}

	{cmd:.}{it:obj}{cmd:.titlecolor}{col 26}{...}
{it:color_1} ...   {it:color_k}

	{cmd:.}{it:obj}{cmd:.strcolor}{col 26}{...}
{it:color_1} ...   {it:color_k}

	{cmd:.}{it:obj}{cmd:.numcolor}{col 26}{...}
{it:color_1} ...   {it:color_k}


{pstd}
Displaying table elements:

{pmore}
{cmd:.}{it:obj}{cmd:.sep}
	[{cmd:,} {opt t:op} {opt m:iddle} {opt b:ottom} ]

	{cmd:.}{it:obj}{cmd:.titles}{col 24}{...}
  {it:title_1} ...   {it:title_k}

	{cmd:.}{it:obj}{cmd:.row}{col 24}{...}
{it:element_1} ... {it:element_k}


{p2colset 9 31 35 2}{...}
{p2col :{it:options}}description{p_end}
{p2line}
{p2col :{opt w:idth(#)}}default column width; default is 12{p_end}
{p2col :{opt col:umns(#)}}number of columns; default is 2{p_end}
{p2col :{opt lm:argin(#)}}left margin; default is 2{p_end}
{p2col :{opt tc:olor(color)}}default
	color for titles; default is {opt text}{p_end}
{p2col :{opt nc:olor(color)}}default
	color for numbers; default is {opt input}{p_end}
{p2col :{opt sc:olor(color)}}default
	color for strings; default is {opt text}{p_end}
{p2col :{opt lc:olor(color)}}color
	of the separator lines; default is {opt text}{p_end}
{p2col :{opt tf:mt(sfmt)}}default title format{p_end}
{p2col :{opt nf:mt(nfmt)}}default numeric format{p_end}
{p2col :{opt sf:mt(sfmt)}}default string format{p_end}
{p2col :{opt nocom:mas}}do
	not use comma in default numeric formats; default behavior{p_end}
{p2col :{opt com:mas}}use comma in default numeric formats{p_end}
{p2col :{opt ig:nore(item)}}ignore
	{it:item} if supplied as an argument to {cmd:.row}{p_end}
{p2col :{opt sep:arator(#)}}automatically
	separate every {it:#} rows; default is 0, no separator{p_end}
{p2col :{opt clear(clear_options)}}clear the specified parameters{p_end}
{p2col :{opt clear}}synonym for {cmd:clear(all)}{p_end}
{p2line}

{p2col :{it:clear_options}}description{p_end}
{p2line}
{p2col :{opt w:idths}}clear the column widths{p_end}
{p2col :{opt tc:olors}}clear the title colors{p_end}
{p2col :{opt nc:olors}}clear the number colors{p_end}
{p2col :{opt sc:olors}}clear the string colors{p_end}
{p2col :{opt tf:mts}}clear the title formats{p_end}
{p2col :{opt nf:mts}}clear the number formats{p_end}
{p2col :{opt sf:mts}}clear the string formats{p_end}
{p2col :{opt p:addings}}clear the column paddings{p_end}
{p2col :{opt v:separators}}remove the vertical separators{p_end}
{p2col :{opt row:s}}reset the row counter to zero{p_end}
{p2col :{opt c:olumns}}reset the column starting positions{p_end}
{p2col :{opt f:mts}}reset the default formats{p_end}
{p2col :{opt all}}shortcut for specifying all the above{p_end}
{p2line}

{p2col :column arguments}description{p_end}
{p2line}
{p2col :{it:width_#}}column width{p_end}
{p2col :{it:title_#}}column title{p_end}
{p2col :{it:nfmt_#}}numeric format; see {helpb format}{p_end}
{p2col :{it:sfmt_#}}string format; see {helpb format}{p_end}
{p2col :{it:color_#}}{opt text} (or {opt txt}),
	{opt err:or}, {opt res:ult}, or {opt inp:ut}{p_end}
{p2col :{it:item_#}}string or value, including a missing value{p_end}
{p2col :{it:element_#}}quoted string or expression{p_end}
{p2line}
{p2colreset}{...}

{pstd}
Note when the column argument is {cmd:.} or {cmd:""}, the default value is
used.  For {it:element_#} in {cmd:.row}, {cmd:""} (the empty string) causes
nothing to be displayed for the specific column, but {cmd:.} is interpreted as
a missing value resulting from an expression.


{title:Description}

{pstd}
{cmd:_tab} is a programmers tool for generating simple tables.  Generating a
table using an object from class {cmd:_tab} involves several steps:

{phang}
1.  Create an object from class {cmd:_tab}.

{pmore}
{cmd:_tab.new} returns an object from class {cmd:_tab}.  To create a
{cmd:_tab} object, type the following:

{pmore2}
{cmd:.}{it:obj} = {cmd:._tab.new}

{pmore}
where {it:obj} is a name of your choosing.

{phang}
2.  Set the default table parameters (this could also have been done with
{cmd:._tab.new}).

{pmore}
{cmd:.reset} changes the table parameters.  For example,

{pmore2}
{cmd:.}{it:obj}{cmd:.reset, columns(7) lmargin(0)}

{pmore}
changes the number of columns in {cmd:.}{it:obj} to 7 and removes the left
margin.  This matches the number of columns produced by
{helpb ereturn display}.

{phang}
3.  Set the individual column widths.

{pmore}
{cmd:.width} sets the widths for each individual column.
{cmd:.width} requires an argument for each column.
To set column widths that match those produced by
{cmd:ereturn} {cmd:display}, type

{pmore2}
{cmd:.}{it:obj}{cmd:.width 13 |. . 8 8 . .}

{pmore}
The first column is now 13 characters wide, the fourth and fifth columns are
now 8 characters wide, and the other columns remain at 12 characters (the
default width).
Notice the vertical bar ({cmd:|}) specified between the first and second
column widths, this indicates that the first and second columns are to be
separated by a vertical line.

{pmore}
By default, {cmd:.width} will generate a default title, numeric, and string
format for each column; the {opt noreformat} option prevents this.

{phang}
4.  Set the title format for each column.

{pmore}
{cmd:.titlefmt} sets the string format for the title of each
individual column.
{cmd:.titlefmt} requires an argument for each column.
To set title formats that match those of {cmd:ereturn}
{cmd:display}, type 

{pmore2}
{cmd:.}{it:obj}{cmd:.titlefmt . . . %6s . %24s .}

{pmore}
The fourth column title (for the {it:t} or {it:z} statistic) has format %6s,
leaving 2 extra spaces to the right of the title, the sixth column title
format is stretched to consume the seventh column title, and the other formats
remain as they were set.

{pmore}
Note:  The {cmd:.width} routine will reset the individual title
formats to {cmd:%}{it:w}{cmd:s}, where {it:w} is one less than the column
width; {cmd:.titlefmt} should be used after {cmd:.width}.

{phang}
5.  Set the string format for each column.

{pmore}
{cmd:.strfmt} sets the string format for each individual column.
{cmd:.strfmt} requires an argument for each column.
To set string formats that match those of {cmd:ereturn}
{cmd:display}, type 

{pmore2}
{cmd:.}{it:obj}{cmd:.strfmt . . . . . . .}

{pmore}
Actually, in this case we didn't even have to use {cmd:.strfmt}
because the only string {cmd:ereturn} {cmd:display} prints in the table body
is the name of the coefficient, and the default string format already matches.

{pmore}
Note:  The {cmd:.width} routine will reset the individual string
formats to {cmd:%}{it:w}{cmd:s}, where {it:w} is one less than the column
width; {cmd:.strfmt} should be used after {cmd:.width}.

{phang}
6.  Set the number format for each column.

{pmore}
{cmd:.numfmt} sets the numeric format for each individual column.
{cmd:.numfmt} requires an argument for each column.
To set numeric formats that match those of {cmd:ereturn}
{cmd:display}, type 

{pmore2}
{cmd:.}{it:obj}{cmd:.numfmt . %9.0g %9.0g %7.2f %5.3f %9.0g %9.0g}

{pmore}
Note:  The {cmd:.width} routine will reset the individual numeric
formats to {cmd:%}{it:w}{cmd:.0g}, where {it:w} is one less than the column
width; {cmd:.numfmt} should be used after {cmd:.width}.

{phang}
7.  Set the padding for numeric formats for each column.  The default numeric
formats use up all but the last space of each column.  In order to keep smaller
numeric formats right justified within a column, the column must have padded
spaces on the left.

{pmore}
{cmd:.pad} sets the padding spaces associated with the numeric format
for each individual column.
{cmd:.pad} requires an argument for each column.
To set paddings that match those of {cmd:ereturn}
{cmd:display}, type 

{pmore2}
{cmd:.}{it:obj}{cmd:.pad . 2 1 . 2 3 3}

{phang}
8.  Set the ignore item for each column.

{pmore}
{cmd:.ignore} sets the item to be ignored for each column.  Typically this
would be one of the missing value codes, but it could be a string such as
"NA".  This setting is most useful when the table elements were build up and
placed into a matrix where one or more values (usually missing) identify
empty cells.

{phang}
9.  Set the title color for each column.

{pmore}
{cmd:.titlecolor} sets the color for the title of each
individual column.
{cmd:.titlecolor} requires an argument for each column.
The default title color is {opt text}, which already matches that of
{cmd:ereturn} {cmd:display}.  To make the title of the first column
{opt result}, type

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -