正态分布和变换大家好,
我有一些测量数据,当我尝试连续正态拟合时,我可以看到我的数据不正常。 但是,从拟合优度检验中我可以看到数据来自 Johnson Su 分布。
该分布具有两种形状、一种位置和一种尺度参数。 从我的在线研究中,我可以了解如何计算这些参数的方差以及标准差。 我用 Excel 来计算,但是 JMP 有办法做到这一点吗? 根据我的理解,“分布”分析中的摘要统计表会假设数据来自正态分布来计算这些统计数据。
提前致谢!
娜塔莉
回复:正态分布和变换谢谢你的回复,txnelson。 我没有想到这一点,我也没有想到会是这样。 我想知道如果它使得不可能准确地反转转换,那么该转换的价值是什么。 如果我根据转换后的数据开发模型,我需要知道该模型的原始数据形式的输出是什么。 那么,JMP 甚至将这种转换作为一种选择,这似乎很愚蠢。 对原剧本表示敬意。 我将保存它以供将来需要时使用。回复:正态分布和变换该脚本不适用于密度变换。该函数为同一密度值生成多个值,而代码无法处理该问题。见下图

回复:正态分布和变换也许这是我的数据集? 简而言之,我从数据集中选择一个值,并提取对数正态转换值来测试/验证代码。 我的数据集如下。 值 7 对应于转换后的值 0.112832236739791,因此我应该能够使用转换后的值作为代码中的目标,并且脚本应该输出 7。 正确的?
Names Default to Here(1);
dt=New Table( "Test",
Add Rows( 30 ),
New Column("PNP3",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values(
[12, 4, 12, 13, 7, 5, 5, 15, 5, 5, 5, 15, 7, 7, 16, 5, 9, 11, 18, 8, 16, 12, 7, 14, 6, 11, 7, 10, 14, 10]
)
),
New Column( "LogNormal Density PNP3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Normal Density( Log( :PNP3 ), 2.17970974904887, 0.43804625261609 ) / :PNP3
)
)
);
/***********************************************************************/
/* */
/* The getformula column retrieves the formula from the translation */
/* column and replaces the Original Column name in the formula with */
/* string "__value__". The value of this variable is what will be */
/* evaluated in the successive approximations done by the script. */
/* */
/***********************************************************************/
getformula = Function( {ColName, FormulaColName},
{ColName, FormulaColName, TheFormula, coloncolname},
//__value__ = .;
// Get the transformed data columns formula as a literal string
TheFormula=Column( FormulaColName ) << Get Formula ;
// Check to see that a formula was found
If( Is Empty( TheFormula ) == 1 ,
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a formula. ",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula=char( Column( FormulaColName ) << Get Formula );
// Get the actual name of the orignal column since
// the upper,lower case and spacing is critical in determining
// where in the formula the column name actually occurs
ColName = Column( ColName ) << Get Name;
// Determine if the reference to the column name in the
// formula is a simple :colname reference or a complex
// reference :Name(\!"colname\!")
// If the column name isn't found set the return code to -1
If(
Contains( TheFormula, ":" || ColName ), ColonColName = ":" || ColName, // Else
Contains( TheFormula, ":Name(\!"" || ColName || "\!")" ), ColonColName = ":Name(\!"" || ColName || "\!")", // Else
rc = -1
);
// Replace all of the column references in the formula with
// the string "(__value__)" so that when the formula is
// evaluated later, it will take the then value of the memory
// variable called __value__ and use it in the formula
If( Contains( TheFormula, ColonColName ) > 0,
While( Contains( TheFormula, ColonColName ) > 0, TheFormula = Munger( TheFormula, 1, ColonColName, "(__Value__)" ) ),
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a reference",
" to the original column.",
" in it's formula.",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula;
);
/***********************************************************************/
/* */
/* The gettrans function evaluates the formula in the transformed */
/* and converts the formula into a generic form for repeated use in */
/* running of the script. */
/* */
/***********************************************************************/
gettrans = Function( {ColName, FormulaColName, TheTarget, Theformula},
//colname="PNP3";formulacolname="Johnson Sl Transform PNP3"; Thetarget=johnsonmean;theformula=myformula;
{ColName, FormulaColName, TheFormula, High, Low, TheTarget, TheMax, Themin, __value__},
// The program uses successive approximations to determine the different
// parametrics. The way it works is that it calculates the needed parameter
// such as Mean, or Standard Deviation, and then by using successive
// approximations from the original column's values, and passing those
// values through the columns formula, when the approximation value matches
// the calculated value from the transformed column, the retransformed value
// has been found
// Set the extreem values
High = Col Maximum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
Low = Col Minimum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
// Make a guess at the first value
__value__ = Mean( High, Low );
// Iterate the guessing for up to 100 times, adjusting by 1/2 on each loop
For( i = 1, i <= 100, i++,
TheResult = Eval( Parse( theformula ) );
If(
TheResult > TheTarget, High = __value__,
TheResult < TheTarget, Low = __value__,
Break()
);
If( High == Low, Break() );
__value__ = Mean( High, Low );
);
__value__; // Expose the return value
); // End of function gettrans
myFormula = getformula( "PNP3","LogNormal Density PNP3" );
MatchValue = 7;
TargetValue = 0.112832236739791;
dt<<RUN formulas=""></RUN>
运行代码后,日志输出如下
MatchValue = 7;
TargetValue = 0.112832236739791;
Gettrans("PNP3", "LogNormal Density PNP3", 0.112832236739791, myFormula) = 18;
Gettrans 函数的输出应为 7。 代码输出的值 18 对应于转换后的值 0.0135701784925184。
回复:正态分布和变换我不明白这是什么问题?由于所有代码所做的都是从原始列中获取值并将它们传递给公式,直到结果等于转换列中的目标值(通常是新分布的平均值)。我根据之前的回复重新编写了脚本,但这一次,使用由分布平台确定的对数正态密度公式,并且代码似乎对我有用
Names Default to Here(1);
dt=New Table( "Test",
Add Rows( 100 ),
New Column("PNP3",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values(
[130.378809500886, 132.736937590235, 136.831952164704, 136.969154239163,
136.622623419893, 137.480356512481, 138.094011176166, 142.10586919757,
134.750041237898, 129.719685093372, 136.520172900026, 134.778624216716,
136.991131754497, 140.420940666186, 143.257827228986, 132.213765487819,
144.671172276421, 134.703176752174, 136.744212473486, 137.187637284245,
139.788226018039, 139.372617199359, 136.112484488985, 142.809097034809,
137.799370430979, 138.482493403385, 135.236982575217, 136.251777781494,
130.768356509183, 138.248554728086, 139.77894292052, 134.25405167366,
147.680687116943, 131.351711991517, 132.84274608728, 129.925216236015,
133.47206414316, 143.339607103893, 145.341236691691, 139.200187547183,
142.775409342827, 140.276696563388, 130.623979847275, 140.899814366103,
136.839389290019, 137.239125319, 133.5265281641, 139.356927352471,
130.278640163464, 144.604061001983, 135.286715550332, 134.465744849174,
131.37612790407, 131.830655714309, 140.69724979219, 142.88152043774,
135.253839945611, 127.349434776131, 129.499730399113, 128.447533754611,
130.916853702805, 134.599575929218, 140.761701916093, 136.870661473033,
138.253066182015, 140.403627077024, 134.522643679098, 124.842978178703,
131.803059455053, 125.886786494664, 133.013566701611, 136.940299158936,
133.263913979648, 144.695171321015, 149.541020434399, 144.503845528521,
136.086324063453, 139.530943158798, 138.421460162451, 133.180943784947,
142.166796633818, 142.676541730822, 135.723943440339, 143.957996114985,
145.712158558794, 138.38937502716, 140.535304753392, 142.140619481175,
131.379414509756, 144.949299702964, 133.349854687882, 139.470639804255,
140.160558367008, 137.130662662612, 145.692632562344, 131.870848869966,
136.391733804566, 134.219740661271, 139.021827550389, 147.958038547157]
)
),
New Column( "LogNormal Density PNP3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Normal Density( Log( :PNP3 ), 4.92072961984847, 0.0370684539915594 ) / :PNP3
)
)
);
/***********************************************************************/
/* */
/* The getformula column retrieves the formula from the translation */
/* column and replaces the Original Column name in the formula with */
/* string "__value__". The value of this variable is what will be */
/* evaluated in the successive approximations done by the script. */
/* */
/***********************************************************************/
getformula = Function( {ColName, FormulaColName},
{ColName, FormulaColName, TheFormula, coloncolname},
//__value__ = .;
// Get the transformed data columns formula as a literal string
TheFormula=Column( FormulaColName ) << Get Formula ;
// Check to see that a formula was found
If( Is Empty( TheFormula ) == 1 ,
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a formula. ",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula=char( Column( FormulaColName ) << Get Formula );
// Get the actual name of the orignal column since
// the upper,lower case and spacing is critical in determining
// where in the formula the column name actually occurs
ColName = Column( ColName ) << Get Name;
// Determine if the reference to the column name in the
// formula is a simple :colname reference or a complex
// reference :Name(\!"colname\!")
// If the column name isn't found set the return code to -1
If(
Contains( TheFormula, ":" || ColName ), ColonColName = ":" || ColName, // Else
Contains( TheFormula, ":Name(\!"" || ColName || "\!")" ), ColonColName = ":Name(\!"" || ColName || "\!")", // Else
rc = -1
);
// Replace all of the column references in the formula with
// the string "(__value__)" so that when the formula is
// evaluated later, it will take the then value of the memory
// variable called __value__ and use it in the formula
If( Contains( TheFormula, ColonColName ) > 0,
While( Contains( TheFormula, ColonColName ) > 0, TheFormula = Munger( TheFormula, 1, ColonColName, "(__Value__)" ) ),
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a reference",
" to the original column.",
" in it's formula.",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula;
);
/***********************************************************************/
/* */
/* The gettrans function evaluates the formula in the transformed */
/* and converts the formula into a generic form for repeated use in */
/* running of the script. */
/* */
/***********************************************************************/
gettrans = Function( {ColName, FormulaColName, TheTarget, Theformula},
//colname="PNP3";formulacolname="Johnson Sl Transform PNP3"; Thetarget=johnsonmean;theformula=myformula;
{ColName, FormulaColName, TheFormula, High, Low, TheTarget, TheMax, Themin, __value__},
// The program uses successive approximations to determine the different
// parametrics. The way it works is that it calculates the needed parameter
// such as Mean, or Standard Deviation, and then by using successive
// approximations from the original column's values, and passing those
// values through the columns formula, when the approximation value matches
// the calculated value from the transformed column, the retransformed value
// has been found
// Set the extreem values
High = Col Maximum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
Low = Col Minimum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
// Make a guess at the first value
__value__ = Mean( High, Low );
// Iterate the guessing for up to 100 times, adjusting by 1/2 on each loop
For( i = 1, i <= 100, i++,
TheResult = Eval( Parse( theformula ) );
If(
TheResult > TheTarget, High = __value__,
TheResult < TheTarget, Low = __value__,
Break()
);
If( High == Low, Break() );
__value__ = Mean( High, Low );
);
__value__; // Expose the return value
); // End of function gettrans
myFormula = getformula( "PNP3","LogNormal Density PNP3" );
dt<<RUN formulas=""></RUN>回复:正态分布和变换嗨特克斯尼尔森,
我对您链接的程序/脚本有疑问。 它可以轻松逆转约翰逊变换,但不适用于其他变换。 特别是对数正态密度变换。 您介意我私信您看看是否有办法修改脚本以使其工作吗?回复:正态分布和变换该专栏名为“Johnson Sl Transform X By Timepoint”是转换后的数据。此列包含标准化数据。您将根据此专栏进行分析。
因此,当您运行分析以确定 Timepoint1 和 Timepoint2 数据之间是否存在差异时,您将在转换后的数据列上运行它。现在的问题是,它将报告转换后数据规模的值。因此,为了将其与原始列 X 关联起来,您可以运行脚本,输入分析中的数据点值,然后返回以 X 表示的值。
回复:正态分布和变换当然,正如我之前发布的那样,脚本应该单独运行。 为了方便起见,我只附上了单个文件 (Test.jmp)。您的脚本是否应该在名为 Y(在该数据表文件中)的第三列中记录约翰逊 SI 转换后的正常数据,以便运行它并查看其正常形状?
问题是脚本中没有命令行来保存该数据表中的普通数据。 这就是为什么有人问我这个问题。
如果您查看这些拆分文件之一并运行脚本,则第三列 Y 仍为空白。 我认为每个分割数据表都可以由第三列 Y 中约翰逊 SI 转换后的正常数据来完成,因为之后我想将它们再次合并到一个文件中以进行统计分析。
时间点1:
约翰逊均值 = -3.80945275324507e-15;
列平均值(:X) = -7.4569375;
Gettrans("X", "Johnson Sl 按时间点变换 X", JohnsonMean, myFormula) = -10.7617217296089;
时间点2:
约翰逊均值 = 7.27196081129478e-15;
列平均值(:X) = 3.257375;
Gettrans("X", "Johnson Sl 按时间点变换 X", JohnsonMean, myFormula) = 1.87687074670016;
感谢您的帮助。
回复:正态分布和变换您的问题的解决方案必须引入人为决定,即您是否知道不同时间点数据组来自不同的总体分布这一事实?我的假设是,确定总体分布是否属于正态分布的最佳方法是将所有数据合并到一个评估中。接下来是对所有数据使用单一转换,然后对转换后的数据执行后续分析。任何真正的差异都应该在转换后的数据中被识别出来。现在,如果您对来自不同分布的时间点组有独立的先验知识,那么您将需要将数据子集到单独的时间点组中,并在不同的子集上单独运行脚本。
回复:正态分布和变换嗨吉姆,
我认为这里有一个误解。 虽然,日志文件显示:
JohnsonMean = 1.72084568816899e-15;
Col Mean(:X) = -2.09978125;
Gettrans("X", "Johnson Sl Transform X By Timepoint", JohnsonMean, myFormula) = 1.1;您的脚本不会将“Johnson SI Transformation By Timepoint”列中的正常数据保存到我的数据表中的 Y 列中。
最好的,
雷纳尔多
回复:正态分布和变换返回包含组合时间点的数据表。然后转到“分布”并针对转换后的数据运行它。
然后,前往
帮助==>书籍==>探索JMP
您必须详细了解 JMP 的工作原理!
回复:正态分布和变换我创建了两个子集:每个时间点一个。 在哪里使用日志文件的输出来获取和绘制正常数据?
回复:正态分布和变换1. 好的,我单独运行一下。
2. 我有您提到的那些输出(日志文件)和 Johnson SI Transform X By Timepoint(= 非正态分布),但没有分配给 Y 列的数据。
回复:正态分布和变换1. 如果您需要为每个时间点获取单独的结果,则需要将数据表子集为每个时间点的单独表,然后分别在每个时间点上运行脚本。
2. 现在,您需要使用转换后的数据列继续进行分析,就好像它是您的 Y 列一样。
3.阅读并消化文档
帮助==>书籍==>探索JMP
回复:正态分布和变换抱歉,我没有告诉你日志文件,因为我找不到它。 我是 JMP 的初学者。 现在我可以找到它:查看 -> 日志。
好的,我添加了该命令行,得到了相同的结果!
下一步是什么? :D
PS:脚本不是分别考虑两个时间点来计算这些参数吗? 也许,名为“Timepoint”的新参数将被添加到“getformula”和“gettrans”函数中。
回复:正态分布和变换1. 我在最近的回复之一中请求您查看日志以查看是否有任何错误。我运行了脚本,正如您上次回复所附的数据表中所包含的那样。在查看日志时,它指定:
The namespace "dt" is not defined in access or evaluation of 'dt:Johnson Sl Transform X By Timepoint' ,
dt:Johnson Sl Transform X By Timepoint/*###*/
考虑到这一点,并查看脚本,“dt”引用位于行中
JohnsonMean = Col Mean( dt:Johnson Sl Transform X By Timepoint );
在这种情况下,dt 正在寻找一个名为 dt 的变量,该变量指向要从中读取数据的数据表。因此,对程序的更正是在代码中使用引用之前添加以下行。
dt=current data table();
我将其添加到代码副本中,作为脚本中的第一行。
一旦我这样做了,在日志中我从脚本中得到了以下结果
JohnsonMean = 1.72084568816899e-15;
Col Mean(:X) = -2.09978125;
Gettrans("X", "Johnson Sl Transform X By Timepoint", JohnsonMean, myFormula) = 1.1;
请注意......结果在日志文件中......
回复:正态分布和变换谢谢你的帖子,吉姆! 我想现在能力分析已经明白了! 
关于从非正态数据到正态数据的转换,我创建了一个示例(Test.jmp),其中包含两个时间点和 X 作为非正态变量。 我按照你的程序操作:
1. 分析->分布
2. X 为“Y,列”,时间点为“By”
3.我单击“分布时间点”->“堆栈”
4. 对于每个时间点,我单击红色三角形和“连续拟合 -> Johnson SI”
5.我点击“Fitted Johnson SI -> 保存转换后的”
然后 JMP 生成“Johnson SI Transform X By Timepoint”列
所以,这就是重点:我尝试运行位于 Test.jmp 左上角的脚本,但没有任何反应。
请您解释一下我在该脚本中做错了什么?
PS:我希望 Y 列代表 Johnson SI 变换后 X 的正态性。
非常感谢!
回复:正态分布和变换它们通常应用于制造过程
回复:正态分布和变换我是否正确地认为 Cp 和 Cpk 不适用于心理学领域,而是应用于工程、过程控制等领域?
回复:正态分布和变换Cp/Cpk 分析完全受规格限支配。是的,您可以生成 3k 规格限制,但是,在如此有限的测量空间上使用它们在我看来只是产生数字的练习,而不是任何真正意义的东西。
回复:正态分布和变换关于能力分析,我在您之前的一篇文章中看到了它的设置,当时您在 URL 中向我解释了“如何将非数据转换为正常数据的步骤”: https://community.jmp.com/t5/Discussions/Normal-Distributions-and-Transformations/td-p/28662/page/2?lightbox-message-images-53315=9889i529042A0AA61277A (第2页)
看起来“能力分析”正在衡量一个系统是否能够满足统计过程控制中的一组规范或要求,不是吗? 所以它不适用于我的情况。
回复:正态分布和变换我会再问一次,但更直接地问,为什么您认为需要对数据进行能力分析?
除此之外,考虑到脚本没有为您提供任何可见的输出,日志中是否有任何消息表明有任何错误?
回复:正态分布和变换1.虽然,我读了能力分析“衡量过程与定义的规格限制的一致性”,但不幸的是我并没有准确理解它在统计中的含义。
2. 因此,当创建新列“Johnson SI”时,我确实需要运行您的脚本。 (最初,我认为没有必要运行它)。 无论如何,我尝试运行它。 就我而言,数据表采用列格式。 我尝试调整您的脚本,删除创建数据表的第一部分,并插入列名称而不是 PNP3 和“Johnson SI Transform PNP3”,并将其保存在左上角的框中(数据名称下方)文件)在数据文件内。 当我运行它时,什么也没有发生。 (我不知道我是否正确保存了它,或者是否发生了与列名有关的任何解析错误,因为它们不在脚本中,而是在数据文件中)。 拜托,吉姆( @tx尼尔森),如何使用列格式数据文件运行您的脚本?
非常感谢!
回复:正态分布和变换1. 您必须告诉我您想通过能力分析做什么。我的背景是心理学和工程学。您可以使用 Cp/Cpk 来对功能进行一定程度的估计,但由于您在一组数据中使用它,而不是基于实际的规格限制,因此我会发现该统计数据有些可疑。
2、对数据进行变换的目的是将数据变换成服从正态分布的分布。这样做的理由是,许多统计检验都是基于正态分布的数据。Wilconon 统计量是一种非参数检验。它不需要正态分布。
回复:正态分布和变换我知道我需要运行你的脚本。 如果我不运行它,我可以看到该列已标准化,但是......
1. 在什么情况下应该使用能力分析中的这些参数?
2. 当我在重复测量设计中运行非正态数据时,我可以通过非参数多重比较测试(例如,Wilcoxon 每对)的结果发现对我在各个时间点分析的变量有显着影响。 然而,当我运行数据(哪一列已使用 Johnson SI 进行转换)时,这种显着影响在各个时间点上消失了。 那么,我应该相信哪个结果呢?
回复:正态分布和变换是的.....
回复:正态分布和变换好的。 之后我应该运行您的脚本将 Johnson SI 专栏转换为正常状态吗?
回复:正态分布和变换从 Fitted Johnson SI 轮廓框中的红色三角形中选择“保存变换”。它将使用 Johnson SI 转换创建新的数据列
回复:正态分布和变换嗨吉姆( @tx尼尔森),
谢谢你的文章。 我读了你建议的链接。 据我了解,我可以通过能力分析使用 Johnson SI 拟合分布,在 <分布类型> 上选择“Johnson SI”,或者我可以运行拟合分布,然后单击红色三角形能力分析,我可以找到规格限制为你建议的。
我同意您的观点,传统上,规格限值是根据测量数据的了解来确定的。 然而,我相信它适用于工程领域。 在心理学领域,很难了解这些限制,而只能了解收集到的数据。 这样,我认为我应该运行 Johnson SI 的拟合分布,然后单击红色三角形 ==> 设置 K 西格玛的规格限制,选择 K 值 = 3。
当我这样做时,我得到了分位数西格玛和约翰逊 SI 的拟合图。 但是,我没有得到数据的正常形状,只有来自能力分析的参数(规格限制)。 请问下一步是什么?
谢谢。
回复:正态分布和变换1.我建议您访问JMP网页并阅读分发平台上的文档
JMP 网页==支持==>在线文档==基本分析==>分布
它将让您很好地了解该工具可以为您做什么。您声明您正在使用 JMP 10。最新的 JMP 版本是 14(即将发布),网络上的文档是 JMP 14。但是,您会发现,几乎所有您在文档中读到的内容都可以在 JMP 10 中找到。
2. 数据分布形状(即正态分布、Johnson SI 分布、对数正态分布等)的确定不是由能力分析确定的。事实上恰恰相反。分布的形状决定了使用什么公式来计算数据的能力。
3. 你似乎不明白能力分析的局限性。传统上,规格限值是根据测量数据的知识确定的。也就是说,如果您正在测量电气元件的电压,则零件的设计将规定,为了使零件正常工作,电压需要介于规格下限 (LSL) 和规格上限 (USL) 之间。这些限制将用于确定过程的能力。
4. 在许多情况下,您想要从分发平台中得到的只是确定数据是否呈正态分布。为什么这很重要,是因为许多统计分析都假设数据呈正态分布。所以对数据进行变换的目的就是将数据变成正态分布,这样统计检验才能提供更准确的结果。
回复:正态分布和变换此外,我是 JMP 的初学者,这是我尝试进行的第一次转换,但它涉及重复测量设计,因此具有额外的复杂性。
我还没有找到“能力分析”和“Fitted Johnson SI”之间的关系。 我的意思是如果我选择《能力分析》首先,假设我正确输入上述参数(我之前的帖子),那么我将选择”连续拟合==>全部”,选择Johnson SI。 这样,JMP 是否会考虑“能力分析”中输入的信息来评估“拟合的 Johnson SI”?
PS:我的数据采用高(或长)格式:行由主题表示;第一列是时间点(T1、T2、...),第二列是 OUT。 当我单击 Fitted Johnson SI==>Save Transformed 为每个时间点时,名为“Johnson SI Transform OUT by Timepoints”的同一列将使用这些转换后的分数完成。 之后,我尝试使用“选择角色变量”框中的“Johnson SI Transform OUT by Timepoints”列和“构造模型效果”中的{时间点、主题和随机、主题*时间点和随机}在拟合模型中运行统计分析“ 盒子,但我无法得到任何相关结果。
我想我需要在获得“Johnson SI Transform OUT by Timepoints”(转换后的数据)列后立即运行您的脚本。 我对吗?
这是我的下一个疑问:理解您描述为解决方案的过程。 我运行了你的例子,真是太棒了! 我需要学习如何“从转换后的数据中获取标准差,计算 1、2、3 等标准差的平均值之上和之下的值,然后将转换反转回原始数据。”。
非常感谢您的关注和宝贵的帮助!
回复:正态分布和变换嗨吉姆( @tx尼尔森),非常感谢您的解释!
我有以下问题:
1. 对于我的研究案例,称为 OUT 的非正常结果包含不同的时间点(T1、T2...),因为我有重复测量设计。 因此,当我进行分析==>分布时,我想我需要在“将选定的列转换为角色”对话框中将该变量 OUT 选择为“Y,列”,并将主题间(例如,时间点)选择为“按” ,不是吗?
2. 如果我这样做,那么我将得到 OUT 与每个时间点的关系图,例如 OUT 与 T1 的关系; OUT 与 T2 等。 在 JMP v.10 中,我需要按照您对每个图的指示进行操作,因为它无法自动执行此操作。 没关系。 我选择“Distributions Timepoint=T1==>Stack”,所有图都显示在水平轴上。
疑问:我应该先选择“能力分析”还是“连续拟合==>全部”? 我的意思是,当我选择“能力分析”时,对话框会显示输入以下参数:“规格下限”、“目标”和“规格上限”,但我不知道必须定义哪些值。 它们是否基于箱线图,排除异常值?
谢谢。
回复:正态分布和变换分布平台允许人们评估给定列的分布,然后它可能有一种方法将数据转换为正态分布。以下是步骤
1. 运行分发平台,选择所需的列。我的示例来自安装 JMP 时安装的半导体能力示例数据表。
分析==>分布
2. 显示输出后,从
连续拟合==>全部

3. 平台将按顺序为您提供最适合数据的分布。在本例中,选择 LogNormal。不幸的是,LogNormal 无法创建数据的转换版本,因此取消选择它并选择 Johnson SI。
4. 现在,单击“Fitted Johnson SI”的红色三角形,然后选择“保存转换后的结果”

JMP 现已将数据的转换版本保存到新列中,您现在可以将其用于分析
回复:正态分布和变换嗨吉姆( @tx尼尔森),
我无法理解如何在 JMP 中将非正态数据转换为正态分布。 请您向我解释一下原始非正态数据的步骤?
谢谢。
回复:正态分布和变换这是一个完整的程序,它根据一组转换后的数据的统计结果返回一个值。我希望这有帮助
Names Default to Here(1);
dt=New Table( "Test",
Add Rows( 100 ),
New Column("PNP3",
Numeric,
"Continuous",
Format( "Best", 10 ),
Set Values(
[130.378809500886, 132.736937590235, 136.831952164704, 136.969154239163,
136.622623419893, 137.480356512481, 138.094011176166, 142.10586919757,
134.750041237898, 129.719685093372, 136.520172900026, 134.778624216716,
136.991131754497, 140.420940666186, 143.257827228986, 132.213765487819,
144.671172276421, 134.703176752174, 136.744212473486, 137.187637284245,
139.788226018039, 139.372617199359, 136.112484488985, 142.809097034809,
137.799370430979, 138.482493403385, 135.236982575217, 136.251777781494,
130.768356509183, 138.248554728086, 139.77894292052, 134.25405167366,
147.680687116943, 131.351711991517, 132.84274608728, 129.925216236015,
133.47206414316, 143.339607103893, 145.341236691691, 139.200187547183,
142.775409342827, 140.276696563388, 130.623979847275, 140.899814366103,
136.839389290019, 137.239125319, 133.5265281641, 139.356927352471,
130.278640163464, 144.604061001983, 135.286715550332, 134.465744849174,
131.37612790407, 131.830655714309, 140.69724979219, 142.88152043774,
135.253839945611, 127.349434776131, 129.499730399113, 128.447533754611,
130.916853702805, 134.599575929218, 140.761701916093, 136.870661473033,
138.253066182015, 140.403627077024, 134.522643679098, 124.842978178703,
131.803059455053, 125.886786494664, 133.013566701611, 136.940299158936,
133.263913979648, 144.695171321015, 149.541020434399, 144.503845528521,
136.086324063453, 139.530943158798, 138.421460162451, 133.180943784947,
142.166796633818, 142.676541730822, 135.723943440339, 143.957996114985,
145.712158558794, 138.38937502716, 140.535304753392, 142.140619481175,
131.379414509756, 144.949299702964, 133.349854687882, 139.470639804255,
140.160558367008, 137.130662662612, 145.692632562344, 131.870848869966,
136.391733804566, 134.219740661271, 139.021827550389, 147.958038547157]
)
),
New Column( "Johnson Sl Transform PNP3",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Property( "Notes", "Fitted Johnson Sl" ),
Formula(
(Log( (:PNP3 - 44.6529505888426) / 1 ) * 15.3554291860315 + (
-69.5611150866502)) * 1
)
)
);
/***********************************************************************/
/* */
/* The getformula column retrieves the formula from the translation */
/* column and replaces the Original Column name in the formula with */
/* string "__value__". The value of this variable is what will be */
/* evaluated in the successive approximations done by the script. */
/* */
/***********************************************************************/
getformula = Function( {ColName, FormulaColName},
{ColName, FormulaColName, TheFormula, coloncolname},
//__value__ = .;
// Get the transformed data columns formula as a literal string
TheFormula=Column( FormulaColName ) << Get Formula ;
// Check to see that a formula was found
If( Is Empty( TheFormula ) == 1 ,
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a formula. ",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula=char( Column( FormulaColName ) << Get Formula );
// Get the actual name of the orignal column since
// the upper,lower case and spacing is critical in determining
// where in the formula the column name actually occurs
ColName = Column( ColName ) << Get Name;
// Determine if the reference to the column name in the
// formula is a simple :colname reference or a complex
// reference :Name(\!"colname\!")
// If the column name isn't found set the return code to -1
If(
Contains( TheFormula, ":" || ColName ), ColonColName = ":" || ColName, // Else
Contains( TheFormula, ":Name(\!"" || ColName || "\!")" ), ColonColName = ":Name(\!"" || ColName || "\!")", // Else
rc = -1
);
// Replace all of the column references in the formula with
// the string "(__value__)" so that when the formula is
// evaluated later, it will take the then value of the memory
// variable called __value__ and use it in the formula
If( Contains( TheFormula, ColonColName ) > 0,
While( Contains( TheFormula, ColonColName ) > 0, TheFormula = Munger( TheFormula, 1, ColonColName, "(__Value__)" ) ),
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a reference",
" to the original column.",
" in it's formula.",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula;
);
/***********************************************************************/
/* */
/* The gettrans function evaluates the formula in the transformed */
/* and converts the formula into a generic form for repeated use in */
/* running of the script. */
/* */
/***********************************************************************/
gettrans = Function( {ColName, FormulaColName, TheTarget, Theformula},
//colname="PNP3";formulacolname="Johnson Sl Transform PNP3"; Thetarget=johnsonmean;theformula=myformula;
{ColName, FormulaColName, TheFormula, High, Low, TheTarget, TheMax, Themin, __value__},
// The program uses successive approximations to determine the different
// parametrics. The way it works is that it calculates the needed parameter
// such as Mean, or Standard Deviation, and then by using successive
// approximations from the original column's values, and passing those
// values through the columns formula, when the approximation value matches
// the calculated value from the transformed column, the retransformed value
// has been found
// Set the extreem values
High = Col Maximum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
Low = Col Minimum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
// Make a guess at the first value
__value__ = Mean( High, Low );
// Iterate the guessing for up to 100 times, adjusting by 1/2 on each loop
For( i = 1, i <= 100, i++,
TheResult = Eval( Parse( theformula ) );
If(
TheResult > TheTarget, High = __value__,
TheResult < TheTarget, Low = __value__,
Break()
);
If( High == Low, Break() );
__value__ = Mean( High, Low );
);
__value__; // Expose the return value
); // End of function gettrans
myFormula = getformula( "PNP3","Johnson Sl Transform PNP3" );
JohnsonMean = Col Mean(dt:Johnson Sl Transform PNP3);
show(JohnsonMean,colMean(:PNP3),Gettrans("PNP3","Johnson Sl Transform PNP3",JohnsonMean,myFormula));
回复:正态分布和变换感谢您分享这个。
我只是一个脚本初学者,所以目前有点太复杂,我不知道如何使用它!
回复:正态分布和变换这是我从正在运行的系统中提取的一个函数,它使用连续近似来获取解析值
/***********************************************************************/
/* */
/* The getformula column retrieves the formula from the translation */
/* column and replaces the Original Column name in the formula with */
/* string "__value__". The value of this variable is what will be */
/* evaluated in the successive approximations done by the script. */
/* */
/***********************************************************************/
getformula = Function( {ColName, FormulaColName},
{ColName, FormulaColName, TheFormula, coloncolname},
//__value__ = .;
// Get the transformed data columns formula as a literal string
TheFormula=Column( FormulaColName ) << Get Formula ;
// Check to see that a formula was found
If( Is Empty( TheFormula ) == 1 ,
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a formula. ",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula=char( Column( FormulaColName ) << Get Formula );
// Get the actual name of the orignal column since
// the upper,lower case and spacing is critical in determining
// where in the formula the column name actually occurs
ColName = Column( ColName ) << Get Name;
// Determine if the reference to the column name in the
// formula is a simple :colname reference or a complex
// reference :Name(\!"colname\!")
// If the column name isn't found set the return code to -1
If(
Contains( TheFormula, ":" || ColName ), ColonColName = ":" || ColName, // Else
Contains( TheFormula, ":Name(\!"" || ColName || "\!")" ), ColonColName = ":Name(\!"" || ColName || "\!")", // Else
rc = -1
);
// Replace all of the column references in the formula with
// the string "(__value__)" so that when the formula is
// evaluated later, it will take the then value of the memory
// variable called __value__ and use it in the formula
If( Contains( TheFormula, ColonColName ) > 0,
While( Contains( TheFormula, ColonColName ) > 0, TheFormula = Munger( TheFormula, 1, ColonColName, "(__Value__)" ) ),
Dialog(
" The column specified as",
"the Transformed Column does",
" not contain a reference",
" to the original column.",
" in it's formula.",
" ",
" Please rerun and select",
" the correct column"
);
Throw();
);
TheFormula;
);
。
/***********************************************************************/
/* */
/* The gettrans function evaluates the formula in the transformed */
/* and converts the formula into a generic form for repeated use in */
/* running of the script. */
/* */
/***********************************************************************/
gettrans = Function( {ColName, FormulaColName, TheTarget, Theformula},
{ColName, FormulaColName, TheFormula, High, Low, TheTarget, TheMax, Themin, __value__},
// The program uses successive approximations to determine the different
// parametrics. The way it works is that it calculates the needed parameter
// such as Mean, or Standard Deviation, and then by using successive
// approximations from the original column's values, and passing those
// values through the columns formula, when the approximation value matches
// the calculated value from the transformed column, the retransformed value
// has been found
// Set the extreem values
High = Col Maximum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
Low = Col Minimum( If( Excluded( Row State( Empty() ) ) == 0, Column( ColName ), . ) );
Highm = 999999999999999999999999;
Lowm = -999999999999999999999999;
If( Highm > High,
High = Highm
);
If( Lowm < Low, low = lowm );
// Make a guess at the first value
__value__ = Mean( High, Low );
// Iterate the guessing for up to 100 times, adjusting by 1/2 on each loop
For( i = 1, i <= 100, i++,
TheResult = Eval( Parse( theformula ) );
If(
TheResult > TheTarget, High = __value__,
TheResult < TheTarget, Low = __value__,
Break()
);
If( High == Low, Break() );
__value__ = Mean( High, Low );
);
__value__; // Expose the return value
); // End of function gettrans
回复:正态分布和变换嗨吉姆,
我有同样的问题。 我对一些 Johnson Si 转换后的数据进行了建模,并得到了一个预测模型。 我尝试使用逆函数将预测数据转换回来,但它不起作用。 您能否提供有关编写脚本来执行此操作的更多指导? 在对 DOE 实验的响应进行建模时,我不断遇到这些类型的分布,因此了解如何将数据传回非常有用。
非常感谢!
克里斯特尔
回复:正态分布和变换我想我没有抓住你问题的重点。 如果您想根据概率计算“带”,那么这些带的位置将根据您拥有的分布类型而有所不同。 你的号码68-95-99.7 不是标准差,而是与基于正态分布平均值的 1,2,3 标准差距离的“带”相关的概率。 如果没有正态分布,问题不在于标准差的计算,而在于概率的转换。 如果您想要 +/- 3 个标准差带,那么您就假设分布是正态的,或者至少是对称的。 根据您想要执行的操作,您可以计算不对称带(JMP 不仅具有正态分布的概率分布,还具有所有分布的概率分布),或者您必须执行转换以标准化数据(然后在任何时候都进行反向转换)您想转换回自然指标)。 我的偏好是使用不对称带并使用 JOHNSON SU 函数来计算它们。
网上帮助
回复:正态分布和变换谢谢你的回复吉姆! 我会尝试一下。回复:正态分布和变换这就是我所做的。 为了对原始数据设置限制,根据转换后的数据值,我从转换后的数据中获取标准差,计算 1、2、3 等标准差的平均值之上和之下的值,然后反转转换回原始数据。 在某些情况下,例如 Johnson SU,没有一种简单的方法可以将值转换回来,然后我所做的就是运行一个小脚本,通过原始转换传递一个值,检查目标 std 的值,然后迭代该值直到有匹配项。 然后,您在原始数据中找到了值,转换后会产生转换后的值目标值。 请记住,执行此操作时,原始数据中高于平均值和低于平均值的距离将不同。回复:正态分布和变换哦,不过,我认为这对标准差确实很重要。 例如,68-95-99.7(三个标准差)规则用于查找正态分布中均值周围区域内的值。 但是,如果我的数据不正常,那么使用它可能没有意义。 例如,如果我的晶体管的导通电阻不正常,并且我想查看与平均值相差 3 个标准差的值,我可能会得到一个负值或一个非常低的值,实际上没有任何意义。
抱歉,如果我感到困惑或误解了某些东西,我从大学开始就开始重新学习统计学!
回复:正态分布和变换谢谢你,我明白它是怎么做到的。 现在我看到数据是正常的,我怎样才能用它来找到标准差呢? 它在摘要统计中表示一个基于转换有意义的值,但我想知道原始数据的标准差是多少。 也许我不明白转换数据的目的。
回复:正态分布和变换娜塔莉
方差和标准差的公式不对分布的形状做出任何假设。 这只是代数(就像平均值的计算不对分布类型做出任何假设一样)。
回复:正态分布和变换娜塔莉,
您应该能够简单地将转换保存到新列,然后在该列上运行分布。
吉姆
回复:正态分布和变换大家好,David,
我是 JMP 新手,对数据转换感到疑惑。
如果我们使用数据拟合来获得正态分布,与数据转换相比,其优点/缺点是什么?
另外,如果转换后我没有好的 p 值,我应该考虑转换吗?
谢谢
回复:正态分布和变换Kowa,首先欢迎您加入社区。您的问题在此论坛中无法得到充分解答。我建议您从这里开始:
https://www.ime.usp.br/~abe/lista/pdfQWaCMboK68.pdf
进行转型有两个主要原因:
1. 满足残差呈正态独立分布的定量假设,均值为 0,方差一致(NID(0, variance))。如果不满足这些假设,那么你应该质疑所提出的模型。
2. Box 博士多年前告诉我,转换的唯一原因是简化模型……本质上使模型更易于使用。