I have a dataset with 28 analytes (e.g., glucose, creatinine, calcium) that I want to run through the same procedure. To do so, I renamed all 29 analytes as x1 through x28 (to avoid having to make 28 calls to the macro), created a macro, and generated labels in a prior data step to keep track of what each one represented. However, when running the macro, the labels are not attached, so the results are not quickly identifiable as pertaining to a given analyte. I would like to be able to look at the results and know that this one is for glucose, this one for creatinine, etc. How can I get the label/actual analyte name to display in the title? I tried including "OPTION LABEL" in the macro to no avail.
%MACRO linear_trend;
%DO i=1 %TO 28;
PROC MIXED DATA = analytes;
CLASS patient_id week;
MODEL x&i = date / SOLUTION;
RANDOM INT / SUBJECT = patient_id;
RANDOM INT / SUBJECT = week(patient_id);
TITLE1 "Linear trend for x&i";
RUN;
%END;
%MEND linear_trend;
The data have the form:
patient_id week x1 x2 x3 .... x28
123 1 9.1 3.6 7.2 .....
123 1 9.2 3.6 7.4 .....
123 2 8.7 3.7 7.5 .....
.....