Differences between revisions 1 and 4 (spanning 3 versions)
Revision 1 as of 2023-01-14 04:41:49
Size: 548
Comment:
Revision 4 as of 2023-03-30 20:47:01
Size: 1240
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:

A procedure for computing statistics.
Line 12: Line 14:
proc means data=LIBREF.TABLE N mean median sum min max maxdec=2; proc means data=LIBREF.TABLE STATSLIST maxdec=2;
Line 14: Line 16:
  class GROUPVAR1 GROUPVAR2;   class CLASSVARLIST;
Line 18: Line 20:

`STATSLIST` can be any combination of:

 * `mean`
 * `std`
 * `stderr`
 * `sum`
 * `median`
 * `min`
 * `max`
Line 29: Line 41:
----



== 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;
}}}

Note the '''`NOPRINT`''' option, which suppresses printing.

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;
}}}

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;

Note the NOPRINT option, which suppresses printing.

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)