大家好,
1. 我们可以根据给定的平均值和 95% 置信范围生成随机数据吗? 就像我需要生成 100 个数据,给定平均值 (50) 和 95% 置信区间 (45-56)。
2. 换句话说,可以生成平均值和标准差数据,但可以从 95% CI 范围计算标准差吗?
问候,
约格什尔
我觉得有点奇怪,不知道需要什么。
也许这可能是一种方法,请参阅 JSL 脚本。
作为@P_巴特尔已经指出,我们需要更多的行才能准确地看到(2 位左右)您想要的数字。 我们需要操纵分布以显示您想要的值(不对称)。
拉伸确实使平均值改变了 0.2,这是我没有考虑到的......
当然,您可以只计算 100 行并通过某种方式操作它们以获得您想要的确切数字......
或者您可以使用随机种子,以便下次生成完全相同的随机数。
您看,JMP 可以做到这一切...,欢迎来到社区。
祝你好运。

Names Default To Here( 1 );
// Generate data with 95 % Confidence between 45 and 56 with mean of 50
//
// returns the probability that a normally distributed random variable is less than q (45)
Normal Distribution( 45, 50, 5 );
// 0.158655, i.e. roughly 15 % of values are below 45 for a normal distribution with Average=50 and sigma=5
// Returns the quantile from a Normal distribution, the value for which the probability is p that a random value would be lower
quantile = Normal Quantile( 0.025 );
// -1.959964, i.e. 2.5 % of the values are below -1.959964, or smaller than Average minus -1.959964*sigma
// we need this quantile and have the absolute difference 2.5 % left + 2.5 % right = 5 % out, i.e. 95 % in
sigma = Abs( (50 - 45) / quantile );
Normal Distribution( 45, 50, sigma );
// 0.025, this is what we want
// now we can generate a table with that distribution
// and will scale the upper half by 6/5 to have the probability of 55 at 56 in a second column value_rightstretched
dt = New Table( "random confidence 45 50 56 95%",
add rows( 1000000 ),
New Column( "value", set each value( Random Normal( 50, sigma ) ) , Set Property("Spec Limits", {LSL(45), USL(55), Target(50), Show Limits(1)}),),
New Column( "value_rightstretched", formula( If( :value > 50, (:value - 50) * 6 / 5 + 50, :value ) ) , Set Property("Spec Limits", {LSL(45), USL(56), Target(50), Show Limits(1)}),)
);
dt << Distribution(
Continuous Distribution(
Column( :value ),
Outlier Box Plot( 0 ),
Process Capability( Use Column Property Specs ),
Customize Summary Statistics( Set Alpha Level( 0.01 ) )
),
Continuous Distribution(
Column( :value_rightstretched ),
Outlier Box Plot( 0 ),
Process Capability( Use Column Property Specs ),
Customize Summary Statistics( Set Alpha Level( 0.01 ) )
)
);
谢谢,我在谷歌搜索时也看到了这些,但它对我不起作用。
感谢您的解释,我知道可能性较小,但想知道之前是否有人尝试过,或者可能建议一些生成可以进一步使用的数据的路径。
我同意@jthi的想法是反向计算标准差,从而产生具有某种所需置信水平的总体平均值。 但你只能做到一半。 我看到两个问题......因为您将自己限制为 N = 100。 每次您针对具有指定均值和标准差的正态分布运行 JMP 的随机数生成器时,您将得到 100 个数字...但均值和置信区间不会完全符合您的要求...它将很接近。 ..但不准确。 重新运行随机数生成器,您将得到不同的答案。 所以你无法准确到达那里。 我看到的另一个问题,也许我在这里太字面意思了......但在你原来的帖子中,你寻求的置信区间与平均值不对称......你所说的平均值= 50,下限是45,上限为 56。 再次......不能使用标准总体置信区间方法来完成。