Creating Tabular Reports |
Specifying
Variables![]() ![]() |
Analysis Variables
Unlike class variables, analysis variables
It makes sense to sum or average analysis variables. For example, you can
sum values of
In the table below, |
Total | BalanceDue |
Sum | Mean |
$13,079.32 | $108.52 |
As you may have realized, some numeric variables are appropriate
as either class or analysis variables. But you specify variables for each
PROC TABULATE step separately. This means that the same variable cannot appear
in both the CLASS statement and the VAR statement in the same step.
Depending on your table, you may need a CLASS statement, a VAR statement, or both. proc tabulate data=stress; var resthr maxhr glucose; table mean*(maxhr resthr); run; proc tabulate data=clinic.stress; class chol tolerance; table chol tolerance all,n; run; proc tabulate data=clinic.stress; class tolerance; var glucose; table glucose*mean,tolerance; run;
The following error messages occur when you specify variables incorrectly. Look over the messages, in case you encounter any of them during the upcoming practice. |
Error Message | Meaning |
---|---|
VARIABLE appears in both CLASS and VAR lists. | You specified a variable as both class and analysis. |
Type of name (VARIABLE) unknown at line n. | You forgot to specify a variable as either class or analysis. |
Variable VARIABLE in list does not match type prescribed for this list. | You specified a character variable as analysis. |
![]() ![]() ![]() ![]() ![]() ![]() |
|
![]() |
![]() |
Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.