Dear SAS Help, I use SAS 9.4 I tried the exercise on this link: https://blogs.sas.com/content/iml/2012/04/04/fitting-a-poisson-distribution-to-data-in-sas.html This is the code I copied from the site. -------------------------------------- data MyData;
input N @@;
datalines;
7 7 13 9 8 8 9 9 5 6 6 9 5 10 4 5 3 8 4
;
run;
proc freq data=MyData;
tables N / out=FreqOut plots=FreqPlot (scale=percent);
run;
proc genmod data=MyData;
model N= /dist=poisson;
output out= PoissonFit p=lambda;
run;
data _null_;
set Poissonfit;
call symputx("Lambda", Lambda);
stop;
run;
data PMF;
do t= 0 to 13;
Y = pdf("Poisson", t, &Lambda);
end;
run;
data Discrete;
merge FreqOut PMF;
Prop = Percent / 100;
run;
*\bij dit stukje is er een probleem. Ik heb gemaild naar de site op 15 januari;
proc sgplot data=Discrete;
vbarparm category=N response=Prop /legendlabel = 'Sample';
scatter x=T y=Y / legendlabel= 'PMF'
markerattrs=GraphDataDefault(symbol=CIRCLEFILLED size=10);
title "Emails per 30minute Poissondist";
run;
----------------------------------------------------------------------- The log gives this error message: NOTE: Since no format is assigned, the numeric category variable will use the default of BEST6. The plot that I should get should look like the upper plot, but my result is the lower plot. Questions: 1. What did I do wrong? 2. Is it possible to have a line instead of dots. 3. Can I use these steps to do an overlay on a poisson density plot created with the FMM procedure? Thanks in advance for your answer. The plot I get looks like this:
... View more