你好
這次我可能有一個簡單的問題。我只是找不到合適的東西。
我只是想計算相關性。不是“二次”的,例如ABCXYZ的ABCXYZ列的係數,而是“矩形”的,例如XYZ列的ABC列的係數。有什麼想法可以用JMP完成嗎?
沒有什麼花哨...
乾杯!
新手2
我不知道您所說的“不是二次方”或“矩形”是什麼意思,但是您可以查看Multivariate平台或Correlation()JSL函數。您的選擇可能取決於數據的存儲位置(數據表或矩陣對象)。
這是一個簡單的腳本,可以產生您想要的:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
xList = {"NPN1", "PNP1", "PNP2"};
yList = {"NPN2", "PNP3"};
nw = New Window( "Correlations",
Outline Box( "Retangle of Correlations", tb = Table Box() )
);
// Add the Row Labels to the Table Box
tb << append( String Col Box( " ", yList ) );
For( x = 1, x <= N Items( xList ), x++,
xyCorrList = {};
For( y = 1, y <= N Items( yList ), y++,
Insert Into(
xyCorrList,
Correlation(
Column( dt, xList[x] ) << get as matrix || (Column( dt, yList[y] ) <<
get as matrix)
)[1, 2]
)
);
tb << append( Number Col Box( xList[x], xyCorrList ) );
);嗨,Tx,
“文本框”對我來說是一種有趣的方法,儘管完全是一種方法。
我將如何調整此代碼以在JMP表中獲得這些係數?
至少v14.0以上的JMP不喜歡使用“文本框”執行此操作。
親切的問候
新手
我對您所指的“文本框”有些困惑。 我認為您可能錯誤引用了Table Box(),這是我最近用來創建相關表的響應。 無論如何,該代碼在JMP 14或JMP 15中都可以正常工作,無論如何,以下是我先前發送的代碼的2種修改。 它們每個都產生一個JMP數據表作為相關性的輸出。
第一個簡單地獲取原始代碼,並從原始代碼產生的Table Box()創建數據表。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
xList = {"NPN1", "PNP1", "PNP2"};
yList = {"NPN2", "PNP3"};
nw = New Window( "Correlations",
Outline Box( "Retangle of Correlations", tb = Table Box() )
);
// Add the Row Labels to the Table Box
tb << append( String Col Box( " ", yList ) );
For( x = 1, x <= N Items( xList ), x++,
xyCorrList = {};
For( y = 1, y <= N Items( yList ), y++,
Insert Into(
xyCorrList,
Correlation(
Column( dt, xList[x] ) << get as matrix || (Column( dt, yList[y] ) <<
get as matrix)
)[1, 2]
)
);
tb << append( Number Col Box( xList[x], xyCorrList ) );
);
tb << make into data table;
第二個腳本直接生成輸出數據表。 不首先生成Table Box()。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/semiconductor capability.jmp" );
xList = {"NPN1", "PNP1", "PNP2"};
yList = {"NPN2", "PNP3"};
dt2 = New Table( "Correlations");
dt2 << add rows( N Items( yList ) );
dt2 << delete columns( "Column 1" );<BR /><FONT face="Menlo,Monaco,Consolas,"Courier New",monospace" size="2" style="background-color: #f5f5f5;">dt2 << New Column( "Label", character, values(yList));</FONT>
For( x = 1, x <= N Items( xList ), x++,
xyCorrList = {};
For( y = 1, y <= N Items( yList ), y++,
Insert Into(
xyCorrList,
Correlation(
Column( dt, xList[x] ) << get as matrix || (Column( dt, yList[y] ) <<
get as matrix)
)[1, 2]
)
);
dt2 << new column( xList[x], values(xyCorrList));
);你好 @ Newbie2Jumpie ,
看起來您已經有了Jim的腳本解決方案,但是我那裡有一個插件,我想您可以做得到:返回一組特定X和特定Y之間的關聯表,而不是所有可能的組合(當您將獲得多變量)。
通過X加載項關聯Y
希望能有所幫助,
@朱蓮
你好 @ Newbie2Jumpie
其他人則直接回答了您的問題。讓我提供另一個我認為JMP非常有用的解決方案。
為什麼不嘗試在紅色三角形(或首選項)下使用成對相關。該表可以導出到數據表,然後根據需要進行過濾。我發現這比所有數字都出現兩次的大相關矩陣有用得多。