Sunday, February 11, 2007

transpose data

Transpose your data from the so-called "long format" to the ever popular and
occassionally useful "wide format"



proc transpose data=long2 out=widef prefix=faminc;
by famid;
id year;
var faminc;
run;

proc transpose data=long2 out=wides prefix=spend;
by famid;
id year;
var spend;
run;

data wide2;
merge widef(drop=_name_) wides(drop=_name_);
by famid;
run;

No comments: