Differences between revisions 3 and 4
Revision 3 as of 2023-01-13 23:50:45
Size: 658
Comment:
Revision 4 as of 2023-01-13 23:51:26
Size: 795
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
To count observations by catgegory, use `proc freq`. To count observations by catgegory, use `PROC FREQ`.
Line 21: Line 21:
Many higher-level statistics can be retrieved through `proc means`. For example, to compute `VARMEAN` and `VARMAX` from `VAR1` for each category of `VAR2`. For more details on the `FREQ` procedure, see [[SAS/Freq|here]].

Many higher-level statistics can be retrieved through `PROC MEANS`. For example, to compute `VARMEAN` and `VARMAX` from `VAR1` for each category of `VAR2`.
Line 32: Line 34:
For more details on the `MEANS` procedure, see [[SAS/Freq|here]].

Aggregating Data in SAS


Implicit Aggregation

Many procedures create intermediary, higher-level variables.

To count observations by catgegory, use PROC FREQ.

proc freq data=LIBREF.TABLE noprint;
  tables=VAR / out=LIBREF.OUT;
run;

For more details on the FREQ procedure, see here.

Many higher-level statistics can be retrieved through PROC MEANS. For example, to compute VARMEAN and VARMAX from VAR1 for each category of VAR2.

proc means data=LIBREF.TABLE noprint;
  var VAR1;
  class VAR2;
  ways 1;
  output out=LIBREF.OUT(drop=_FREQ_ _TYPE_) mean=VARMEAN max=VARMAX;
run;

For more details on the MEANS procedure, see here.


CategoryRicottone

SAS/AggregatingData (last edited 2023-01-13 23:51:26 by DominicRicottone)