我有一个表,有2000多行,每行数据都要检验正态性,把PValue放到每行数据的最后,请问有公式吗?
在数据表中创建新列。确保进入 Col Info,并将列的格式设置为“PValue”。
然后打开新列的公式编辑器并将下面的列粘贴到其中
dt = Current Data Table();
// change the Index value for the starting column number of the columns to be analyzed
theRow = dt[Row(), Index( 5, N Col( dt ) - 1 )];
// Create a temporary working data table to calculate the normality on
dtTemp = New Table( "temp", private, New Column( "x", values( theRow ) ) );
// Run the Distribution Platform to calculate the normality
dis = Distribution( invisible, Continuous Distribution( Column( :x ), Fit Normal( Goodness of Fit( 1 ) ) ) );
// Retrieve the P Value of the Normality statistic
pval = (Report( dis )["Goodness-of-Fit Test", Number Col Box( 2 )] << get)[1];
// Clean up the behind the scenes working table and display
dis << close window;
Close( dtTemp, nosave );
// Apply the pvalue to the current row
pval;
在 2000 行的表上运行此公式需要几分钟时间。
上面公式中的注释不会保存为公式的一部分(为了提高JMP效率,只保留公式的可执行部分)。
通常,JMP 数据的格式与数据的结构方式成 90 度角。该列包含要分析的数据,行代表给定测量的不同实例。