分散分析を行っており、調査している多数のサブグループの不偏分散推定値を確認する必要があります。手持ちの d2 テーブルを使用して手動で計算することもできますが、それを式に組み込む方法があることを期待していました。カイ二乗分布から導出できることは知っていますが、そのための数学がありません。
d2 を抽出する直接的な方法、または手動で構築する背後にある数学に関するヘルプがあれば役立つでしょう。
ありがとう
エヴァン・モリス
JMP15 リリースで、管理図の定数/不偏化定数/バイアス調整定数が最大 50 のサンプル サイズに対して計算されるようになったことに気付きました。 JMP のサンプル データ、ティーチング スクリプト、またはその他の下にスクリプトがあるかどうかを確認することに興味がありました。 JMP をそのまま使用してこのテーブルを作成できるかどうか知っている人はいますか? Ian の関数を基にして、SPC クラスを教えるためのテーブルを作成する次のスクリプトを作成しました。 表は小数点以下 5 桁までであり、誰でも Col > Standardize Attributes を使用して形式を 3 または 4 に変更できます。 SAS ソフトウェアのドキュメントにも、d2、d3、および c4 の関数が記載されています。 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);
);
久しぶりにd2のやつを見ました!
// https://v8doc.sas.com/sashtml/qc/chapc/sect9.htm
NamesDefaultToHere(1);
calculateD2 =
Function({n}, {Default Local},
d2 = Round(Integrate(1 - Power(1 - NormalDistribution(x), n) - Power(NormalDistribution(x), n), x, ., .), 5);
);
for(n=2, n<=25, n++, Print(n, calculateD2(n)));いいえ、母集団標準偏差の不偏推定値 (シグマハット) を探しています。これは、サブグループのサンプル標準偏差 (s) と不偏定数 (サンプル サイズと方法に応じて d2 または c4 のいずれか) から計算できます。使ってるよ)。
同じサイズのサブグループが 30 個あるとします (n=4)。サブグループ内の標準偏差を平均することで S バーを計算できます。次に、s バーを c4 で割って、母集団標準偏差の不偏推定値を決定します。
私の問題は、サブグループのサイズがさまざまであるため、一度検索してテーブルに入れることができないことです。また、d2 と c4 が必要かどうかについては、少し迷っています (でも、それは私の問題です。後で整理します)。
いずれにせよ、これらのパラメーターが JSL の関数で簡単に抽出できることを望んでいました。管理図や SQC の作業では非常に一般的です。
サブグループの分散を探していますか?
https://en.wikipedia.org/wiki/Variance#Sample_variance
これは列標準偏差の 2 乗になります。式は (Col Std Dev(col, by1, by2, ...))^2 となります。
以下のスクリプトを実行します。これは、「表」>「概要」を使用して見つけることもできます。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Standard Variance for Each Age and Sex Group",
Formula( (Col Std Dev( :height, :age, :sex ))^2 )
);