Here is code:
%macro do_regression(dep);
proc glimmix data=xxx;
class group id intv month1;
model &dep = group month1 group*month1/d=normal link=identity;
random intv(id);
lsmeans group*month1/ilink diff cl ;
lsmestimate group*month1 'bsl-3 ' 1 -1 0 0 -1 1 0 0/cl ;
lsmestimate group*month1 'bsl-6' 1 0 -1 0 -1 0 1 0/cl;
ods output LSMEstimates
run; quit;
%mend;
%do_regression(original total domain1)
Here is example of data structure:
Question: I am new to SAS macros and am working with a SAS macro code to run the following regression model for three outcome variables (original total domain1). I output the results using: ods output LSMEstimates which created three datasets named data1—data3 with the estimates. However, I cannot figure out how to attach the outcome variable names of these datasets. Eventually, I would only want the following to be stored in one final dataset that can “set” data1—data3: effect label estimate lower upper. [I only want to store estimates from the two lsmestimate statements shown that I am outputting using: ods output LSMEstimates
]
ods output LSMEstimates=&dep;
Or are you asking how to combine the three datasets? – Tom