12-12-2016 12:23 PM
I was trying to caalculate the limits from the post http://blogs.sas.com/content/iml/2011/11/23/funnel-plots-for-proportions.html#comment-235504
But in SAS Base, without using SAS IML.
We are working with rates (occurence per 10.000 subjects) but I guess I'm doing something wrong.
My limits are really not good (normal approximation).
This is what I was doing:
I guess I'm doing something wrong because my normal approx. is really bad...
Is it correct to calculate the sample variance and to use this to calculate the limits?
SET CDIF_HOSP_SUMMARY(WHERE=(MS_HOS_SURV_PAT NE .)) END=EOF;
RETAIN sumdif count 0;
count = count +1;
sumdif = sum(sumdif,(MS_HA_PAT-&AvgProp.)**2);
IF eof THEN DO;
std = sqrt(sumdif/count);
/*** we nemen de standard normale verdeling ***/
/* 0.001 0.025 0.975 0.999 */
p1 = quantile("normal", 0.001);
p2 = quantile("normal", 0.025);
p3 = quantile("normal", 0.975);
p4 = quantile("normal", 0.999);
DO vz = &minN TO &maxN by 20;
p2sigmaL = &AvgProp. + (&std_overall./sqrt(vz))*p1;
p3sigmaL = &AvgProp. + (&std_overall./sqrt(vz))*p2;
p2sigmaH = &AvgProp. + (&std_overall./sqrt(vz))*p3;
p3sigmaH = &AvgProp. + (&std_overall./sqrt(vz))*p4;
I guess my std_overall is not correct? Shouldn't I use the overall sample variance to calculate the limits?