Monday, September 5, 2011

Visualizing PROC TRANSPOSE

Original paper: http://www.nesug.org/proceedings/nesug07/cc/cc03.pdf

The BY statement: indicating the variable that should stay the same. Variables that need to be kept in their original structure should be specified in the BY statement.

The ID statement: indicating the variable that should go up (from row to column). This means that the individual values of VERTVAR are to be turned into variables themselves. One variable for each unique value of VERTVAR will be created.

The VAR statement: indicating the variable that should go down (from column to row). This means that the distinct variables by VAR will now be distinct values of the newly created variable _NAME_. And the corresponding values of the VAR variables will be the new values of the ID variables. We can use the NAME= option to rename the variable _NAME_.

Image above is from SAS transpose procedure online documentation

No comments:

Post a Comment