Pages

Monday, October 7, 2013

Widgets

How to label the variable created by PROC TRANSPOSE

In Proc Transpose, you can tell SAS, how to NAME the new variable created from the result of Proc Transpose.
Also  by using the the value of the variable from the original dataset, you can tell SAS to LABEL the variables.
Below is the example demonstrating the same.
  proc transpose data=test out=test2 prefix=visit;
    by subjid;
    var labres;
    id visit;
    idlabel visitl;
  run;
Based on the values in the VISIT variable, SAS will name the variables VISITx .. VISITy. And will ALSO label VISITx with the corresponding value from VISITL on the given record and label VISITy with the corresponding value from VISITL on the given record for all created variables.

No comments:

Post a Comment