我有一个表,有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 度角。該列包含要分析的數據,行代表給定測量的不同實例。