我正在进行方差分析,需要查看我正在查看的多个子组的无偏方差估计。我可以使用我拥有的 d2 表手动计算它们,但我希望有一种方法可以将其放入公式中。我知道它可以从卡方分布中推导出来,但我没有数学知识。
任何有关提取 d2 的直接方法或手动构建它背后的数学的帮助都会有所帮助。
谢谢
埃文·莫里斯
我注意到在 JMP15 版本中,现在将计算最多 50 个样本量的控制图常数/无偏常数/偏差调整常数。 我很好奇 JMP 在示例数据、教学脚本或其他下是否有任何脚本。 有谁知道JMP是否可以创建这个表? 我以 Ian 的函数为基础,制作了以下脚本来创建 SPC 课程教学表。 该表精确到小数点后 5 位,任何人都可以使用“Col”>“标准化属性”将格式更改为 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)));不,我正在寻找总体标准差(sigma-hat)的无偏估计,它可以根据子组样本标准差(s)和无偏常数(d2或c4,取决于样本大小以及我如何计算)来计算。正在使用它们)。
假设我有 30 个相同大小的子组 (n=4)。我可以通过对子组内标准差进行平均来计算 S-bar。然后我可以将 s-bar 除以 c4 并确定总体标准差的无偏估计。
我的问题是我有不同的子组大小,所以我不能只查找一次并将其放入表中。我对于是否需要 d2 还是 c4 也有点奇怪(但这是我的问题,我会解决它)。
不管怎样,我只是希望这些参数可以通过 JSL 中的函数轻松提取,它们在控制图/SQC 工作中非常常见。
您在寻找子组的方差吗?
https://en.wikipedia.org/wiki/Variance#Sample_variance
这将是计算标准差的平方,公式为 (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 )
);