- Thread starter noetsi
- Start date

If yes, then you could in SAS place a WHERE statement in your PROC LOGISTIC and have a macro feeds it the group numbers and you could use an outest=est to get estimates then concatenate the results and do a proc print.

Code:

```
%let N = 20000;
%let Begin = 1;
%let Stop = 4;
/*dataset*/
data Noetsi;
call streaminit(235);
k = 4;
do i = 1 to &N;
Group = ceil(k * rand("Uniform"));
U = rand("Bernoulli", 0.6);
C = rand("Bernoulli", 0.4);
X = rand("Bernoulli", 0.35 + 0.2*C + 0.15*U);
Y = rand("Bernoulli", 0.05 + 0.05*X + 0.2*C + 0.05*X*C + 0.2*U);
output;
end;
run;
proc print data=noetsi (obs=10);
run;
%MACRO Sets(Start, Stop);
%DO ID_set = &START %TO &STOP;
proc logistic data=noetsi outest=est_&id_set;
where group = &id_set;
class U (ref='0')
C (ref='0')
X (ref='0') / param=ref;
model Y (event="1") = U C X;
run;
%END;
%MEND Sets;
%Sets(&begin,&Stop)
data coef;
set est_&begin - est_&stop;
keep U1 C1 X1;
run;
proc print data=coef;
run;
```

Nothing gets kicked out with residual options or ods graphics on; ?

P.S., And most of the time when I test to see if group level effects explain a significant amount of variability it doesn't so I revert back to fix effects with robust SEs.