Summarize

Quick facts

Number of variables
At least one

Scales of variable(s)
Continuous or categorical (ordinal)

Information

To generate descriptive statistics for your variables, you can use the summary command (or sum, for short).

It is used primarily for continuous variables (i.e. ratio/interval) but could also be used for some ordinal variables that are approximately continuous (e.g. rating measures).

The Stata function gives you the following statistics:

ObsNumber of observations
MeanMean value
Std. Dev.Standard deviation
MinimumMinimum (smallest) observed value
MaximumMaximum (largest) observed value

If you combine sum with the option detail, you will additionally get the following statistics:

MedianMedian
VarianceVariance
KurtosisKurtosis and standard error of kurtosis
SkewnessSkewness and standard error of skewness

Function

Basic command
sum varname
Useful options
sum varname, detail
Explanations
varnameInsert the name of the variable you want to use.
detailDisplay additional statistics.
Short names
sumsummarize
Note
Stata’s calculations are statistics, not parameters (see Variation).
More information
help summarize

Practical example

Dataset
StataData1.dta
Variable namegpa
Variable labelGrade point average (Age 15, Year 1985)
Value labelsN/A
sum gpa

sum gpa, detail

Both tables show that the variable gpa has 9,380 observations (Obs).

The mean is 3.18 and the standard deviation (Std. Dev.) is 0.70. The minimum value is 1 (shown by both Min in the upper table and 1% Smallest in the lower table) and the maximum value is 5 (shown by both Max in the upper table and 99% Largest in the lower table).

The lower table additionally shows that the median is 3.1 (as indicated by the 50% Percentiles). The variance is 0.49, skewness 0.02, and kurtosis 2.56.