According to SAS Documentation, "An analysis variable is a numeric variable that is used to calculate a statistic for all the observations represented by a cell of the report." I would love to have some summary functions for character variables as well, such as coalesce or count.
Example Use Case
Given a dataset like this:
Be able to create a report like this:
data toprint;
input groupvar $ acrossvar $ charvar $ numvar;
datalines;
Group1 Across1 A 1
Group2 Across1 Q 4
Group1 Across2 T 1
Group2 Across2 F 7
;
run;
/* The desired report is easily created for a numeric variable */
proc report data=toprint;
column groupvar numvar,acrossvar;
define groupvar / group;
define acrossvar / " " across;
define numvar / " " analysis sum;
run;
/* But for a character variable you can only get a "stairstep" output */
proc report data=toprint;
column groupvar charvar,acrossvar;
define groupvar / order;
define acrossvar / " " across;
define cahrvar / " " display;
run;
/* The desired functionality might look something like the following */
/** This code does not work **/
proc report data=toprint;
column groupvar charvar,acrossvar;
define groupvar / group;
define acrossvar / " " across;
define charvar / " " analysis coalesce;
run;
In a pharmaceutical setting, groupvar might be usubjid, you might have parcat1 and param as across variables, and charvar might be avalc. This functionality would allow you to create a wide format listing of character data with very little work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.