@edasdfasdfasdfa wrote:
Thanks!
How about if you want to reduce the number of levels in a character variable? Is there a way to do that through a procedure or would that require creating less levels manually?
Depends on your data how much work might be involved. Consider the following code:
data example;
input x $;
datalines;
FullSize
FullGas
Fun
Strength
String
Super
;
run;
proc freq data=example;
run;
proc freq data=example;
format x $3.;
run;
Proc freq data=example;
format x $2.;
run;
Proc freq data=example;
format x $1.;
run;
The format applied to a variable for the run of a procedure would control the number of dummy variables created.
Some data may be easily grouped this way, otherwise you may need multiple formats. And formats are probably better in general than adding different variables.