/**********************************************************************/


proc rank data=dist normal=blom out=outrank;
   var y;                                      
   ranks ny;                                   
run;                                           

proc summary data=dist mean std;               
   var y;                                      
   output out=outsum mean=mean std=std;        
run;                                           

data normplt;                                  
   if _n_=1 then set outsum;                   
   set outrank;                                
   line=mean+std*ny;                           
run;                                           

title1 f=swiss 'Normal Probability Plot for Y';
symbol1 i=none v=star;                         
symbol2 i=join v=none;                         

proc gplot data=normplt;                       
   plot y*ny=1 line*ny=2 / overlay;            
   label ny='Normal Quantiles';                
run;


/**********************************************************************/


proc standard data=dist mean=0 std=1 out=outstrd;
   var y;                                        
run;                                             

proc rank data=outstrd normal=blom out=outrank;  
   var y;                                        
   ranks ny;                                     
run;                                             

title1 f=swiss 'Normal Probability Plot for Y';  
symbol1 i=none v=star;                           
symbol2 i=join v=none;                           

proc gplot data=outrank;                         
   plot y*ny=1 ny*ny=2 / overlay;                
   label ny='Normal Quantiles';                  
run;


/**********************************************************************/


proc summary data=data mean std;           
   var y;                                  
   output out=outmeans mean=mean std=std;  
run;                                       

data _null_;                               
   set outmeans;                           
   call symput('mean',put(mean,best.));    
   call symput('std',put(std,best.));      
run;                                       

proc capability data=data graphics noprint;
   qqplot y / normal(mu=&mean sigma=&std); 
run;                                       


/**********************************************************************/