📄 tabulate_oneway.hlp
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help tabulate}, {cmd:help tab1}{...}
{right:dialogs: {bf:{dialog tabulate1:tabulate}}{space 16}}
{right: {bf:{dialog tabulategen:tabulate ..., generate()}}}
{right: {bf:{dialog tab1}}{space 20}}
{hline}
{title:Title}
{p2colset 5 28 30 2}{...}
{p2col:{hi:[R] tabulate oneway} {hline 2}}One-way tables of frequencies{p_end}
{p2colreset}{...}
{title:Syntax}
{pstd}
One-way tables of frequencies
{p 8 17 2}
{cmdab:ta:bulate}
{varname}
{ifin}
{weight}
[{cmd:,} {it:{help tabulate_oneway##tabulate1_options:tabulate1_options}}]
{pstd}
One-way tables for each variable {c -} a convenience tool
{p 8 17 2}
{cmd:tab1}
{varlist}
{ifin}
{weight}
[{cmd:,} {it:{help tabulate_oneway##tab1_options:tab1_options}}]
{marker tabulate1_options}{...}
{synoptset 21 tabbed}{...}
{synopthdr:tabulate1_options}
{synoptline}
{syntab:Main}
{synopt:{opth subpop(varname)}}exclude observations for which {it:varname} = 0{p_end}
{synopt:{opt m:issing}}treat missing values like other values{p_end}
{synopt:{opt nof:req}}do not display frequencies{p_end}
{synopt:{opt nol:abel}}display numeric codes rather than value labels{p_end}
{synopt:{opt p:lot}}produce a bar chart of the relative frequencies{p_end}
{synopt:{opt sort}}display the table in descending order of frequency{p_end}
{syntab:Advanced}
{synopt:{opth g:enerate(varname)}}create indicator variables for {it:varname}{p_end}
{synopt:{opt matcell(matname)}}save frequencies in {it:matname}; programmer's option{p_end}
{synopt:{opt matrow(matname)}}save unique values of {varname} in {it:matname}{p_end}
{synoptline}
{marker tab1_options}{...}
{synopthdr:tab1_options}
{synoptline}
{syntab:Main}
{synopt:{opt m:issing}}treat missing values like other values{p_end}
{synopt:{opt nol:abel}}display numeric codes rather than value labels{p_end}
{synopt:{opt p:lot}}produce a bar chart of the relative frequencies{p_end}
{synopt:{opt sort}}display the table in descending order of frequency{p_end}
{synoptline}
{p2colreset}{...}
{p 4 6 2}
{opt by} may be used with {opt tabulate} and {opt tab1}; see {helpb by}.
{p_end}
{p 4 6 2}
{opt fweight}s, {opt aweight}s, and {opt iweight}s are allowed by
{opt tabulate}. {opt fweight}s are allowed by {opt tab1}. See {help weight}.
{p_end}
{title:Description}
{pstd}
{opt tabulate} produces one-way tables of frequency counts.
{pstd}
For information on two-way tables of frequency counts along with measures of
association, including the common Pearson chi-squared, the likelihood ratio
chi-squared, Cram{c e'}r's V, Fisher's exact test, Goodman and Kruskal's
gamma, and Kendall's tau-b, see {help tabulate twoway}.
{pstd}
{opt tab1} produces a one-way tabulation for each variable specified in {varlist}.
{pstd}
Also see {helpb table} and {helpb tabstat} if you want one-, two-, or n-way
tables of frequencies and a wide variety of statistics. See
{help tabulate summarize} for a description of {opt tabulate} with the
{opt summarize()} option; it produces tables (breakdowns) of means and
standard deviations. {opt table} is better than
{cmd:tabulate, summarize()}, but {cmd:tabulate, summarize()} is faster.
See {help epitab} for 2 x 2 tables with statistics of interest to
epidemiologists.
{title:Options}
{dlgtab:Main}
{phang}
{opth subpop(varname)} excludes observations for which {it:varname} = 0 in
tabulating frequencies. The mathematical results of {cmd:tabulate ..., subpop(myvar)}
are the same as {cmd:tabulate ... if myvar != 0}, but the table may be
presented differently. The identities of the rows and columns will be
determined from all the data, including the {it:myvar} = 0 group, so there may
be entries in the table with frequency 0.
{pmore}
Consider tabulating {opt answer}, a variable that takes on values 1, 2, and 3,
but consider tabulating it just for {cmd:male==1} subpopulation. Assume that
{opt answer} is never 2 in this group. {cmd:tabulate answer if male==1}
produces a table with two rows: one for answer 1 and one for answer 3. There
will be no row for answer 2 because answer 2 was never observed.
{cmd:tabulate answer, subpop(male)} produces a table with three rows. The row
for answer 2 will be shown as having 0 frequency.
{phang}
{opt missing} requests that missing values be treated like other values
in calculations of counts, percentages, and other statistics.
{phang}
{opt nofreq} suppresses the printing of the frequencies.
{phang}
{opt nolabel} causes the numeric codes to be displayed rather than the
value labels.
{phang}
{opt plot} produces a bar chart of the relative frequencies in a
one-way table. (Also see {helpb histogram}.)
{phang}
{opt sort} puts the table in descending order of frequency (and
ascending order of the variable within equal values of frequency).
{dlgtab:Advanced}
{phang}
{opth generate(varname)} creates a set of indicator variables
reflecting the observed values of the tabulated variable.
The {opt generate()} option may not be used with the {opt by} prefix.
{phang}
{opt matcell(matname)} saves the reported frequencies in
{it:matname}. This option is for use by programmers.
{phang}
{opt matrow(matname)} saves the numeric values of the r x 1
row stub in {it:matname}. This option is for use by programmers.
{opt matrow()} may not be specified if the row variable is a string.
{title:Examples}
{phang}{cmd:. tabulate mpgcat}
{phang}{cmd:. tabulate mpgcat, generate(mpg)}
{phang}{cmd:. tabulate region [freq=pop]}
{phang}{cmd:. tab1 sex race age}
{title:Also see}
{psee}
Manual: {bf:[R] tabulate oneway}
{psee}
Online:
{helpb collapse},
{helpb encode},
{help epitab},
{help "svy: tabulate oneway"},
{help "svy: tabulate twoway"},
{helpb table},
{helpb tabstat},
{help tabulate summarize},
{help tabulate twoway},
{helpb xtdes},
{helpb xttab},
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -