## Introduction

Process performance metrics are important to determine the performance
capability (of a process) in terms of customer requirement. Process performance
can be determined via the following ways:

- Via DPMO (Defect per Million Opportunity)
- Via PPM (Part per Million)
- Via Yield
- Via Z-transformation

This is the fourth of a four parts that determine the Process Performance.

For the first part (via DPMO), see
Process Performance Determination in C#.

For the second part (via PPM), see
Process Performance Determination in C#:
Part 2.

For the third part (via Yield), see
Process Performance Determination in C#:
Part 3.

For Excel function NORMSDIST which is used in Z-transformation, see
Excel Function: NORMSDIST(z).

## Background

This article describes how to determine the process performance from
a Z-transformation.

The Z-transformation method is based on the standardized the z value calculated
as follow.

*z(LSL) = (LSL - X-bar) / s *

and

*z(USL) = (USL - X-bar) / s*

where

- z(LSL) is the z score when LSL is standardized
- z(USL) is the z score when USL is standardized
- LSL is the lower spec limit
- USL is the upper spec limit
- X-bar is the mean and
- s is the standard deviation.

After the z values are determined, they are converted into probability
or area under Normal curve using z-table or the Excel function NORMSDIST. The code for
NORMSDIST, along with some explanations can be found
here.

Let's look at an example on delivery time, with the assumption that it follows a Normal
distribution.

After placing an order, the customer expects a delivery time of more than 7 days but less than 20 days. The average delivery time is 13.5 days with a
standard deviation of 4 days. We thus have *z(USL) = (20 - 13.5) / 4 = 1.625* and
*z(LSL) = (7 - 13.5) / 4 = -1.625*.

Using z table or Excel function
NORMSDIST, we obtain probability more
than z(USL)
as 0.05208 and probability less than z(LSL) as 0.05208. Those values can be
interpreted as percentage of delivery time more than 20 days is 5.208, and percentage
of delivery time less than 7 days is also 5.208. Thus percentage of delivery time
in between 7 to 20 days is 100 - 5.208 - 5.208 = 89.58. Using such percentages,
we can rate the performance of the process (in this case the delivery time) with
respect to the USL and/or LSL. Cost of failure due to delivery can also be
estimated.

## Requirement

To run the code, you need to have the following:

- .NET Framework 2.0 and above
- Microsoft Visual Studio 2005 if you want to open the project files
included in the download project
- Nunit 2.4 if you want to run the unit tests included in the
download project

## Using the Code

We envisage that the user will perform the following code to get the desired
results. This involves a simple 4-steps process:

- Instantiate a
`ProcessPerformanceFrZ`

object
- Input XBar, StdDev, LowerSpecLimit and UpperSpecLimit.
- Invoke its
`.Analyze()`

method
- Retrieve results from its
`.Result`

object.

Here is a typical user’s code:

ProcessPerformanceFrZ z = new ProcessPerformanceFrZ();
z.XBar = 13.5;
z.StdDev = 4;
z.LowerSpecLimit = 7;
z.UpperSpecLimit = 20;
z.Analyze();
Console.WriteLine("Expected % > USL is: " + z.Result.PercentMoreThanUSL);
Console.WriteLine("Expected % < LSL is: " + z.Result.PercentLessThanLSL);
Console.WriteLine("Expected yield (overall) % is: " + z.Result.PercentMoreThanUSL);

Two classes are implemented:

`ProcessPerformanceFrZResult`

`ProcessPerformanceFrZ`

`ProcessPerformanceFrZResult`

is a class from which a result object derives,
which holds the analysis results. In our implementation, the .Result member
variable is defined as follows:

public class ProcessPerformanceFrZResult
{
public ProcessPerformanceFrZResult() { }
public double PercentMoreThanUSL;
public double PercentLessThanLSL;
public double PercentYieldOverall;
}

The following table lists the available results (assuming that the
`ProcessPerformanceFrZ`

object name you use is z:

Result | Result stored in variable |

Expected % > USL | z.Result.PercentMoreThanUSL |

Expected % < LSL | z.Result.PercentLessThanLSL |

Expected Yield (overall) % | z.Result.PercentYieldOverall |

## ProcessPerformanceFrZ Class

The `ProcessPerformanceFrZ`

class does the analysis (calculation), and it is
implemented as follows:

public class ProcessPerformanceFrZ
{
private double xBar = 0;
private double s = 0;
private double LSL = 0;
private double USL = 0;
private double percentMoreThanUSL = 0;
private double percentLessThanLSL = 0;
private double percentYieldOverall = 0;
public ProcessPerformanceFrZResult Result = new ProcessPerformanceFrZResult();
#region constructor
public ProcessPerformanceFrZ() { }
#endregion//constructor
public double XBar
{
set { xBar = value; }
}
public double StdDev
{
set { s = value; }
}
public double LowerSpecLimit
{
set { LSL = value; }
}
public double UpperSpecLimit
{
set { USL = value; }
}

Once the `ProcessPerformanceFrZ`

object is instantiated, the user needs to
set input values for mean, standard deviation, lower spec limit, and upper spec
limit as follows:

ProcessPerformanceFrZ z = new ProcessPerformanceFrZ();
z.XBar = 13.5;
z.StdDev = 4;
z.LowerSpecLimit = 7;
z.UpperSpecLimit = 20;

Then the `.Analyze()`

method is called to perform the analysis. Subsequently,
the user can retrieve the analysis results from the `.Result`

object in the
`ProcessPerformanceFrZ`

object.

The `Analyze()`

method is implemented as follows:

public void Analyze()
{
percentMoreThanUSL = 100 * (1 - Excel.NORMSDIST((USL-xBar)/s));
percentLessThanLSL = 100 * (Excel.NORMSDIST((LSL-xBar)/s));
percentYieldOverall = 100 - percentMoreThanUSL - percentLessThanLSL;
Result.PercentMoreThanUSL = percentMoreThanUSL;
Result.PercentLessThanLSL = percentLessThanLSL;
Result.PercentYieldOverall = percentYieldOverall;
}

## Conclusion

The program presented here provides a simple way to obtain process
performance through Z-transformation. With USL and LSL bear in mind, this method
can be used to estimate the chance or probability an event is out of spec.

## History

29th June 2012: Initial post