所以我有一個腳本,它創建 YbyX 圖,進行 Tukey T 檢驗,然後創建帶有 p 值的組合 dt,然後根據 p 值進行選擇和排除。
我目前將其嵌入到 dt << New Script() 函數中,以將其保存到源數據表中。
我不確定發生了什麼,但當我進入選擇 p 值的部分時,我收到此錯誤:
dt1 << select where("p-Value"n > 0.05);名稱未解析:訪問或評估“p-Value”時第 1 行的 p-Value,“p-Value”n /*###*/
奇怪的是,當我將其複製到一個空白的新腳本窗口並手動運行它時,它起作用了。 我不確定發生了什麼事或為什麼。 有任何想法嗎?
//need to force it to use a certain file name AND force SPC script to label dt appropriately
dtSPC = current data table();
dtSPC << set name( "SPC Data");
/*plotting a basic Fit YbyX just to get pValues. Formatting and style done on final plot*/
ow1 = Oneway(
Y( :MEAN ),
X( :TOOL_PROCESS_CHAMBER ),
By(Chart_ID,),
//All pairs Tukey HSD test
All Pairs(
1,
Confidence Quantile( 0 ),
Difference Matrix( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 1 )
),
SendToReport(
//x-axis formatting
Dispatch(
{},
"2",
ScaleBox,
{Label Row(
{Label Orientation( "Angled" ), Lower Frame( 1 ),
Show Major Grid( 1 ), Tick Mark Style( "Long Divider" )}
)
}
),
//row legend by chamber
Dispatch(
{},
"Oneway Plot",
FrameBox,
{Marker Size( 6 ), Marker Drawing Mode( "Normal" ),
Row Legend(
:Chamber,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)
}
)
)
);
/***********************************/
/***********************************/
// Create the combined data table of Summary Statistics
dt1 = Report( ow1[1] )["Means Comparisons", "Comparisons for all pairs using Tukey-Kramer HSD","Ordered Differences Report"][Table Box( 1 )] << Make Combined Data Table;
dt1 = current data table();
dt1 << set name( "pValue PairWise by Channel Tukey");
dt1:Chart_ID << Data type( Numeric ) << Set Modeling Type( Nominal );
/***********************************/
/**********************************/
//Screen and show only the Channel_ID's w/ a Tukey pair pVal<0.05
//exclude all high pVal rows, leaving only low pVal Channels. Does not work in reverse.
dt1 << select where("p-Value"n > 0.05);
dt1 << exclude;
dt1 << clear select;
//create a list of remaining Unique Chart_ID
summarize(dt1, uniqueVals=by(:Chart_ID));
//Convert to numeric
For( i = 1, i <= N Items(uniqueVals ), i++,
uniqueVals[i] = Num(uniqueVals[i] )
);
//extra, just to look at the data
//dtUnique = New Table( "uniqueVals less 0.05");
//dtUnique << New Column( "Chart_ID", Values(uniqueVals));
//select on SPC source data just the channels w/ low pVals
//need to choose SPC data table
dtSPC << clear select;
dtSPC << select where( contains( uniqueVals, :Chart_ID));
//invert and exclude, leaving only low pVal Chart_ID's
dtSPC << invert row selection << exclude;
dtSPC << clear select;
//close old stuff
close(dt1);
ow1 << close window;
嘗試將第 58 行的引用更改為
dt1 = Current Data Table();
到
current data table( dt1 );
不同之處在於,在第一個語句中,您將 dt1 的值設置為當前數據表的值,而 JMP 可能不會指向您指定的表。第二條語句聲明 JMP 將 dt1 設置為當前數據表。