Ʈ  |  Contact Us
 
Ȩ > SAS Tech & Tip > SAS Programming
[SAS α׷] Funnel Plot ̿ ׷ [ǽ1] 2019.03.20
ڼ 103 0
http://www.mysas.co.kr/sas_tiptech/a_question.asp?b_no=11062&cmd=content&bd_no=5

[Funnel plot ټ ׷ ϱ]



1. Introduction


ð Funnel plot ǰ ϴ̹ ð Funnel plot ̿Ͽ ̻ġ Žϰ ϴ ǽ ϰڽϴ ǽ ǹ̴ ó Unbalance   Funnel Plot ڽϴ.

 

 

 

 

2. Data


title "Temperatures of Car Roofs";

title2 "71 Degrees (F) in the Shade";

 

data CarTemps;

infile datalines missover;

input color $8. Temperature @;

 

do while (^missing(Temperature));

  output;

  input Temperature @;

end;

datalines;

black    145.5 154.0 143.0 126.5 128.0 131.5 128.5 141.5

blue     134.5 123.0 113.5 126.0 139.0 125.5 143.5

burgundy 131.0 141.0 141.5 122.0

gray     124.0 141.5 128.0 127.5 132.0 130.0

green    149.5 130.5 114.0 129.5

red      140.5 128.5 124.5 119.5 132.0 126.0

silver   118.5 112.5 96.5 105.5 111.0 103.5

tan      127.0 103.5 121.0 113.0

white    103.5 97.5 93.0 99.0 91.5 104.5 99.5

;

run;

 

ڵ带 ̿Ͽ ͸ ҷ ݴϴʹ Clark Anderson 迡   ڵ µ Դϴ. do while (^missing(Temperature));  Ͱ ġ  ҷ´ٴ Դϴ.

 

 

 

 

 

 

 

 

3. practice 

 

proc iml;

use CarTemps;

read all var {Color Temperature};

close CarTemps;

 

 ڵ带 Ͽ CarTemps  IML ŵϴ.

 

 

 

u = unique(Color); /**  ȯ**/

p = ncol(u);/** ÷  **/

mean = j(p,1); sem = j(p,1); n = j(p,1);

do i = 1 to p;

   idx = loc(Color=u[i]);

   n[i] = ncol(idx);

   T = Temperature[idx];

   mean[i] = T[:];

   sem[i] = sqrt(var(T)/n[i]); /** var л ϴ ԼԴϴ. **/

end;

 

 

p ÷  ǹϰ, u  ȯմϴ.

Unique LOC Լ ̿Ͽ  ũ  մϴ. Sem[i] ǥ  ǹմϴ. (Loc   ռ  Ͻñ ٶϴ.)

 

 

 ϴµ ̷   ʿ  ʹ ó īװ  ٸ   ֱԴϴ   ֺ    ʿմϴ.

 

 

 

call sortndx(jdx, mean, 11);

color = u[jdx];   n = n[jdx];

mean = mean[jdx]; sem = sem[jdx];

print color n mean[format=5.1] sem[format=4.1];

/**  **/

create Temp var {color n mean sem};

append;

close Temp;

 

 

 

 ڵ   ̿Ͽ  ϴ Դϴ ε    ҷ meansem ԷϿ ݴϴݱ   Create  Ͽ temp  մϴ.

 

 

 

 

 

 

 

ڵ带 ϸ    µ˴ϴ  ׷캰  Ȯ  ֽϴ ǽ   ġ  ̰ ִ Ȯϱ  ׷  ϴ  Ÿմϴ.

 

 

 

 

 

y = Temperature[:];

s = sqrt(var(Temperature));

print y s[label="StdDev"];

 

   񱳸 ü  հ ǥ մϴ.

Y ü , s ǥ ξϴ.

 

 

 

 

ڵ带 ϸ    ˴ϴ.

 

 

 

 

 

 

 

 

 


n = T( do(38.50.1) ); /*Funnel   n */


p = {0.001 0.025 0.975 0.999}; /** Ǽ   **/


z = quantile("normal", p);


/** 56 x 4 ŷڼ Ͱ ˴ϴ. (n 3 8.5 0.1, 56) **/


limits = y + s/sqrt(n)*z;


print limits;


 

 

 Funnel plot   Լ  Ϳ Ȯϰ    մϴ. LimitsN  Կ    Ǽ   ݿմϴ. (򶧱  ü   ۾ )

 

 

 

 

 

 

 

 

d = n || limits;

varNames = {"N" "L998" "L95" "U95" "U998"};

create Bounds from d[c=varNames];

append from d;

close Bounds;

quit;

 

 


d || ̿Ͽ n limits  Դϴ. [N   limits  ޶  Funnel Plot Ư¡Դϴ ÿ ȴٽ, Funnel Plot ġ     ġ  ū    Ư¡  Դϴ.]

 

 

 

d ̿ ۵ Bounds ͸ Ȯ ,

 



ó N Ŀ  Ǽ   ϰ Ǽ   ϴ  Ȯ  ֽϴ̸  Funnel Plot Լ   򶧱    Ȯ  ֽϴ.( ׷ ø ؿ  ˴ϴ.)


 

 

 

 

 

 

data All;

set Temp Bounds;

run;

 

proc sgplot data=All;

scatter x=N y=Mean /datalabel=Color;

refline 123.4 / axis=y;

band x=N lower=L95 upper=U95 / nofill

   name="CI95" LegendLabel="95% limits"

   lineattrs=(color=gray);

band x=N lower=L998 upper=U998 / nofill

   name="CI998" LegendLabel="99.8% limits"

   lineattrs=(pattern=dash color=gray);

xaxis label="Number of Cars";

yaxis label="Average Temperature";

keylegend "CI998" "CI95" /

   location=inside position=TopRight

   across=1;

run;

 

 

 ڵ带 Ͽµ Լ  ͸ ģ ׷ ۼմϴ.

N Կ     ϱ  N X ξϴ.

 

׷  99.8ۼƮ  ǥϰ, 95ۼƮ Ǽ ǥϿϴ̸   Ͱ  Ǽؿ ԵǴ Ȯ  ֽϴ.

 

 

 

N Կ  µ Լ  򶧱      ֽϴ.

ä    µ ȭ ä ̰ ִ°  Ͽ ׷ ؼغ, Black silver 0.5 Ǽ Ͽ ̻ġ(Ȥ ̰ ִ ) зǴ    ֽϴ    0.002 Ǽ Ѵٸ, White  ̰ ִ    ֽϴ.

 

 

 

 

4. Conclusion

 

̷ ü ׷  ̿Ͽ  ϰų̻ġ Ž  ְ  Ȯ  ֽϴ. Funnel Plot N ̿   ݿ ̾ ׷  ü  ̰   ϰ  ֽϴ.

 

ٸ ̹ ǽ Ѱ ߺ񱳿      ֽϴ, n  Ƿ 0.1    Դϴ. (Ȱ ŷѰ   ) n  õ Ǵ Ϳ ̷ ذ ̶ մϴ.

  

 

 

 

-https://blogs.sas.com/content/iml/2011/04/15/funnel-plots-an-alternative-to-ranking.html

 
 
 
޴ ȣ
޴ ȣ
 
 [SAS α׷] Kernel Regression- Ŀȸ [̷]
 Carrie Underwood Tour