@fibonacheese
As indicated by @PGStats try the following:
data poisson;
call streaminit (0);
retain sumy meantotal;
psamples = 20; *2000;
psizesamp = 40000;
lambda = 8;
do psample = 1 to psamples;
sumy = 0;
do n2 = 0 to psizesamp;
y = rand("Poisson", lambda);
sumy + y;
end;
mean = sumy / psizesamp;
meantotal + mean;
*output;
end;
mom = meantotal / psamples;
put 'Mean of the Means ' mom;
run;
See the commented statements for lesser / no output. A better way is to keep out the initial values as macro variables for not to load them into PDV as:
%let lambda = 8;
%let psamples = 2000;
%let psizesamp = 40000;
and inserting them into the code.