help tabulate, summarize() dialog: tabulate, summarize()
-------------------------------------------------------------------------------
Title
[R] tabulate, summarize() -- One- and two-way tables of summary
statistics
Syntax
tabulate varname1 [varname2] [if] [in] [weight] [, options]
options description
-------------------------------------------------------------------------
Main
summarize(varname3) report summary statistics for varname3
[no]means include or suppress means
[no]standard include or suppress standard deviations
[no]freq include or suppress frequencies
[no]obs include or suppress number of observations
nolabel show numeric codes, not labels
wrap do not break wide tables
missing treat missing values of varname1 and varname2 as
categories
-------------------------------------------------------------------------
by is allowed; see [D] by.
aweights and fweights are allowed; see weight.
Menu
Statistics > Summaries, tables, and tests > Tables > One/two-way table of
summary statistics
Description
tabulate, summarize() produces one- and two-way tables (breakdowns) of
means and standard deviations. See [R] tabulate oneway and [R] tabulate
twoway for one- and two-way frequency tables. See [R] table for a more
flexible command that produces one-, two-, and n-way tables of
frequencies and a wide variety of summary statistics. table is better
but tabulate, summarize() is faster. Also see [R] tabstat for yet
another alternative.
Options
+------+
----+ Main +-------------------------------------------------------------
summarize(varname3) identifies the name of the variable for which summary
statistics are to be reported. If you do not specify this option, a
table of frequencies is produced; see [R] tabulate oneway and [R]
tabulate twoway. This description concerns tabulate when this option
is specified.
[no]means includes or suppresses only the means from the table.
The summarize() table normally includes the mean, standard deviation,
frequency, and, if the data are weighted, number of observations.
Individual elements of the table may be included or suppressed by the
[no]means, [no]standard, [no]freq, and [no]obs options. For example,
typing
. tabulate category, summarize(myvar) means standard
produces a summary table by category containing only the means and
standard deviations of myvar. You could also achieve the same result
by typing
. tabulate category, summarize(myvar) nofreq
[no]standard includes or suppresses only the standard deviations from the
table; see [no]means option above.
[no]freq includes or suppresses only the frequencies from the table; see
[no]means option above.
[no]obs includes or suppresses only the reported number of observations
from the table. If the data are not weighted, the number of
observations is identical to the frequency, and by default only the
frequency is reported. If the data are weighted, the frequency
refers to the sum of the weights. See [no]means option above.
nolabel causes the numeric codes to be displayed rather than the label
values.
wrap requests no action be taken on wide tables to make them readable.
Unless wrap is specified, wide tables are broken into pieces to
enhance readability.
missing requests that missing values of varname1 and varname2 be treated
as categories rather than as observations to be omitted from
analysis.
Examples: one-way tables
---------------------------------------------------------------------------
. sysuse auto
. tabulate foreign, summarize(mpg)
---------------------------------------------------------------------------
. sysuse census
. tabulate region [aweight=pop], summarize(medage)
---------------------------------------------------------------------------
Examples: two-way tables
. sysuse auto
. tabulate foreign rep78, summarize(mpg)
. generate wgtcat = autocode(weight, 4, 1760, 4840)
. tabulate wgtcat foreign, summarize(mpg)
. tabulate wgtcat foreign, summarize(mpg) means
. tabulate wgtcat foreign, summarize(mpg) nofreq
Also see
Manual: [R] tabulate, summarize()
Help: [D] collapse, [SVY] svy: tabulate oneway, [SVY] svy: tabulate
twoway, [R] table, [R] tabstat, [R] tabulate oneway, [R]
tabulate twoway