**[R] summarize** -- Summary statistics

__Syntax__

__su__**mmarize** [*varlist*] [*if*] [*in*] [*weight*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Main
__d__**etail** display additional statistics
__mean__**only** suppress the display; calculate only the mean;
programmer's option
__f__**ormat** use variable's display format
__sep__**arator(***#***)** draw separator line after every *#* variables; default is
**separator(5)**
*display_options* control spacing, line width, and base and empty cells

-------------------------------------------------------------------------
*varlist* may contain factor variables; see fvvarlist.
*varlist* may contain time-series operators; see tsvarlist.
**by**, **rolling**, and **statsby** are allowed; see prefix.
**aweight**s, **fweight**s, and **iweight**s are allowed. However, **iweight**s may not
be used with the **detail** option; see weight.

__Menu__

**Statistics > Summaries, tables, and tests >** **Summary and descriptive**
**statistics > Summary statistics**

__Description__

**summarize** calculates and displays a variety of univariate summary
statistics. If no *varlist* is specified, summary statistics are
calculated for all the variables in the dataset.

__Options__

+------+
----+ Main +-------------------------------------------------------------

**detail** produces additional statistics, including skewness, kurtosis, the
four smallest and four largest values, and various percentiles.

**meanonly**, which is allowed only when **detail** is not specified, suppresses
the display of results and calculation of the variance. Ado-file
writers will find this useful for fast calls.

**format** requests that the summary statistics be displayed using the
display formats associated with the variables rather than the default
**g** display format; see **[D] format**.

**separator(***#***)** specifies how often to insert separation lines into the
output. The default is **separator(5)**, meaning that a line is drawn
after every five variables. **separator(10)** would draw a line after
every 10 variables. **separator(0)** suppresses the separation line.

*display_options*: **vsquish**, __noempty__**cells**, __base__**levels**, __allbase__**levels**,
__nofvlab__**el**, **fvwrap(***#***)**, and **fvwrapon(***style***)**; see **[R] estimation**
**options**.

__Examples__

**. sysuse auto**
**. summarize**
**. summarize mpg weight**
**. summarize mpg weight if foreign**
**. summarize mpg weight if foreign, detail**
**. summarize i.rep78**

__Video example__

Descriptive statistics in Stata

__Stored results__

**summarize** stores the following in **r()**:

Scalars
**r(N)** number of observations
**r(mean)** mean
**r(skewness)** skewness (**detail** only)
**r(min)** minimum
**r(max)** maximum
**r(sum_w)** sum of the weights
**r(p1)** 1st percentile (**detail** only)
**r(p5)** 5th percentile (**detail** only)
**r(p10)** 10th percentile (**detail** only)
**r(p25)** 25th percentile (**detail** only)
**r(p50)** 50th percentile (**detail** only)
**r(p75)** 75th percentile (**detail** only)
**r(p90)** 90th percentile (**detail** only)
**r(p95)** 95th percentile (**detail** only)
**r(p99)** 99th percentile (**detail** only)
**r(Var)** variance
**r(kurtosis)** kurtosis (**detail** only)
**r(sum)** sum of variable
**r(sd)** standard deviation