擬合組並按 X 擬合 Y你好! 我正在嘗試編寫一個分析腳本,其中用戶輸入資料表,並且腳本透過列對話框將使用者選擇的列作為 Y 和所有其他列(可以是連續和連續列的任意組合)運行 Y × X 擬合。名義變數)作為X 選擇。 有沒有一種方法可以同時使用 fit Y by X 和 Fit Group 來獲得這個一體化窗口,並輕鬆地按照擬合優度對結果進行排序?
這是我編寫的一個腳本,將它們全部輸出在一個框中,但我希望用戶能夠透過方差分析輕鬆找到顯著的擬合。 理想情況下,我想輸出與表格報告視窗的顯著擬合,但這超出了我目前的知識範圍。 任何幫助,將不勝感激!
Names Default To Here( 1 );
dt = Current Data Table();
dlg = Column Dialog(
iv = ColList( "Depedent Variable",
Min Col( 1 ),
Max Col( 1 ),
Data Type( "Numeric" )
)
);
If( dlg["Button"] != 1,
Beep();
Throw();
);
iv = dlg["iv"];
n_cols = N Cols( dt );
New Window( "Report",
H List Box(
For( c = 1, c <= n_cols, c++,
Fit Y by X(
Y( Column( iv[1] ) ),
X( Column( c ) ),
Fit Line( 1 ),
Anova( 1 )
)
)
)
);
自動化和腳本編寫視窗回覆:擬合組並透過 X 擬合 Y下面的腳本執行“透過 X 擬合 Y”,然後輸出所有分析的“擬合摘要”表。我希望這就是你想要的。
Names Default To Here( 1 );
dt = Current Data Table();
dlg = Column Dialog(
iv = ColList( "Depedent Variable",
Min Col( 1 ),
Max Col( 1 ),
Data Type( "Numeric" )//,
//modeling type(ordinal,nominal)
)
);
If( dlg["Button"] != 1,
Beep();
Throw();
);
iv = Char( dlg["iv"][1] );
// Get the names of all of the columns in the data table
colNameList = dt << get column names( string );
// Remove the Dependent Column from the list
Remove From( colNameList, Contains( colNameList, iv ), 1 );
ft = Fit Y by X(
Y( Column( iv ) ),
X( Eval( colNameList ) ),
Fit Line( 1 ),
Anova( 1 )
);
(ft << report)[1]["Summary of Fit", Table Box( 1 )] << make combined data table;
這裡有一些注意事項:
- 當您發布 JSL 時,請使用 JSL 圖示開啟 JSL 視窗並將程式碼複製到該視窗中。它允許更清晰地顯示條目。
- 您需要花時間閱讀《腳本指南》,該指南可在 JMP 文件庫的「幫助」下拉式選單下找到。
- Column Dialog() 結構已被棄用。您需要轉向使用具有 Col List Box() 的新視窗。
回覆:擬合組並透過 X 擬合 Y非常感謝!