I noticed in JMP15 release that the Control Chart constant/unbiasing constant/bias adjustment constant will be calculated now for sample sizes up to 50. I was curious to see if JMP had any script under Sample Data, Teaching Scripts, or other. Does anyone know if JMP as is can create this table? I built on Ian's function, and made the following script for creating the table for teaching SPC classes. The table is to 5 decimal places, anyone can use Col > Standarize Attributes to change the format to 3 or 4. Also in the SAS software documentation there are functions for d2, d3, and c4. Maybe add the ability to script or add the table in JMP16?
// from post by ian_jmp to question on
// "Accessing Control Chart constants/unbiasing constants"
// add the complete table up to 25
Names Default To Here( 1 );
calculateD2 = Function( {n},
{Default Local},
d2 = Round( Integrate( 1 - Power( 1 - Normal Distribution( x ), n ) - Power( Normal Distribution( x ), n ), x, ., . ), 5 )
);
calculateD3 = Function( {n, d2},
{Default Local},
d3 = Round(
sqrt(
2 * (Integrate(
Integrate(
1 - Power(Normal Distribution(y),n) - Power( 1 - Normal Distribution(x),n) + Power( (Normal Distribution(y) - Normal Distribution(x)), n )
, x, ., y)
, y, ., . )) - d2^2
)
, 5 )
);
calculateC4 = Function( {n},
{Default Local},
c4 = Round( gamma(n/2) * sqrt(2/(n-1)) / gamma((n-1)/2), 5 )
);
// create table following example tables showing x-bar constants first (A2, A3)
// then d2 sigma estimate, then the R chart and S chart constants
dt = New Table("Table of Control Chart Constants",
Add Rows(24),
New Column("Sample size", Numeric, Continuous),
New Column("A2", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("A3", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("d2", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("d3", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("D3", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("D4", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("c4", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("B3", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
New Column("B4", Numeric, Continuous, Format( "Fixed Dec", 8, 5 )),
); Wait(0);
For( n = 2, n <= 25, n++,
Column(dt,"Sample size")[n-1] = n;
Column(dt,"d2")[n-1] = d2 = calculateD2( n ); Wait(0);
Column(dt,"d3")[n-1] = d3 = calculateD3( n, d2 ); Wait(0);
D3temp = 1 - 3*d3/d2;
If(D3temp > 0,
Column(dt,"D3")[n-1] = D3temp,
Column(dt,"D3")[n-1] = 0 // for negative values
);
Column(dt,"D4")[n-1] = 1 + 3*d3/d2;
Column(dt,"A2")[n-1] = 3/(d2*sqrt(n));
Column(dt,"c4")[n-1] = c4 = calculateC4( n ); Wait(0);
Column(dt,"A3")[n-1] = 3/c4/sqrt(n);
B3temp = 1 - 3 * sqrt(1/c4^2 - 1);
If(B3temp > 0,
Column(dt,"B3")[n-1] = B3temp,
Column(dt,"B3")[n-1] = 0
);
Column(dt,"B4")[n-1] = 1 + 3 * sqrt(1/c4^2 - 1);
);