你好
这次我可能有一个简单的问题。我只是找不到合适的东西。
我只是想计算相关性。不是“二次”的,例如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非常有用的解决方案。
为什么不尝试在红色三角形(或首选项)下使用成对相关。该表可以导出到数据表,然后根据需要进行过滤。我发现这比所有数字都出现两次的大型相关矩阵有用得多。