Hi guys,

I would like to create a SAS code using either %glimmix or proc

glimmix (though I am more familiar with %glimmix)

here is how my data looks like

I have a list of variable names such as d01-d07

and I would like to have all the variables under model statement with

intercept and one variable at a time under random statement... in this

case, which means, I will have to have 7 separate glimmix runs

I've tried to create a SAS macro with %do i=1 %to 7 with %glimmix,

however it only gave me the result on i=1, is there anyone could help

me out on this? thanks! or maybe gives me some idea on how to program

a DO LOOP with glimmix procedure! thanks again!

here is my %glimmix program:

%macro test(n=7,);

%Do i=1 %to &n;

%glimmix(data=test1

stmts=%str(

class classroom;

model III/NNN = D01 D02 D03 D04 D05 D06 D07

/ solution ddfm=bw;

random int D0&i/sub = classroom s;

ODS OUTPUT solutionr=blupz&i;

),

error = binomial,

link = logit

)

%end;

run;

%mend test;