Syntax, MEANS procedure:
PROC MEANS <DATA=SAS-data-set>
<statistic-keyword(s)> <option(s)>;
RUN;
|
proc means data=cert.survey; run;
Keyword
|
Description
|
---|---|
CLM
|
The two-sided confidence
limit for the mean.
|
CSS
|
The sum of squares corrected
for the mean.
|
CV
|
The percent coefficient
of variation.
|
KURTOSIS | KURT
|
Measures the heaviness
of tails.
|
LCLM
|
The one-sided confidence
limit below the mean.
|
MAX
|
The maximum value.
|
MEAN
|
The arithmetic mean
or average of all the values.
|
MIN
|
The minimum value.
|
MODE
|
The value that occurs
most frequently.
|
N
|
The number of observations
with nonmissing values.
|
NMISS
|
The number of observations
with missing values.
|
RANGE
|
Calculated as the difference
between the maximum value and the minimum value.
|
SKEWNESS | SKEW
|
Measures the tendency
of the deviations to be larger in one direction than in the other.
|
STDDEV | STD
|
Is the standard deviation
s and is computed as the square root of the variance.
|
STDERR | STDMEAN
|
The standard error of
the mean.
|
SUM
|
Sum
|
SUMWGT
|
The sum of the weights.
|
UCLM
|
The one-sided confidence
limit above the mean
|
USS
|
The value of the uncorrected
sum of squares.
|
VAR
|
Variance.
|
Keyword
|
Description
|
---|---|
MEDIAN | P50
|
The middle value or
the 50th percentile.
|
P1
|
1st percentile.
|
P5
|
5th percentile.
|
P10
|
10th percentile.
|
Q1 | P25
|
The lower quartile or
25th percentile.
|
Q3 | P75
|
The upper quartile or
75th percentile.
|
P90
|
90th percentile.
|
P95
|
95th percentile.
|
P99
|
99th percentile.
|
QRANGE
|
The interquartile range
and is calculated as the difference between the upper and lower quartile,
Q3 — Q1.
|
Keyword
|
Description
|
---|---|
PROBT | PRT
|
|
T
|
proc means data=cert.survey median range;
run;
Syntax, PROC MEANS statement
with MAXDEC= option:
PROC MEANS <DATA=SAS-data-set>
<statistic-keyword(s)> MAXDEC=n;
|
proc means data=cert.diabetes min max maxdec=0;
run;
Syntax, VAR statement:
VAR variable(s);
|
proc means data=cert.diabetes min max maxdec=0;
var age height weight;
run;
proc means data=cert.survey mean stderr maxdec=2;
var item1-item5;
run;
Syntax, CLASS statement:
CLASS variable(s);
|
proc means data=cert.heart maxdec=1;
var arterial heart cardiac urinary;
class survive sex;
run;
Syntax, BY statement:
BY variable(s);
|
proc sort data=cert.heart out=work.heartsort; by survive sex; run; proc means data=work.heartsort maxdec=1; var arterial heart cardiac urinary; by survive sex; run;
Syntax, OUTPUT statement:
OUTPUT OUT=SAS-data-set
statistic=variable(s);
Tip:You can use multiple OUTPUT
statements to create several OUT= data sets.
|
proc means data=cert.diabetes; var age height weight; /*#1*/ class sex; /*#2*/ output out=work.diabetes_by_gender /*#3*/ mean=AvgAge AvgHeight AvgWeight min=MinAge MinHeight MinWeight; run; proc print data=work.diabetes_by_gender noobs; /*#4*/ title1 'Diabetes Results by Gender'; run;
1 | Specify the analysis variables. The VAR statement specifies that PROC MEANS calculate the default statistics on the Age, Height, and Weight variables. |
2 | Specify subgroups for the analysis. The CLASS statement separates the analysis by the values of Sex. |
3 | Specify the output data set options. The OUTPUT statement creates the Work.Diabetes_By_Gender data set and writes the mean value to the new variables AvgAge, AvgHeight, and AvgWeight. The statement also writes the min value to the new variables, MinAge, MinHeight, and MinWeight. |
4 | Print the output data set Work.Diabetes_By_Gender. The NOOBS option suppresses the observation numbers. |