你好! 我有 JMP Pro 14。 我正在創建幾個箱線圖,我想在其中顯示 Q3 上方字母的類別之間的顯著差異,如下圖所示:

如何將字母 a 和 b 放在方框上方? 我的情節是這樣的:

Mi Graph Builder代碼是:
Graph Builder(
Size( 571, 448 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Show Title( 0 ),
Show Footer( 0 ),
Variables( X( :Cat ), Y( :Name( "Pl/min" ) ) ),
Elements( Box Plot( X, Y, Legend( 6 ), Box Style( "Solid" ) ) ),
SendToReport(
Dispatch(
{},
"Cat",
ScaleBox,
{Reversed Scale, Label Row(
{Set Font Size( 12 ), Tick Mark( Label( "6" ), Label( "6 " ) ),
Tick Mark( Label( "7" ), Label( "7 " ) )}
)}
),
Dispatch(
{},
"Pl/min",
ScaleBox,
{Min( 5.5 ), Max( 18 ), Inc( 2 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
6,
Properties(
0,
{Line Color( 32 ), Fill Color( 0 )},
Item ID( "Pl/min", 1 )
)
)}
),
Dispatch( {}, "X title", TextEditBox, {Set Font Size( 12 )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Font Size( 12 )} ),
Dispatch(
{},
"Graph Builder",
FrameBox,
{DispatchSeg(
Box Plot Seg( "Box Plot (4)" ),
{Line Color( {128, 128, 128} ), Fill Color( "Medium Dark Red" )}
), DispatchSeg(
Box Plot Seg( "Box Plot (5)" ),
{Line Color( {128, 128, 128} ), Fill Color( "Medium Dark Yellow" )}
), DispatchSeg(
Box Plot Seg( "Box Plot (6)" ),
{Line Color( "Medium Dark Yellow" ),
Fill Color( "Medium Dark Green" )}
), DispatchSeg(
Box Plot Seg( "Box Plot (7)" ),
{Line Color( "Medium Dark Yellow" ),
Fill Color( "Medium Dark BlueCyan" )}
), DispatchSeg(
Box Plot Seg( "Box Plot (8)" ),
{Line Color( "Medium Dark Yellow" ),
Fill Color( "Medium Dark Magenta" )}
), DispatchSeg(
Box Plot Seg( "Box Plot (9)" ),
{Line Color( "Medium Dark Purple" ),
Fill Color( "Medium Dark Fuchsia" )}
)}
)
)
);提前致謝。
馬加利。
我想你必須:
- 計算這些字母(根據我 5 秒的谷歌搜索,這些字母來自 Tukey 的測試,所以我只使用了一些連接字母報告)
- 創建新列,將這些字母映射到正確的行
- 使用該列作為標記
- 將點添加到圖形生成器
- 對點圖使用合適的匯總統計數據以將它們顯示在合適的位置(可能需要新列來創建一些偏移)
- 標記應顯示在圖表中
您很可能也可以將步驟 2-6 合併到圖形腳本中
這是使用非圖形腳本選項的 Big Class 的相當簡單的示例:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
fit = dt << Oneway(Y(:height), X(:age), All Pairs(1), invisible);
letters_tb = ((Report(fit)[OutlineBox("Connecting Letters Report")]) << child) << child;
tb_letter_cols = Filter Each({col_name}, letters_tb << Get Names,
Starts With(col_name, "~Letter Column ")
);
aa_letters = Associative Array();
For Each({level, idx}, letters_tb[1] << get,
aa_letters[level] = "";
For Each({letter_col, idx_col}, tb_letter_cols,
aa_letters[level] ||= letters_tb[1 + idx_col][idx];
);
);
fit << close window;
dt << New Column("TukeyLetters", Character, Nominal, UseForMarker(1), << Set Each Value(
aa_letters[char(:age)];
));
gb = dt << Graph Builder(
Size(529, 451),
Show Control Panel(0),
Variables(X(:age), Y(:height)),
Elements(
Box Plot(X, Y, Legend(6), Box Style("Solid"), Fences(0)),
Points(
X,
Y,
Legend(7),
Summary Statistic("Third Quartile"),
Error Interval("None")
)
)
);

編輯:
為此創建了願望清單項目使用箱線圖時在圖形生成器中顯示顯著性字母,並在執行比較時用 x 擬合 y