Dataplot Vol 1 Vol 2

# NORMAL KERNEL DENSITY MIXTURE PLOT

Name:
NORMAL KERNEL DENSITY MIXTURE PLOT
Type:
Graphics Command
Purpose:
Generates a normal kernel density mixture plot from means and standard deviations.
Description:
Data for reference materials, interlaboratory studies, and key comparisons is often given as a mean and an associated standard deviation. It is often assumed that the data for each laboratory is from a normal distribution.

This command plots the following:

1. The first curve is the laboratory means versus the laboratory number.

2. The second curve is the mixture of normal probability densities of the individual laboratories. This mixture is computed by

• For each individual laboratory, compute the $$\bar{y} \pm 4 s$$ points where $$\bar{y}$$ and $$s$$ denote the mean and standard deviation of the laboratory.

• Find the minimum and maximum value of these points over all the laboratories. Define a grid of 1,000 equally spaced points between the minimum and maximum point.

• At each grid point, compute the normal probability density function (PDF) for each laboratory (each laboratory will use its own mean and standard deviation for the parameters of the normal distribution). The PDF values for all laboratories are summed and then the value at the grid point is normalized by dividing by the number of laboratories.

• If the maximum density value is < 2.8, the density values are scaled so that the maximum density is 3. This is done for visual resolution of the plot. If the density values themselves are of interest, you can use the NORMAL KERNEL DENSITY MIXTURE (LET) command to obtain them.

• The value NLAB + 1, with NLAB denoting the number of laboratories, is added to the density value to determine the plot position.

3. The third curve is the normal probability densities for the indiviual laboratories. That is, a normal PDF curve is drawn using the mean and standard deviation of the indiviual laboratory. This curve is drawn using 100 points from $$\bar{y} - 3 s$$ to $$\bar{y} + 3 s$$. The value NLAB is added to the vertical value to obtain the plotting position.

4. The fourth curve draws a solid line from $$\bar{y} - 2 s$$ to $$\bar{y} + 2 s$$. The vertical coordinate is set to NLAB.
Syntax:
NORMAL KERNEL DENSITY MIXTURE PLOT <ymean> <ysd>
<SUBSET/EXCEPT/FOR qualification>
where <ymean> is a response variable containg the means;
<ysd> is a response variable containng the standard deviations;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
NORMAL KERNEL DENSITY MIXTURE PLOT YMEAN YSD
NORMAL KERNEL DENSITY MIXTURE PLOT YMEAN YSD SUBSET YSD > 0
Note:
For small values of the standard deviation, the normal PDF for a given laboratory may be greater than 1 and therefore overlap the normal PDF for one or more succeeding laboratories. You can use the following command to multiply the density value by a constant to minimize this overlap

SET NORMAL KERNEL DENSITY MIXTURE PLOT EXPANSION FACTOR <value>

where <value> has a default value of 1. If <value> is less than 0.01, it will be set to 1.

This expansion factor will be applied to all of the normal PDF curves. This is used for visual purposes only. It is the shape and height of the normal PDF curves relative to the other laboratories that is relevant in this graph. The expansion factor maintains this relative height.

Note:
The appearance of the plot can be controlled with the various LINE and CHARACTER commands. This is demonstrated in the program example below.

The settings for trace 3 apply to all of the normal PDF curves for the individual laboratories. Likewise, the settings for trace 4 apply to all of the $$\bar{y} \pm 2 s$$ lines.

Note:
The HORIZONTAL SWITCH command can be used to draw these graphs vertically rather than horizontally. This is demonstrated in the program example below.
Default:
None
Synonyms:
None
Related Commands:
 NORMAL KERNEL DENSITY MIXTURE = Compute the normal kernel density mixture for a set of means and associated standard deviations. CONSENSUS MEANS = Perform a consensus means analysis. E691 = Perform an E-691 analysis.
Reference:
Duewer (2008), "A Comparison of Location Estimators for Interlaboratory Data Contaminated with Value and Uncertainty Outliers", Accredited Quality Assurance, Vol. 13, pp. 193-216.
Applications:
Interlaboratry Analysis
Implementation Date:
2017/07
Program:
. Step 1:   Read the data (from David Duewer paper)
.
skip 25
.
. Step 2:   Set some plot control features
.
label case asis
title case asis
title offset 2
y1label Measurement Value
x1label Lab
title Normal Kernel Density Mixture Plot for Duewer Data
.
xlimits 1 10
major x1tic mark number 10
minor x1tic mark number 0
tic mark offset units data
x1tic mark offset 1 3.2
ylimits 100 110
major y1tic mark number 6
minor y1tic mark number 1
y1tic mark offset 1 1
horizontal switch on
.
line blank
line thickness 0.1 0.1 0.1 0.2
line color black black red blue
character circle
character hw 1 0.75
character fill on
.
normal kernel density mixture plot ymean ysd
.
line solid
drawdsds 10 20 10 90


NIST is an agency of the U.S. Commerce Department.

Date created: 07/28/2017
Last updated: 07/28/2017