分布平台几何平均值的置信区间你好,
是否有任何快捷方式可以从分布平台获取几何平均值的置信区间?
基础数据分析和建模数据探索和可视化回复:分布平台几何平均值的置信区间你好伊恩,
那很完美。 非常感谢您的建议。
回复:分布平台几何平均值的置信区间如果您只关心时间间隔,则可以使用这种方法来获取它,这种方法要快得多,因为您没有 Bootstrap 通用性所需的所有平台启动的开销:
NamesDefaultToHere(1);
// Get some data
dt = Open("$SAMPLE_DATA/Big Class.jmp");
n = NRow(dt);
dataVec = dt[0, "height"]; // Get the requisite data as a vector
nb = 100000; // Number of bootstrsp samples
gms = J(nb, 1, .); // Vector to hold the geometric mean of each bootstrap sample
for(s=1, s<=nb, s++, // Loop over bootstrap samples
pickMe = J(n, 1, RandomInteger(1, n)); // Indices of elements to compose this bootstrap sample
bootstrapSampleVec = dataVec[pickMe]; // Values in this bootstrap sample
gm = exp(Mean(ln(bootstrapSampleVec))); // Geometric mean of this bootstrap sample
gms[s] = gm;
);
gm95 = Quantile(0.95, gms);
gm05 = Quantile(0.05, gms);
Print("The Geometric Mean lies betweeen "||Char(Round(gm05, 3))||" and "||Char(Round(gm95, 3))||".");
这段代码可能可以并行化以使其更快,但会损失一些可读性。
回复:分布平台几何平均值的置信区间我没有将细节与指导进行比较@马克贝利引用,但您也可以尝试引导程序(交互式或通过 JSL)。 例如:
NamesDefaultToHere(1);
// Get some data
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Use Distribution
dist = dt << Distribution(
Continuous Distribution(
Column( :height ),
Quantiles( 0 ),
Vertical( 0 ),
Outlier Box Plot( 0 ),
Customize Summary Statistics(
Mean( 0 ),
Std Dev( 0 ),
Std Err Mean( 0 ),
Upper Mean Confidence Interval( 0 ),
Lower Mean Confidence Interval( 0 ),
N( 0 ),
N Missing( 0 ),
Geometric Mean( 1 )
)
)
);
// Bootstrp the statistic in question (note 'dt2' is a list)
dt2 = Report(dist)[TableBox(1)] << Bootstrap(1000);
// Inspect the bootstrp distribution
dist2 = dt2[2] << runScript("Distribution");
// Get the confidence interval for the statistic by inspection or further JSL . . .回复:分布平台几何平均值的置信区间另一种方法,不使用 JSL,但对对数正态分布做出相同的假设;使用分发平台,分析数据的自然日志。 然后可以通过 Exp 反向转换获得的均值和置信区间。 所得区间是 GM 的置信区间。
回复:分布平台几何平均值的置信区间嗨马克,
非常感谢您的快速反馈。
回复:分布平台几何平均值的置信区间该结果无法从分发平台或 JMP 中的任何其他位置获得。 可以使用本中的指导来编写计算脚本DO 循环博客文章。 SAS/IML 与 JMP JSL 类似,因此转换还不错。