Label

Reply
Frequent Contributor
Posts: 75

Label

How do I give the variables new names in Proc Tabulate, means?

Thanks

Occasional Contributor
Posts: 9

Re: Label

Dear Apple,

You can use rename option to give new names to the variables  in Proc Tabulate and Means.

PROC TABULATE DATA=TRY  OUT=TEST (RENAME=(N=Count));
CLASS VAR1 VAR2 VAR3;
TABLE VAR1 VAR2 VAR3;
RUN;


PROC MEANS DATA=TRY  N MEAN MAX  ;
OUTPUT OUT=TEST1 (RENAME=(_STAT_=COUNT1));
RUN;

Hope this helps !!

Frequent Contributor
Posts: 75

Re: Label


I don't understand. Where am I supposed to state the new names in the code?


I need it for Proc Freq


Thanks



Super User
Posts: 10,549

Re: Label

If you want to display a different label for a variable then add a label statement to the proc

label var ='Text to display'; for example;

Or in tabulate you can override the default label in the table statement

table var='Text to display', n;

If you want the Values to display differently then a custom format may be in order.

Frequent Contributor
Posts: 75

Re: Label

table var='Text to display', n;

What is n?

Thanks

Super Contributor
Posts: 644

Re: Label

apple

In the case of Proc SQL it goes like this

...

Select ...

   stuff label = "New label for stuff" ,

   ...

Richard in NZ

Super User
Posts: 10,549

Re: Label

The n is was using Proc Tabulate syntax to show a count of the variable.

Note the Proc Freq processes labels differently than Proc tabulate. Freq will show the variable name and the label(if any) while tabulate only displays the label or the variable name if no label is assigned.

Ask a Question
Discussion stats
  • 6 replies
  • 268 views
  • 0 likes
  • 4 in conversation