Sentry Page Protection

**Proc SQL [11-14]**

**Summary Functions**

mean(height) AS mean,

var(height) AS var,

min(height) AS min,

max(heightn) AS max

FROM school

GROUOP BY gender;

Below is the list of summary functions that can be used to summarize data:

- AVG/MEAN
- COUNT/FREQ
- CSS
- CV
- MAX
- MIN
- NMISS
- PRT
- RANGE
- STD
- STDERR
- SUM
- T
- USS
- VAR

Let's take a look at an example.

Copy and run the

**SCHOOL**table from the yellow box below if you haven't done so.

__Example__**Proc sql;**

select

mean(height) as mean,

var(height) as var,

min(height) as min,

max(height) as max,

sum(height) as sum,

nmiss(height) as nm

from school;

**quit;**

The summary functions compute the corresponding statistics for the HEIGHT column:

**GROUP BY Clause**

Again, you can group the analysis using the GROUP BY clause.

__Example__

**Proc sql;**

select

gender,

mean(height) as mean,

var(height) as var,

min(height) as min,

max(height) as max,

sum(height) as sum,

nmiss(height) as nm

from school

group by gender;

**quit;**

The statistics are computed for the two genders:

**Exercise**

Locate the CARS table from the SASHelp library.

Write a Proc SQL step to compute the mean, minimum, maximum and standard deviation of the HORSEPOWER column for each of the car makers.

*Need some help?*

Fill out my online form.