/* Data Analysis Project 1 */ /* Response is "severity of illness" on a 7 point scale. It measures severity of schizophrenia illness in patients. */ OPTIONS NOCENTER LINESIZE=81 PAGESIZE=66; TITLE1 'Schizophrenia data'; DATA ONE; INFILE 'D:\mystuff\RMbook\rmnotes\comps\dap1.dat'; *Alter file name to point to your copy of the data set; INPUT ID severity WEEK DRUG SEX ; /* The coding for the variables is as follows: ID = subject ID number severity = IMPS79 = overall disease severity (1=normal, ..., 7=among the most extremely ill) WEEK = 0,1,2,3,4,5,6 (most of the obs. are at weeks 0,1,3, and 6) DRUG 0=placebo 1=drug (chlorpromazine, fluphenazine, or thioridazine) SEX 0=female 1=male */ /* calculate the maximum value of WEEK for each subject (suppress the printing of the output for this procedure) */ PROC MEANS NOPRINT; CLASS ID; VAR WEEK; OUTPUT OUT=TWO MAX=MAXWEEK; RUN; /* determine if a subject has data at WEEK 6 DROPOUT = 0 (for completers) or = 1 (for dropouts) */ DATA THREE; SET TWO; DROPOUT=0; IF MAXWEEK LT 6 THEN DROPOUT=1; /* dataset with all subjects (adding the DROPOUT variable) */ DATA FOUR; MERGE ONE THREE; BY ID; proc sort; by dropout id week; run;