SAS has many different descriptive statistics modules, some of which are:
-
PROC MEANS gives the basic statistics for only continuous variables (means, standard
deviations, etc.), but can split continuous variables by categorical variables.
-
PROC UNIVARIATE gives many basic statistics for mostly continuous variables, including
graphs
-
PROC FREQ gives frequencies for categorical variables, as well as combinations of
categorical variables
-
Other – there are other SAS procedures, such as PROC REPORT and PROC TABULATE.
Let us say we wish to run descriptive statistics for all the major continuous variables
in our dataset (once your data is opened). Do the following:
-
Open the programing code file “Code07a Continuous descriptives” from the SAS Code
folder (by choosing File > Open Program in SAS and browsing to the folder). This program
is based on the dataset “Data01_Initial.” You will see the programming code in
Figure 7.2 Example of continuous descriptives code.
-
Note here that the Var line lists all variables you wish to analyze. Only choose variables
that make sense to apply the analysis to. For instance, in our dataset I have excluded
a) the first “Respondent” column which is merely an observation number, b) the premium
and size variables (which are categorical and not amenable to descriptive statistics
of this nature).
-
You could copy this syntax and use it with a different list of variables in a different
analysis.
-
The rest of the keywords are just asking for statistical output options. You will
note that in the second line that we are asking for centrality statistics (mean and
median) and spread statistics (standard deviation, the 25th and 7th percentiles which
define the interquartile range, and minimum and maximum) for each variable, which
I discuss in the next section. There are other options discussed later.
-
Run the code by clicking the little running person at the top of the program editor
page.
-
As mentioned above, you could also have used various other SAS modules such as PROC UNIVARIATE, but you would have received statistics on each variable separately instead of in
a single table. However, if you want to see some of what you can get in the Univariate
module then open and run the file “Code07b Univariate descriptives.”
Let’s look at the major variable characteristics that these descriptive statistics
outputs cover.