Introduction
Summary statistics give you an overview of the distribution of a continuous variable through various measurements. Summary statistics must be reported in academic papers, research essays, and theses that are quantitatively oriented. In this blog post, we’ll show you how to generate summary statistics in Stata.
Example
Let’s access a dataset in Stata for which we will generate summary statistics
webuse auto
Next, you can pick the variable(s) for which you want summary statistics and add det for detail. Try the following code:
sum mpg price, det
Here’s what Stata gives you:
Stata returns percentiles, the number of observations, means, standard deviations, variance, skewness, and kurtosis.
Another handy feature of Stata is that you can add code to focus on summary statistics that are relevant to you. For example, the auto dataset tracks cars by foreign or domestic make, using a variable called foreign. Let’s say you want to generate separate summary statistics on mpg sorted by where a car was manufactured. Try the following code:
by foreign, sort: sum mpg, det
Stata now creates distinct summary statistics for the two types of makes:
BridgeText can help you with all of your statistical analysis needs.