Date: Fri, 10 Aug 2007 11:37:41 -0400
Reply-To: Peter Flom <peterflomconsulting@mindspring.com>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Flom <peterflomconsulting@MINDSPRING.COM>
Subject: Data structure followup question
Content-Type: text/plain; charset=UTF-8
Hello again
I have a general question on data structure and organization, with a specific application. I'm ccing my co-worker, who knows a lot about ACCESS and is learning SAS (she just took a course in SAS).
The general question is for good references on best designs of data for longitudinal studies with many variables.
Specifically, the data I have includes the following (it was not designed by either Julie or me).
8 data sets, each with 1900 variables, labeled VAR1-VAR1900 (approximately). Each data set includes SUBJECT and SESSION. In each data set, SESSION is always the same (e.g. in data set COCA, SESSION is always A, in COCB it is always B). If a person did not take part in a particular session, there is no data for that person in that data set. Almost all of these variables are from EEGs.
Most of the variables have labels that are useful, and, when I asked about ways to make the variable labels into names, I got several suggestions, but that was for a different data set that had the same variables, but only one session for each person. The method I wound up using was from Roy, I believe:
<<<
proc sql noprint;
select name||' = '||label
into : labels1 separated by ' '
from dictionary.columns
where libname = 'WORK' and memname='TODAY'
and 1 lt varnum lt 1000;
select name||' = '||label
into : labels2 separated by ' '
from dictionary.columns
where libname = 'WORK' and memname='TODAY'
and 1000 lt varnum lt 1372;
quit;
proc datasets lib=work;
modify today;
rename &labels1. &labels2.;
quit;
run;
>>>
Then I have another data set with a bunch of clinical measures (e.g. the Beck Depression Inventory) on the same subjects, some were given more than once. This data set also includes demographics, and variables such as length of stay in treatment.
The goal is to create a data set(s) which will then be used for PROC MIXED and PROC PHREG.
Obviously, I don't expect anyone on SAS-L to do all the work of re-organizing this data. But if people had references or hints for Julie and me, that would be most welcome.
Thanks as always, and sorry for such a long message
Peter