Showing posts with label mixed models. Show all posts
Showing posts with label mixed models. Show all posts

Wednesday, May 30, 2007

code for transforming data from multivariate format to the univariate format

data data;
infile 'c:\myfiles\testfile.dat';
input id y0 y1 y2 y3;
y=y0 trt=0; output;
y=y1 trt=1; output;
y=y2 trt=2; output;
drop y0-y2;
run;

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;