Showing posts with label six sigma. Show all posts
Showing posts with label six sigma. Show all posts

Friday, September 11, 2009

Capability Analysis in JMP

I received a note asking how to do a capability analysis in JMP 8. Actually nothing much have changed in how to do it. There are additional features which are really helpful but the basic steps on computing Cp, Cpk, Pp, and Ppk are basically shared by versions JMP 5, JMP 6, JMP 7, and JMP 8. Here are the detailed steps. I will be using JMP 8's sample data 'Semiconductor Capability.jmp'.

Capability Analysis in JMP

Method1
Step1: Data Requirements
Data should be in one column and data type set as continuous.
Step2: Go to Univariate Platform
Create a histogram of your measurement data as shown below.
Step3: Click on the second hot button
It is the red triangle as shown below. On the drop down menu, select 'Capability Analysis'
Step4: Specification Limits
On the resulting dialog box, fill up the necessary information regarding the specification limits and target values. In this case they are 104.41295,118.15322, and 131.89349. For Pp and Ppk, check on the tick box 'Long Term Sigma'. For Cp and Cpk, select either on the tick box 'Moving Range...' and specify the range span, or on the tick box 'Short Term Sigma...'. Note that whichever you choose JMP would use the terms Cp and Cpk in its output. It would specify in the title box of the output though the Sigma your analysis is referring to.
Step5: Capability Analysis Output
After pressing 'OK', JMP will give you this output.

Method2:
Step1: Data Requirements
Same as above
Step2: Set up the column that contains your data
Right click on the column header to see the following menu. Select 'Column Info'.
Step3: Column Properties
On the drop down menu 'Column Properties', select 'Spec Limits'.
Step4:Specification Limits
Fill up the necessary information regarding the specification limits and target values. In this case they are 104.41295,118.15322, and 131.89349, and then click 'OK'. Notice on the left side of your data table, and asterisk (*) sign is placed beside the column name where you just set up the specification limits.
Step5: Go to Univariate Platform
Create a histogram of your measurement data as shown below. Capability Analysis using Long Term Sigma is included by default.

Additional Features:
One of the reasons why I favor JMP over Minitab is its animated graphics. In JMP 8, Capability Analysis includes a feature called 'Capability Animation. To use this, click on the hot button as shown below.
The output window is like the one shown below.You can change the sigma to see its impact on the capability measures. For a JMP script like this where you can change the mean as well, refer to this entry or this entry.

Friday, August 28, 2009

BASIC SPC CONCEPTS: Definition of Quality

“The further we can look back, the better we see what is ahead.” --Adapted from W.E Deming.


Introduction


In my past entries, I jumped in immediately in posting JMP scripts that are useful for SPC practitioners. I have not spent much time though in introducing, defining, and explaining what SPC is. Allow me to back step this time. In this entry I would take time to look at the basic concepts in detail, and there is no better jumping board than the Definition of Quality.

Definition of Quality


About 8 years ago I was already visualizing myself pursuing a career in Quality Management. I was daydreaming of solving very complex problems, deploying quality management systems, initiating customer-focused activities, and all other things that could convince even the hardest person that I am the God’s gift to the Quality Community. But then my professor in Statistical Process Control course came in our classroom and threw a question to start a discussion. After a long pause made by waiting for someone to answer, the professor looked at me and asked, “How about you Rey, how would you define Quality? What is Quality for you?” I was dumbfounded of course. Not only because I know I can not give a satisfactory answer, but more of the realization that I was dreaming big while not even knowing what it is I was dreaming about. How could I manage Quality if I can not even define what Quality is in the first place? Well I gave the professor a reply, “Quality is consistently exceeding the expectations”, but after that my mind wandered-off for the rest of the class. I have learned that very moment that I do not know enough. Actually I learned that I really do not know a thing about Quality, and that lesson is enough for me for one day.
After that incident I decided to do some personal research. Here is what I recall of what I came up with.

“Quality is Fitness of Use” – Joseph M. Juran
Joseph Juran is the chief editor of The Quality Handbook (1999) and is the person behind the Pareto Concept (Vital Few, Trivial Many). Juran defines quality as fitness of use. According to him, quality is the freedom from deficiencies. Quality from his point of view therefore costs less, since this implies fewer defects and less scrap rates. It also means gain in productivity brought about by decreasing reworks, and increase in customer satisfaction made by products or services that are free from flaws.

“Quality is Conformance to Requirements” – Philip B. Crosby
Philip Crosby is credited for popularizing the concepts Zero Defect and Quality is Free. According to Crosby quality is the conformance to the requirements, and therefore does not cost any. What adds cost is not doing it right the first time. This additional cost he termed as the Cost of Poor Quality. Crosby shares with Juran the concept that quality actually costs less. They differ however on the perspective of how the end product is used. For Juran, it is the customer who ultimately decides if the end product or service is of quality. For Crosby however, it is the conformance to the specifications or written procedures that defines the quality. The question of whether that specification is “fit for use” is irrelevant. As long as the requirement is met, quality is present.
An important note must be made at this point. A Quality Practitioner should be able to distinguish between Juran's and Crosby’s concepts. It should be clear that they are referring to two different aspects of quality. One is the Quality of Design, while the other is the Quality of Conformance. A product may have been able to meet the design requirements but if the design itself is poor the product may end up as unfit for use. On the other hand it is also possible to have a superb design, but when an end product can not conform to its specifications quality is not present either.


“Quality is How the Customers Define it” – W. Edwards Deming
Edwards Deming is the person behind the well known Plan-Do-Check-Act Cycle. His advocacy on Quality is that only the customers can define it, and it typically changes from time to time. Focus therefore should be on understanding the customer, translating their needs and wants into measurable quality characteristics, and continuously reducing product variations in terms of these characteristics. For Deming, quality increases as the variation decreases. From this perspective, Quality does not necessarily mean less cost. Since quality from this definition may mean meeting customer wants, improving process performances, and tightening of tolerances, then quality may actually cost more.

“Quality has 8 Dimensions” – David A. Garvin
David Garvin is a Harvard Professor famous for his development of the 8 Dimensions of Quality concept. According to Garvin quality is multi-faceted and has 8 faces. These are the following:
1. Performance
2. Features
3. Reliability
4. Conformance
5. Durability
6. Serviceability
7. Aesthetics
8. Perceived Quality


--to be continued…

Monday, August 10, 2009

Visualizing Sigma: A JMP JSL Demostration (reposted from http://elsmar.com/Forums/blog.php?b=135)

This is a repost from: http://elsmar.com/Forums/blog.php?b=135
Hope it would help someone out there.

In the elmar's cove forum, i have written this note:




This is again for the JMP users out there.

Lately I have been noticing that whenever I am conducting trainings, it helps when the participants have a way to visualize the concepts that are being presented to them. In a recent example I was asked what is the basis of the value 6 in the Pp formula (USL-LSL)/(6*StdDev). Here is JMP JSL script that illustrates the logic behind the value 6.

A sample window is shown below. It is interactive. After showing this, you may then explain that the sigma is equivalent to distance from the center to the point of inflection on a normal curve,and you can fit about 6 of this length from one end of the curve to the other end. The output window is like this:

Note: You can freely use and share this script. I would be grateful though if you would give credit to me and point to this forum as the source.

Regards,
Reynald Francisco





The JMP output window is shown below:







The JMP JSL Scripth5>



Clear Globals();







/*Define constants*/

rsqrt2pi = 1 / Sqrt( 2 * Pi() );

e = e();

/*Define intial average

Define initial Sigma within

Get user information through a dialog box*/



dlg = Dialog(

"VISUALIZING SIGMA: A DEMOSTRATION",

" ",

"Enter the following information to begin, then click on OK",

" ",

V List(

V List(

" Population parameter:",

"",

Line Up( 2,

" Mean", mu = Edit Number( 0 ),

" Standard Deviation", sigma = Edit Number( 1 )

),

"",



)

),



" ",

H List( Button( "OK" ), Button( "Cancel" ) )

);





If( dlg["Button"] == -1,

Throw( "User cancelled" )

);

Remove From( dlg );

Eval List( dlg );





/*Define the output window*/

OUT_WINDOW = New Window( "VISUALIZING SIGMA: A JMP JSL DEMOSTRATION",

Border Box(

TOP( 5 ),

Left( 5 ),

Panel Box( "VISUALIZING SIGMA",

V List Box(

T1 = Text Box( "Move the slider below to adjust the Sigma." ),

T2 = Text Box( "Move the handle of the curve to adjust the Mean" ),

NormCurve = Graph Box(

FrameSize( 500, 350 ),

Y Scale( 0, 1.40 * rsqrt2pi / sigma ),

X Scale( mu - 10 * sigma, mu + 10 * sigma ),

Double Buffer,

Pen Color( "red" );

Text Color( "red" );

Text( {mu + 1 * sigma, rsqrt2pi / sigma * e ^ (-1 / 2)}, "Sigma = ", sigma );

LINEMATRIX_X = {mu, mu + sigma};

LINEMATRIX_X = Matrix( LINEMATRIX_X );

LINEMATRIX_Y = {rsqrt2pi / sigma * e ^ (-1 / 2), rsqrt2pi / sigma * e ^ (-1 / 2

)};

LINEMATRIX_Y = Matrix( LINEMATRIX_Y );

Arrow( LINEMATRIX_X, LINEMATRIX_Y );

LINEMATRIX_X1 = {mu + sigma, mu};

LINEMATRIX_X1 = Matrix( LINEMATRIX_X1 );

LINEMATRIX_Y1 = {rsqrt2pi / sigma * e ^ (-1 / 2), rsqrt2pi / sigma * e ^ (-1 /

2)};

LINEMATRIX_Y1 = Matrix( LINEMATRIX_Y1 );

Arrow( LINEMATRIX_X1, LINEMATRIX_Y1 );

Pen Color( "blue" );

Text Color( "blue" );

Pen Size( 2 );

Text Color( "BLUE" );

Text( {mu, rsqrt2pi / sigma}, "----->Mean = ", Char( Round( mu, 3 ) ) );

Y Function( Normal Density( (x - mu) / sigma ) / sigma, x );

Pen Size( 1 );

Pen Color( "Green" );

V Line( mu, 0, rsqrt2pi / sigma );

Line Style( 2 );

/*V Line( mu + sigma, 0, rsqrt2pi / sigma * e ^ (-1 / 2) );*/

V Line( mu + 2 * sigma, 0, rsqrt2pi / sigma * e ^ (-4 / 2) );

V Line( mu + 3 * sigma, 0, rsqrt2pi / sigma * e ^ (-9 / 2) );

V Line( mu - sigma, 0, rsqrt2pi / sigma * e ^ (-1 / 2) );

V Line( mu - 2 * sigma, 0, rsqrt2pi / sigma * e ^ (-4 / 2) );

V Line( mu - 3 * sigma, 0, rsqrt2pi / sigma * e ^ (-9 / 2) );

Pen Color( "Red" );

ARROW_MAT_X = {mu + sigma, mu + sigma};

ARROW_MAT_Y = {rsqrt2pi / sigma * e ^ (-1 / 2), 0};

ARROW_MAT_X = Matrix( ARROW_MAT_X );

ARROW_MAT_Y = Matrix( ARROW_MAT_Y );

Arrow( ARROW_MAT_X, ARROW_MAT_Y );

Handle( mu, rsqrt2pi / sigma, mu = x );

),





H List Box(

Text Color( "BLUE" );

T3 = Text Box( "SIGMA VALUE" );,

SB1 = Slider Box( 0.5 * sigma, 10 * sigma, sigma, NormCurve <<>









Thursday, August 6, 2009

Cp vs Cpk: Illustrating the Impact of Mean Shift and Sigma Changes

This is a script I developed to help me in explaining the concepts of Cp/Pp and Cpk/Ppk whenever I am conducting Six Sigma trainings. This is one of the reasons I appreciate JMP's JSL. It allows me to customize demostrations for my trainees that visually aid them in grasping Six Sigma concepts.
You may freely use. I would be grateful if you would give the credit to me and refer to this blog.

Reynald Francisco
http://statisticalprocesscontrols.blogspot.com/



The JMP JSL Script




dlg = Dialog(
V List(V List("Cpk Parameters","",
Line Up(2,
"Mean", mu = Edit Number(0),
"Standard Deviation", sigma = Edit Number(1)
),"","",
"Define Specifications","",
Line Up( 2,
"USL ",USL = Edit Number(2)
),Line Up( 2,
"LSL ",LSL = Edit Number(-2)
)
),
H List( Button("OK"), Button("Cancel") )
));


If( dlg["Button"] == -1, Throw( "User cancelled" ) );
Remove From( dlg ); Eval List( dlg );






rsqrt2pi = 1/sqrt(2*pi());

New Window("Cpk Demostration",

Graph Box(
FrameSize(500,500),
XScale(mu-8*sigma,mu+8*sigma),
yScale(0,1.40*rsqrt2pi/sigma),
Double Buffer,
Pencolor("blue"),
pensize(1),
text size(12),
TextColor("black"),
YFunction(Normal Density((x-mu)/sigma)/sigma, x); /*Y-scale is Normalized to Z-scores*/
YFunction(Normal Density((x-mu)/sigma)/sigma, x,fill(20),max(LSL)); /*Fill low*/
YFunction(Normal Density((x-mu)/sigma)/sigma, x,fill(20),min(USL)); /*Fill high*/
Handle(mu,rsqrt2pi/sigma,mu=x;sigma=rsqrt2pi/y);
Pencolor("red"),
pensize(1),
text size(10),
TextColor("black"),
XFunction(LSL, y);
Handle(LSL,0.45*rsqrt2pi/sigma,LSL=x);
XFunction(USL, y);
Handle(USL,0.55*rsqrt2pi/sigma,USL=x);
text({mu,0.85*rsqrt2pi/sigma},"mu ",mu," sigma ",sigma);
textcolor("red");
text({LSL,0.45*rsqrt2pi/sigma},"LSL= ",LSL);
text({USL,0.55*rsqrt2pi/sigma},"USL= ",USL);
Pencolor("blue"),
pensize(1),
text size(11),
TextColor("blue"),
Cpu=(USL-mu)/(3*sigma);
Zu=(USL-mu)/sigma;
Zl=(LSL-mu)/sigma;
yield=normal distribution(Zu)- normal distribution(Zl);
Cpl=(mu-LSL)/(3*sigma);
Cpk=min(Cpu,Cpl);
text({mu,1.15*rsqrt2pi/sigma},"Cpk= ",Cpk);
text({mu,1.35*rsqrt2pi/sigma},"Cpu= ",Cpu);
text({mu,1.25*rsqrt2pi/sigma},"Cpl= ",Cpl);
text({mu,1.05*rsqrt2pi/sigma},"Estimated Yield= ",yield);
) /* Close Graph Box parenthesis*/
); /* Close New Window parenthesis*/

Thursday, July 30, 2009

Process Capability Measures Cp and Cpk: A JMP JSL Demostration

I am often asked about the diffence between Cp and Cpk. Usually it is followed up by a question on why there is a need for two measures. I then answer that while Cpk is the real capability, Cp reflects the potential capability that can still be achieved just by centering your process. This is a difficult concept to grasp if just verbally described, so I usually illustrate this using a graphical demostration.
This JMP script demostrates the differences between the two Process Capability Measures Cp and Cpk.


The JMP JSL Script




dlg = Dialog(
V List(
V List(
"Cp Parameters",
"",
Line Up( 2,
/*"Mean", mu = Edit Number(0),*/
"Standard Deviation", sigma = Edit Number( 1 )
),
"",
"",
"Define Specifications",
"",
Line Up( 2, "USL ", upspecs = Edit Number( 2 ) ),
Line Up( 2, "LSL ", lowspecs = Edit Number( -2 ) )
),
H List( Button( "OK" ), Button( "Cancel" ) )
)
);


If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
Remove From( dlg );
Eval List( dlg );


/*ADDED line for Cp only*/
LSL = lowspecs;
USL = upspecs;
mu = lowspecs + (upspecs - lowspecs) / 2;
mid = (upspecs - lowspecs);
/*END of added line*/


rsqrt2pi = 1 / Sqrt( 2 * Pi() );

New Window( "Process Capability Demostration",
V List Box(
H List Box(
Panel Box( "Cpk Window",
T1=Text Box ("Move the Handle in the curve to change the value of the Mean"),
g1 = Graph Box(
FrameSize( 425, 400 ),
X Scale( mu - 8 * sigma, mu + 8 * sigma ),
Y Scale( 0, 1.40 * rsqrt2pi / sigma ),
Double Buffer,
Pen Color( "blue" ),
Pen Size( 1 ),
Text Size( 12 ),
Text Color( "black" ),
Y Function( Normal Density( (x - mu) / sigma ) / sigma, x ); /*Y-scale is Normalized to Z-scores*/
Y Function(
Normal Density( (x - mu) / sigma ) / sigma,
x,
fill( 20 ),
Max( LSL )
); /*Fill low*/
Y Function(
Normal Density( (x - mu) / sigma ) / sigma,
x,
fill( 20 ),
Min( USL )
); /*Fill high*/
Pen Color( "red" );,
Pen Size( 1 ),
Text Size( 10 ),
Text Color( "black" ),
X Function( LSL, y );
Handle( mu, rsqrt2pi / sigma, mu = x;g2<<reshow; );
g2 << reshow;
Handle( LSL, 0.45 * rsqrt2pi / sigma, LSL = x );
g2 << reshow;
Handle( USL, 0.45 * rsqrt2pi / sigma, USL = x );
X Function( USL, y );
delta = mu - LSL;
Text( {mu, 0.85 * rsqrt2pi / sigma}, "mu ", mu, " sigma ", sigma );
Text Color( "red" );
Text( {LSL, 0.45 * rsqrt2pi / sigma}, "LSL= ", LSL );
Text( {USL, 0.55 * rsqrt2pi / sigma}, "USL= ", USL );
Pen Color( "blue" );,
Pen Size( 1 ),
Text Size( 11 ),
Text Color( "blue" ),
Cp = (USL - LSL) / (6 * sigma);
Cpu = (USL - mu) / (3 * sigma);
Zu = (USL - mu) / sigma;
Zl = (LSL - mu) / sigma;
yield = Normal Distribution( Zu ) - Normal Distribution( Zl );
Cpl = (mu - LSL) / (3 * sigma);
Cpk = Min( Cpu, Cpl );
Text( {mu, 1.25 * rsqrt2pi / sigma}, "Cpk= ", Cpk );
Text( {mu, 1.15 * rsqrt2pi / sigma}, "Cp= ", Cp );
Text( {mu, 1.05 * rsqrt2pi / sigma}, "Estimated Yield= ", yield );
) /* Close Graph Box parenthesis*/
),
Panel Box( "Cp Window",
T2=Text Box ("Move the Handle in the curve to change the value of the Sigma");,
g2 = Graph Box(
FrameSize( 425, 400 ),
X Scale( mu - 8 * sigma, mu + 8 * sigma ),
Y Scale( 0, 1.40 * rsqrt2pi / sigma ),
Double Buffer,
Handle( mu, rsqrt2pi / sigma, sigma = rsqrt2pi / y; g1<<reshow; );
delta = mu - LSL;
USL2 = mu + delta;
Pen Color( "red" );,
Pen Size( 1 ),
Text Size( 10 ),
Text Color( "black" ),
X Function( LSL, y );
X Function( USL2, y );
Text( {mu, 0.85 * rsqrt2pi / sigma}, "mu ", mu, " sigma ", sigma );
Text Color( "red" );
Text( {LSL, 0.45 * rsqrt2pi / sigma}, "LSL= ", LSL );
Text( {USL2, 0.55 * rsqrt2pi / sigma}, "USL= ", USL2 );
Pen Color( "blue" );,
Pen Size( 1 ),
Text Size( 11 ),
Text Color( "blue" ),
Cpu = (USL2 - mu) / (3 * sigma);
Zu = (USL2 - mu) / sigma;
Zl = (LSL - mu) / sigma;
yield2 = Normal Distribution( Zu ) - Normal Distribution( Zl );
Cpl = (mu - LSL) / (3 * sigma);
Cp2 = (USL2 - LSL) / (6 * sigma);
Text( {mu, 1.15 * rsqrt2pi / sigma}, "Cp= ", Cp2 );
Text( {mu, 1.05 * rsqrt2pi / sigma}, "Estimated Yield= ", yield2 );
Pen Color( "blue" );,
Pen Size( 1 ),
Text Size( 12 ),
Text Color( "black" ),
Y Function( Normal Density( (x - mu) / sigma ) / sigma, x ); /*Y-scale is Normalized to Z-scores*/
Y Function(
Normal Density( (x - mu) / sigma ) / sigma,
x,
fill( 20 ),
Max( LSL )
); /*Fill low*/
Y Function(
Normal Density( (x - mu) / sigma ) / sigma,
x,
fill( 20 ),
Min( USL2 )
); /*Fill high*/
)
)
)
)/*END Of BORDER BOX*/
); /* Close New Window parenthesis*/

T1<<Text Color("BLUE");
T2<<Text Color("BLUE");

Tuesday, July 28, 2009

Control Chart as a Feedback System: A JMP JSL Demostration

This script was written using SAS JMP's version 5.1.
It demostrates how a control chart can feedback any change in distribution's central tendency and/or measure of dispersion/variation.

For any feedback, kindly send it to me @ rsfrancisco at up dot edu dot com

Regards,
Reynald Francisco



The JMP JSL Script





/*
DETAILS,
>>SIGMA OF THE MEAN IS COMPUTED USING THE CENTRAL LIMIT THEOREM
>>CONTROL LIMITS ARE COMPUTED USING Individuals and Moving Range Method (IMR) in which each mean and sigma of the sample are treated as an individual measure/data point.
>>DATA USED IS A RANDOMLY GENRERATED NORMALLY DISTRIBUTED VARIABLE WITH MEAN = MU (user specified) AND STDEV = SIGMA (user specified).
*/

dlg = Dialog(
V List(V List("Population parameter","",
Line Up(2,
"Mean", mu = Edit Number(0),
"Standard Deviation", sigma = Edit Number(1)
),"","",
"Define Sampling Plan","",
Line Up( 2,
"Sampling Size ",n = Edit Number(5),
"Initial Sub-groups ",m = Edit Number(25)
)
),
H List( Button("OK"), Button("Cancel") )
));


If( dlg["Button"] == -1, Throw( "User cancelled" ) );
Remove From( dlg ); Eval List( dlg );






rsqrt2pi = 1/sqrt(2*pi());





/*MODULE3*/


dt = New Table( "Process Data" );



col = dt << New Column( "Parameter" );

/* add new column to object 'dt' , which is a data table. Name the new column as "Parameter". Let new column be referred to as new object 'col' */

/*set global constants 'pmean' and 'pSD'*/

pMean = mu;
pSD = sigma;
sigmasample=sigma/sqrt(n);

/*CREATING A MATRIX to contain Normal Random*/




x = J( m, 1, 0 );

For( i=1, i<m+1, i++,
x[i] = mu + sigmasample * Random Normal()
);
musample=0;
For( i=1, i<m+1, i++,
musample=musample + x[i]
);
musample=musample/m;
/* ADDING THE VALUES from the MATRIX into the CREATED COLUMN in the TABLE*/
col << Values( x );

/* CREATE a new window object called 'w' */

w = New Window( "Control Chart Simulation",
H List Box(
(Graph Box(FrameSize(313,313), XScale(mu-6.5*sigma,mu+6.5*sigma), yScale(0,1.10*rsqrt2pi/(sigma/sqrt(n))), Double Buffer,


Handle(mu,rsqrt2pi/sigma,mu=x;sigma=rsqrt2pi/y),

text({musample,rsqrt2pi/sigmasample},"mu_sample= ",musample," \!rsigmasample= ",sigmasample),

sigmasample=sigma/sqrt(n);

Pencolor("blue"),pensize(1), text size(8),TextColor("blue"),

YFunction(Normal Density((x-mu)/sigma)/sigma, x),

text({mu,rsqrt2pi/(pSD/sqrt(n))},"mu= ",mu," sigma= ",(pSD/sqrt(n))),

Pencolor("red"),pensize(1), text size(10),TextColor("red"),
YFunction(Normal Density((x-musample)/(pSD/sqrt(n)))/(pSD/sqrt(n)), x), /*Y-scale is Normalized to Z-scores*/

Pencolor(4),
text({mu,rsqrt2pi/sigmasample},"mu= ",mu," sigma= ",sigmasample),
YFunction(Normal Density((x-mu)/sigmasample)/sigmasample, x) /*Y-scale is Normalized to Z-scores*/
)),



Control Chart(
Sample Label(Empty()),
KSigma(3),
Chart Col(
:Parameter,
Individual Measurement,
Moving Range
),
Show Zones(1),
All Tests(1),

SendToReport(Dispatch({}, "Control Chart", OutlineBox,
Set Title("Control Chart Simulation")),
Dispatch({"Individual Measurement of Parameter"},
"Control Charts", FrameBox, Frame Size(300, 250)),
Dispatch({"Moving Range of Parameter"}, "1",
ScaleBox, {Scale(Linear), Format(Best), Min(4), Max(38), Inc(3),
Minor Ticks(2)}), Dispatch({"Moving Range of Parameter"},
"Control Chart", FrameBox, Frame Size(300, 250)),
Dispatch({"Moving Range of Parameter"},
"Control Charts", FrameBox, Frame Size(80, 90))),

Alarm Script(
Write(
"\!rOut of Control for test ",
qc_test,
" in column ",
qc_col,
" in sample ",
qc_sample
)
)
),

Button Box( "End Simulation",
w << Close Window;
Close( dt, No Save )
)
)
)
;

While( 2,
Wait(1);
dt << Add Rows( 1 );
col[i++] = mu + sigmasample * Random Normal();
);


Monday, July 27, 2009

When Xbar-R wont work...

I am trying to build a case. I want to argue that there are instances that the commonly used control chart Xbar-R does not always work for manufacturing data. This is even when the famous Central Limit Theorem is invoked as a justification of the method.
In here I am developing a JMP JSL to demonstrate it's weaknesses.
I am not yet done, but almost 80% complete. This script is already operational, but not yet as I intended it to be.

Hope you find it useful. I will post the complete blog when I find the time.

Regards,
Reynald Francisco




The JMP JSL Script





Clear Globals();

Run_Num = 1;
//FUNCTIONS

GEN_DATA = Expr(
a = 1;
b = 1;
//Generate Subgroup Means
SubMeans_Matrix = {};
For( a = 1, a <= SubCount, a++,
SubMeans_Matrix[a] = mu + (SigmaBet * Random Normal())
);



a = 1;
b = 1;
i = 1;
NormList = {};
NormTemp = {};
NormData = {};
NormData_b = {};
For( a = 1, a <=SubCount, a++,

b = 1;
For( b = 1, b <= SubSize, b++,
NormTemp[i] = SubMeans_Matrix[a] + (SigmaWith * Random Normal());
NormData_b = NormTemp[i];
NormTemp = {};
NormData = Matrix( NormData );
NormData_b = Matrix( NormData_b );
NormData = NormData || NormData_b;
NormData_b = {};
);
NormList = Matrix( NormList );
NormData = Matrix( NormData );
NormList = NormList |/ NormData;
NormData = {};
);


a = 1;
b = 1;
NormMatrix = Matrix( NormList );


//GENERATE RANDOM DATA;


b = 1;
SigmaWith_Matrix = {};
For( b = 1, b <= SubCount, b++,
SigmaWith_Matrix[b] = (Max( NormMatrix[b, 0] )) - Min( NormMatrix[b, 0] )
);


//sigma = Std Dev( NormMatrix );
//SigmaTot = sigma;
//SigmaWith = Mean(SigmaWith_Matrix)*A2_constant/3;
//SigmaBet = Sqrt( (SigmaTot ^ 2) - (SigmaWith ^ 2) );
SigmaTot_new = SigmaTot;
SigmaWith_new = SigmaWith;


a = 1;
b = 1;
dt = New Table( "Simulation Data-" || Char( Run_Num ) );
m_col = dt << New Column( "Measurement Number", formula( Row() ) );
m_col << set modelling type( ordinal );
For( a = 1, a <= SubSize, a++,
col = dt <<New Column( "Measurement" || Char( a ) );
col << Set Values( NormMatrix[0, a] );
);

Mean_Matrix = {};
a = 1;
b = 1;
For( b = 1, b <= SubCount, b++,
Mean_Matrix[b] = Mean( NormMatrix[b, 0] )
);
Mean_Matrix = Matrix( Mean_Matrix );
col = dt << New Column( "Average Measurement" );
col << Set Values( Mean_Matrix );

SigmaWith_Matrix = Matrix( SigmaWith_Matrix );
col = dt << New Column( "Measurement Range" );
col << Set Values( SigmaWith_Matrix );

Run_Num = Run_Num + 1;
dt <<Select All Rows;
dt << colors( 5 );
dt << markers( 8 );
); //END OF EXPRESSION: GEN_DATA


GEN_CHART = Expr(
OUT_WINDOW << Append(
CChat = Panel Box( "Resulting Control Chart",
Overlay Plot(
X( :Measurement Number ),
Y( :Average Measurement ),
Y Axis[1] << {{Scale( Linear ), Format( "Best" ), Min(
Col Mean( Column( "Average Measurement" ) ) - 1.10 * A2_constant * Col Mean( Column( "Measurement Range" ) )
), Max(
Col Mean( Column( "Average Measurement" ) ) + 1.10 * A2_constant * Col Mean( Column( "Measurement Range" ) )
), Inc( 1 ), Add Ref Line(
Col Mean( Column( "Average Measurement" ) ) - A2_constant * Col Mean( Column( "Measurement Range" ) ),
Solid,
Dark Red
), Add Ref Line(
Col Mean( Column( "Average Measurement" ) ) + A2_constant * Col Mean( Column( "Measurement Range" ) ),
Solid,
Dark Red
), Add Ref Line( Col Mean( Column( "Average Measurement" ) ), Dashed, Red )}},
Separate Axes( 1 ),
Connect Points( 1 ),
:Average Measurement( Connect Color( 21 ) ),
SendToReport(
Dispatch( {}, "Overlay Plot", OutlineBox, Set Title( "Control Chart for Simulated Data-" || Char( Run_Num ) ) )
),
SendToReport(
Dispatch(
{},
"106",
ScaleBox,
{Scale( Linear ), Format( "Fixed Dec", 3 ), Min(
Col Mean( Column( "Average Measurement" ) ) - 1.10 * A2_constant *
Col Mean( Column( "Measurement Range" ) )
), Max(
Col Mean( Column( "Average Measurement" ) ) + 1.10 * A2_constant *
Col Mean( Column( "Measurement Range" ) )
), Inc( Round( (2 * A2_constant * Col Mean( Column( "Measurement Range" ) )) / 20, 2 ) )}
),
Dispatch(
{},
"101",
ScaleBox,
{Scale( Linear ), Format( "Best" ), Min( 0.5 ), Max( SubCount + 0.5 ), Inc( 1 ), Minor Ticks( 0 ),
Rotated Labels( 1 )}
),
Dispatch(
{},
"Overlay Plot",
FrameBox,
{Frame Size( 840, 300 ), DispatchSeg( LineSeg( 1 ), {Line Color( "Medium Dark Blue" )} )}
)
)
)
)//END OF GRAPH BOX
);//END OF NEW WINDOW

Run_Num = Run_Num + 1;
);//END OF EXPRESSION GEN_CHART


//Define constants
rsqrt2pi = 1 / Sqrt( 2 * Pi() );

//Define Subgrouping (limit from 2-9 for XbarR charts)
//Define intial average
//Define initial Sigma within
//Get user information through a dialog box



SamplingSizes = {"2", "3", "4", "5", "6", "7", "8", "9"};
SubgroupSizes = {"20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35"};

dlg = Dialog(
"When Xbar-R will not work: A JMP demonstration",
" ",
"Enter the following information to begin",
" ",
V List(
V List(
" Population parameter:",
"",
Line Up( 2, " Mean", mu = Edit Number( 0 ), " Standard Deviation", sigma = Edit Number( 1 ) ),
"",
"",
" Define Sampling Plan:",
"",
H LIST(
V LIST( " Subgroup Size ", H LIST( " ", n = Combo Box( SamplingSizes ) ) ),
" ",
V LIST( " Number of Subgroups ", H LIST( " ", m = Combo Box( SubgroupSizes ) ) )
)
)
),
" ",
H List( Button( "OK" ), Button( "Cancel" ) )
);


If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
Remove From( dlg );
Eval List( dlg );




SubSize = Match( n, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9 );
SubCount = Match( m,
1, 20,
2, 21,
3, 22,
4, 23,
5, 24,
6, 25,
7, 26,
8, 27,
9, 28,
10, 29,
11, 30,
12, 31,
13, 32,
14, 33,
15, 34,
16, 35
);

A2_constant = Match( SubSize, 2, 1.8806, 3, 1.0231, 4, 0.7286, 5, 0.5768, 6, 0.4833, 7, 0.4193, 8, 0.3725, 9, 0.3367 );

SigmaTot = sigma;
SigmaWith = (SigmaTot / A2_constant) / 3;
SigmaBet = Sqrt( (SigmaTot ^ 2) - (SigmaWith ^ 2) );



/**********************************CODE OUTPUT INTERFACE*********************************************/


//Define the output window
OUT_WINDOW = New Window( "When Xbar-R will not work: A JMP demonstration",
Border Box(
TOP( 5 ),
Left( 5 ),
Panel Box( "MOVE THE SLIDER BOXES BELOW TO ADJUST THE RELATIVE VALUES OF SIGMAS:",
V List Box(
H List Box(
V List Box(
NormCurve = Graph Box(
FrameSize( 500, 300 ),
Y Scale( 0, y = 0.8 * rsqrt2pi / (sigma / Sqrt( SubSize )) ),
X Scale( mu - 10.0 * sigma, mu + 10.0 * sigma ),
Double Buffer,
Pen Size( 2 );
Pen Color( "red" );
Text Color( "red" );
Text( {mu + 2.0 * SigmaTot, 0.5 * y}, "Sigma Total" );
Y Function( Normal Density( ((x - mu) / SigmaTot) ), x );
Pen Color( "blue" );
Text Color( "blue" );
Text( {mu + 2.5 * SigmaWith, 0.1 * y}, "Sigma Within" );
Y Function( Normal Density( ((x - mu) / SigmaWith) ), x );
Pen Color( "green" );
Text Color( "green" );
Text( {mu + 3.0 * SigmaBet, 0.3 * y}, "Sigma Between" );
Y Function( Normal Density( ((x - mu) / SigmaBet) ), x );
),


H List Box(
Text Color( "black" );
T1 = Text Box( " SIGMA BETWEEN: " );,
SB1 = Slider Box(
0.5 * SigmaTot,
10 * SigmaTot,
SigmaBet,
SigmaTot = Sqrt( SigmaWith ^ 2 + SigmaBet ^ 2 );
NormCurve << reshow;
Tri << reshow;
SB2 << reshow;


);
),
H List Box(
Pen Color( "blue" );
T2 = Text Box( " SIGMA WITHIN: " );,
SB2 = Slider Box(
0.5 * SigmaTot,
10 * SigmaTot,
SigmaWith,
//SIGMA_WIDTH_EXPR;
SigmaTot = Sqrt( SigmaWith ^ 2 + SigmaBet ^ 2 );
NormCurve << reshow;
Tri << reshow;
SB1 << reshow;
)
);



),
Tri = Graph Box(
framesize( 300, 300 ),
X Scale( -0.5, 10.5 * SigmaTot ),
Y Scale( -0.50, 10.5 * SigmaTot ),
XCOR = {0, SigmaWith, 0, 0};
YCOR = {0, 0, SigmaBet, 0};
XCOR = Matrix( XCOR );
YCOR = Matrix( YCOR );
Pen Color( "Gray" );
Fill Color( "Gray" );
Polygon( XCOR, YCOR );
Pen Size( 2 );
Pen Color( "blue" );
Line( {SigmaWith, 0}, {0, 0} );
Pen Color( "green" );
Line( {0, 0}, {0, SigmaBet} );
Pen Color( "red" );
Line( {0, SigmaBet}, {SigmaWith, 0} );
)
),
Text Box( " " ),
H List Box(
Panel Box( "COMMAND OPTIONS",
V List Box(
Button Box( "GENERATE SIMULATED DATA", GEN_DATA ),
Button Box( "GENERATE SIMULATED DATA AND CHARTS",
GEN_DATA;
Run_Num = Run_Num - 1;
GEN_CHART;
Out_Window << Bring Window To Front;
)
)
),
Panel Box( "HELP OPTIONS",
V List Box(
Button Box( "ABOUT THE AUTHOR", Caption( "wala pa" ) ),
Button Box( "HELP LINKS", Caption( "WALA PA" ) )
)
),
Panel Box( "OTHER OPTIONS",
V List Box(
Button Box( "EXIT", OUT_WINDOW << CLOSE WINDOW ),
Button Box( "WWW.SIXSIGMAPRACTICE.COM", Web( "WWW.SIXSIGMAPRACTICE.COM" ) )
)
)
)//END OF HLIST
) //END OF BORDER BOX
) //END OF END OF PANEL BOX
) // END OF BORDER BOX
);//END OF NEW WINDOW OUT_WINDOW
T1 << font color( "GREEN" );
T2 << font color( "BLUE" );
Show( NormCurve );
NormCurve << reshow;
Tri << reshow;

Out_Window << Bring Window To Front;


Sunday, July 26, 2009

Chebyshev's Inequality to Roughly Estimate Area Under an Unknown Probability Density Curve: Reposted from www.SixSigmaPractice.multiply.com

I have always been fascinated by this generalized area under the curve theorem.
Though the estimate in itself is very weak, Chebyshev's inequality provides a very strong statistical basis for control charting.
Here is a utility that compares the actual area under the curve against to that estimated by Chebyshev's inequality.


The JMP JSL Script




Clear Globals();
new=EXPR(dt=open());
use_curr=expr(dt=Current Data Table());
if(is empty(Current Data Table()),new,use_curr);
bound=1.5;
j = 1;
col_list = {};
For( j = 1, j <= N Col( dt ), j++,
col_list[j] = Column( j ) << get name
);


COMM_RUN = Expr(
col = Column( col_name );
modelling=col<<get modeling type;
CONT=EXPR(
val1 = col << get as matrix;
counter = N Rows( val1 );
T_counter = 0;
mu = Mean( val1 );
sigma = Std Dev( val1 );
i = 1;
For( i = 1, i <= counter, i++,
If( val1[i, 1] <= mu + bound * sigma & val1[i, 1] >= mu - bound * sigma,
T_counter = T_counter + 1;
i = i + 1;
,
i = i + 1
)
);

Actual = T_counter / counter * 100;
T_estimate = (1 - (1 / (bound ^ 2))) * 100;
);
NON_CONT=EXPR(Throw ("Data Column does not contain a continous variable data"));
if(modelling=="Continuous",CONT,NON_CONT);
);

COMM_PRINT = Expr(
PRINT_TEXT = "Actual area inside mean +/- " ||char(bound) || "*sigma is " || Char( round(Actual,2) ) || " while Chebyshev's inequality estimate is " || Char( round(T_estimate,2) );
PRINT_VALUES = "Mean is equal to " ||char(round(mu,3)) || ". Sigma is equal to " ||char(round(sigma,3)) || ". The bounded interval is equal to " ||char(round(mu-bound*sigma,3)) || " to " ||char(round(mu+bound*sigma,3)) || ".";
Print( PRINT_VALUES );
Print( PRINT_TEXT );
);


COMM_OUTPUT = Expr(
OUTPUT_REPORT = New Window( "Results",
Border Box(
Left( 10 ),
Panel Box( "Simulation Result for " || char(col),
Text Box(" "),
V LIST BOX(
Text Box( "" ),
Text Box( PRINT_VALUES ),
Text Box( " " ),
Text Box( PRINT_TEXT ),
Text Box(" "),
Text Box( "sixsigmapractice.multiply.com" )
)
)
)
)
);

New Window( "Interface",
Border Box(
Left( 10 ),
Panel Box( "Set values and click on RUN",
V List Box(
V List Box(
H List Box(
Text Box( "Set Bound = k" ),
Text Box( " " ),
combo_list = Combo Box(
{"1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6"},
COMBO_COMM = Expr(
k = combo_list << getselected;
bound = Num( k );
);
COMBO_COMM;
),

),
Text Box( " " ),
H List Box(
Text Box( "Select Column" ),
Text Box( " " ),
col_select = Combo Box( col_list ),
COL_COMM = Expr( col_name = col_select << get );
COL_COMM;
)
),
Text Box( " " ),
Panel Box( "Command Button",
Button Box( "RUN ESTIMATE",
COMBO_COMM;
COL_COMM;
COMM_RUN;
COMM_PRINT;
COMM_OUTPUT;
OUTPUT_REPORT << reshow;
OUTPUT_REPORT<<move window(250,50)
)
)
)
)
)
);

Sigma Level as a Measure of Process Capabiltity (Reposted from www.SixSigmaPractice.multiply.com

There are many available measures of Process Capability.
In fact anything that relates process variation to specification
limits,and measures how often the process meets these specifications can be considered as a measure of Process Capability.
Process Capability can be measured either by Percent Yield, Percent Defect, Cp, Pp, Cpk, Ppk, or Sigma Level. This JSL script uses JMP's graphical capability to demostrate how the standard Normal Curve defines the relationships between the Sigma Level, percent Yield, and percent defect.
 
Note: You may use freely but the author will appreciate it the author will be given credit, and this webpage will be sited.
Reynald Francisco
http://www.sixsigmapractice.multiply.com/



The JMP JSL Script

When the JMP script is run, an initial dialog box would prompt the user the input initial values as shown below.
Input Dialog Box:




The output image is a graph as shown below:




The JMP JSL Script is shown below::

dlg = Dialog(
V List(
V List(
"ENTER THE FOLLOWING INFORMATION:",
"",
V List(
"Input Option",
V List(
TestType = Radio
Buttons( "YIELD RATE", "DEFECT RATE", "SIGMA LEVEL" ),
Line Up( 2, "Input
Value ", x = Edit Number( 0.5 ) )
)
),
"",
"Note: Input Yield
Rate and Defect Rate in decimal format."
),
H List( Button( "OK" ),
Button( "Cancel" ) )
)
);

If( dlg["Button"] == -1,
Throw(
"User cancelled" )
);
Remove From( dlg );
Eval List( dlg );

If(
TestType != 3 & x >= 1,
Caption( "Input Yield Rate
and Defect Rate in decimal format. Right click to close message." );
Throw(
"User cancelled" );,
TestType != 3 & x <= 0,
Caption( "Input
value is not valid. Right click to close message." );
Throw( "User
cancelled" );,
TestType == 3 & x < 0,
Caption( "Input value is
not valid. Right click to close message." );
Throw( "User cancelled" );
);

mu = 0;
sigma = 1;
rsqrt2pi = 1 / Sqrt( 2 * Pi() );

If(
TestType == 3, SigmaLevel = x,
TestType == 1, SigmaLevel =
Normal Quantile( x ),
TestType == 2, SigmaLevel = Normal Quantile( 1 - x )
);

New Window( "Sigma Level Demostration",
Graph Box(
FrameSize( 900, 500 ),
X Scale( -10, 10 ),
Y Scale( 0, 0.5 ),
Double Buffer,
Pen Color( "blue" ),
Pen Size( 1 ),
Text Size( 12
),
Text Color( "black" ),
Y Function( Normal Density( (x - mu) / sigma )
/ sigma, x ); /*Y-scale is Normalized to Z-scores*/
If( TestType == 2,
Y
Function( Normal Density( (x - mu) / sigma ) / sigma, x, fill( 1 ), Min(
SigmaLevel ) ),
Y Function( Normal Density( (x - mu) / sigma ) / sigma, x,
fill( 1 ), Max( SigmaLevel ) )
);
Pen Color( "red" );,
Pen Size( 1
),
Text Size( 10 ),
Text Color( "black" ),
X Function( SigmaLevel, y
);
Handle( SigmaLevel, 0.45 * rsqrt2pi / sigma, SigmaLevel = x );
Text
Color( "black" );
Text( {SigmaLevel, 0.45 * rsqrt2pi / sigma}, "<--Move
this point" );
Text Color( "red" );
Text( {SigmaLevel, 0.55 * rsqrt2pi /
sigma}, "Sigma Level= ", SigmaLevel );
Pen Color( "blue" );,
Pen Size( 1
),
Text Size( 11 ),
Text Color( "blue" ),
Z = (SigmaLevel - mu) /
sigma;
Yield = Normal Distribution( Z );
Defect = (1 - Yield);
Text(
{mu, 1.15 * rsqrt2pi / sigma}, "YIELD= ", yield * 100, "%" );
Text( {mu,
1.05 * rsqrt2pi / sigma}, "DEFECT= ", defect * 100, "%" );
) /* Close Graph
Box parenthesis*/
); /* Close New Window parenthesis*/





Saturday, July 11, 2009

Extending Your JMP's Capability Thru Scripting

If your are a JMP user do you know that you can increase your JMP's capability by leaps and bounds through scripting?

Yes you can! I do create scipts which utilities range from an ordinary alarm clock, mail sender, matrix solver, to report generator, and so on. Some of my work are shared online and can be found here:
http://sixsigmapractice.multiply.com/

http://www.sas.com/apps/demosdownloads/jmpFileExchange_PROD__sysdep.jsp?packageID=000416&jmpflag=Y&searchvar=userName&searchval=Reynald%20Francisco

In my multiply account, i do post many JSL scripts. In here i will try to foucs more on teaching how to script.

Till next entry!
 
Custom Search