根據列公式創建預測表達式顯示我想在自定義報告窗口中基於列公式創建格式化的預測表達式。 當我使用最小二乘擬合線性模型時,在模型報告中,我可以打開預測表達式的顯示,該顯示將顯示等式的格式化“圖片”視圖。
然後,我可以將公式作為帶有公式的列保存到數據表中。
現在,我想選擇該列,並在新的報告窗口中單獨顯示保存到該列的公式的預測表達式。
有沒有辦法用JSL做到這一點?
腳本編寫回复:基於列公式創建預測表達式顯示您可以簡單地使用傳遞到該列的<< <<獲取公式消息來檢索該公式。
Names Default To Here( 1 );
dt = New Table( "Example",
add rows( 10 ),
New Column( "The Column", formula( Random Integer( 1, 100 ) ) )
);
theFormla = dt:The Column << get formula;
回复:基於列公式創建預測表達式顯示如果要查找預測表達式的圖片,則可以使用Expr As Picture()。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Drug.jmp" );
obj = dt << Fit Model(
Y( :y ),
Effects( :Drug, :x ),
Personality( Standard Least Squares ),
Emphasis( Minimal Report ),
Run
);
obj << Prediction Formula;
New Window( "Example",
Lineup Box( N Col( 1 ), spacing( 10 ),
Text Box( "Column Formula" ),
Border Box( Left( 10 ), Right( 10 ), bottom( 10 ), top( 10 ), sides( 15 ),
Expr As Picture( dt:pred formula y << get formula )
)
)
);

回复:基於列公式創建預測表達式顯示謝謝,這就是我所需要的。 我知道有辦法做到這一點,我只是不記得表示為Picture()框顯示對象。
回复:基於列公式創建預測表達式顯示自從我發布此消息以來已經有好一段時間了。 我想分享我開發的腳本,以允許快速查看數據表中列中的公式,並允許以交互方式切換列。
/* this script presents a list of columns in the current data table
in a list box, and upon selecting a column, if the column has a formula,
it will display the formula below the list box as a picture.
If the column does not have a formula, "No Column Formula" is displayed
*/
Names Default To Here( 1 );
_dt = Current Data Table();
expr_ShowFormulaAsPicture = Expr(
_vb1 << Delete;
_vb << Append( _vb1 = V List Box() );
_c = Column( dt, (_clb << Get Selected)[1] );
If( Is Empty( _c << Get Property( "Formula" ) ),
_vb1 << Append( Text Box( "No Column Formula" ) ),
_vb1 << Append( Picture Box( Expr As Picture( _c << get formula ) ) )
);
);
New Window( "Show Column Formula as Picture",
_vb = V List Box(
)
);
_vb << Append(
_pb = Panel Box( "Select Column With Formula To Display as Picture",
_clb = Col List Box(
_dt,
max selected( 1 ),
grouped,
all,
On Change( expr_ShowFormulaAsPicture )
)
)
);
_vb << Append( _vb1 = V List Box() );
此處的示例窗口:
