您好,我想在資料表中從 PLS 輸出視窗中提取 VIP 值以及居中和縮放資料的係數。
透過 JSL 可以嗎?
謝謝
馬泰奧
你好,
我想這會滿足你的需求。
您可以透過右鍵單擊並選擇“編輯”-->“顯示樹結構”來找到任何輸出的報告部分。
我在本範例中使用了波羅的海樣本表。
Edit--Show Tree StructureEdit--Show Tree Structure編輯--顯示樹結構
TableBox(7) VIP tableTableBox(7) VIP tableTableBox(7) VIP桌
我使用表格 --> JMP 查詢產生器連接表。
這是完整的腳本。
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Baltic.jmp" );
P = Partial Least Squares(
Y( :ls, :ha, :dt ),
X(
:v1,
:v2,
:v3,
:v4,
:v5,
:v6,
:v7,
:v8,
:v9,
:v10,
:v11,
:v12,
:v13,
:v14,
:v15,
:v16,
:v17,
:v18,
:v19,
:v20,
:v21,
:v22,
:v23,
:v24,
:v25,
:v26,
:v27
),
Validation Method( Name( "Leave-One-Out" ), Initial Number of Factors( 15 ) ),
Fit(
Method( NIPALS ),
Number of Factors( 7 ),
Variable Importance Plot( 1 ),
VIP vs Coefficients Plots( 1 )
),
SendToReport(
Dispatch(
{"NIPALS Fit with 7 Factors"},
"Model Coefficients for Centered and Scaled Data",
OutlineBox,
{Close( 0 )}
),
Dispatch(
{"NIPALS Fit with 7 Factors", "Variable Importance Plot"},
"Variable Importance Table",
OutlineBox,
{Close( 0 )}
)
)
);
pls_rpt = p << report; //Get the report
//Find the specific section of report by right-clicking Edit-->show properties
//pls_rpt[Outline Box( 9 )] << Close; //Close the outline box; for example
//pls_rpt[Outline Box( 12 )] << Close; //Close the outline box; not necessary
coef_tbl = pls_rpt[Table Box( 5 )];
VIP_tbl = pls_rpt[Table Box( 7 )];
coef_tbl << Make Into Data Table(Invisible);
tbl_1# = Current Data Table()<< Set Name("Coefficients_Tbl");
VIP_tbl<<MAKE into="" data="https://community.jmp.com/" table=""> "_MEMORY_", "VIP_Tbl" => "_MEMORY_"] ),
QueryName( "SQLQuery2" ),
Select(
Column( "VIP", "t1", Numeric Format( "Fixed Dec", "4", "NO", "" ) ),
Column( "Coefficient", "t2" ),
Column( "ls", "t2", Numeric Format( "Fixed Dec", "4", "NO", "" ) ),
Column( "ha", "t2", Numeric Format( "Fixed Dec", "4", "NO", "" ) ),
Column( "dt", "t2", Numeric Format( "Fixed Dec", "4", "NO", "" ) )
),
From(
Table( "VIP_Tbl", Alias( "t1" ) ),
Table(
"Coefficients_Tbl",
Alias( "t2" ),
Join(
Type( Left Outer ),
EQ( Column( "X", "t1" ), Column( "Coefficient", "t2" ) )
)
)
)
) << Run;
Close( tbl_1#, NoSave );
Close( tbl_2#, NoSave );</MAKE>
乾杯,
史丹
實際上我在PLS平台下尋找VIP,而不是VIF。 我找不到同時包含 VIP 和係數的表。
無論如何,我想我找到了解決方法。 係數和 VIP 位於兩個單獨的錶框中,因此我將分別提取它們。
謝謝
馬泰奧
你好,麥克,謝謝。 在樹狀結構中,我能夠在同級大綱框中識別出僅包含係數但不包含 VIP 的表格框。
我找不到與我想從中提取資料的框架框相關的任何表格(VIP 與係數)。
謝謝
馬泰奧
你好,麥克,謝謝。 在樹狀結構中,我能夠辨識出有係數的表格框,但不能辨識 VIP。看起來包含 VIP 與係數的框架盒後面的表無法訪問。