I just realized that there is no need for setting any data and therefore there is no need for the data; I have also set a specific estimate value as below; data pred;
array v[11];
array n[11];
array sf[11];
array t[11];
array f[11];
array a[11];
array w[11];
do i = 1 to 11;
n[i] = i + 14;
end;
do i = 1 to 11;
sf[i] = i + 44;
end;
do i = 1 to 11;
v[i] = i + 54;
end;
do i = 1 to 11;
t[i] = i + 24;
end;
do i = 1 to 11;
f[i] = i + 39;
end;
do i = 1 to 11;
a[i] = i - 1;
end;
do i = 1 to 11;
w[i] = i + 6;
end;
do count_y= 0 to 80;
if count_y ~= 5 and count_y ~=12 and count_y ~=20 and count_y ~=30 and count_y ~=45 and count_y ~=50 and count_y ~=60 then
probability_FP= pdf("poisson",count_y,exp(3.99793));
else if count_y= 20 then do;
p = 0;
do i = 1 to 6;
p = p + ((n[i]-15)/5)*(pdf("poisson",n[i],exp(3.99793)));
end;
do i = 7 to 11;
p = p + ((25-n[i])/5)*(pdf("poisson",n[i],exp(3.99793)));
end;
probability_FP=p;
end;
else if count_y= 60 then do;
sum = 0;
do i = 1 to 6;
sum = sum + ((v[i]-55)/5)*(pdf("poisson",v[i],exp(3.99793)));
end;
do i = 7 to 11;
sum = sum + ((65-v[i])/5)*(pdf("poisson",v[i],exp(3.99793)));
end;
probability_FP=sum;
end;
else if count_y= 30 then do;
th = 0;
do i = 1 to 6;
th = th + ((t[i]-25)/5)*(pdf("poisson",t[i],exp(3.99793)));
end;
do i = 7 to 11;
th = th + ((35-t[i])/5)*(pdf("poisson",t[i],exp(3.99793)));
end;
probability_FP=th;
end;
else if count_y= 50 then do;
sd = 0;
do i = 1 to 6;
sd = sd + ((sf[i]-45)/5)*(pdf("poisson",sf[i],exp(3.99793)));
end;
do i = 7 to 11;
sd = sd + ((55-sf[i])/5)*(pdf("poisson",sf[i],exp(3.99793)));
end;
probability_FP=sd;
end;
else if count_y= 12 then do;
bb = 0;
do i = 1 to 6;
bb = bb + ((w[i]-7)/5)*(pdf("poisson",w[i],exp(3.99793)));
end;
do i = 7 to 11;
bb = bb + ((17-w[i])/5)*(pdf("poisson",w[i],exp(3.99793)));
end;
probability_FP=bb;
end;
else if count_y= 5 then do;
aa = 0;
do i = 1 to 6;
aa = aa + ((a[i]-0)/5)*(pdf("poisson",a[i],exp(3.99793)));
end;
do i = 7 to 11;
aa = aa + ((10-a[i])/5)*(pdf("poisson",a[i],exp(3.99793)));
end;
probability_FP=aa;
end;
else if count_y= 45 then do;
fr = 0;
do i = 1 to 6;
fr = fr + ((f[i]-40)/5)*(pdf("poisson",f[i],exp(3.99793)));
end;
do i = 7 to 11;
fr = fr + ((50-f[i])/5)*(pdf("poisson",f[i],exp(3.99793)));
end;
probability_FP=fr;
end;
output;
end;
keep count_y probability_FP;
run; So the idea is that I should get probabilities from 0 to 80 but at points (5,12,20,30,45,50,60) the probability is computed as below; As an example for 20 (estimate in the code is the theta below); I applied the same idea to 5,12,30,45,50,60 as shown in the code
... View more