Differences between revisions 2 and 3
Revision 2 as of 2023-01-14 05:38:04
Size: 1136
Comment:
Revision 3 as of 2023-03-30 15:19:55
Size: 1177
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

A procedure for computing statistics.

SAS Means

A procedure for computing statistics.


Usage

proc means data=LIBREF.TABLE STATSLIST maxdec=2;
  var VARLIST;
  class CLASSVARLIST;
  ways 2;
run;

STATSLIST can be any combination of:

  • mean

  • std

  • stderr

  • sum

  • median

  • min

  • max

Class Statement

Ways Statement

The WAYS statement takes any number from 0 to the number of CLASS variables. A value of 0 ignores the classes. A value of 1 runs statistics for each single group. A value of 2 runs statistics for each combination of 2 groups. And so on.


Output

To store the STATSLIST variables for each CLASS group, try:

proc means data=LIBREF.TABLE noprint;
  var VARLIST;
  class CLASSVARLIST;
  ways N;
  output out=LIBREF.TABLE2(drop=_FREQ_ _TYPE_);
run;

To explicitly name the STATSLIST variables, try:

proc means data=LIBREF.TABLE mean max noprint;
  var Price;
  class Region;
  ways 1;
  output out=LIBREF.TABLE2(drop=_FREQ_ _TYPE_) mean=MeanPrice max=MaxPrice;
run;


CategoryRicottone

SAS/Means (last edited 2023-03-30 20:47:01 by DominicRicottone)