Hello, I would like to extract, in a data table, the values for VIP and Coefficients for Centered and Scaled Data from the PLS output window.
Is this possible through JSL?
thanksMatteo
Hi,
I think this will do you what you want.
You can find the report section of any output by right-clicking and select Edit-->Show Tree Structure.
I used the Baltic sample table for this example.
Edit--Show Tree StructureTableBox(7) VIP table
I joined the tables using Tables --> JMP Query Builder.
Here is the full script.
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 Table(Invisible); tbl_2# = Current Data Table()<< Set Name("VIP_Tbl"); New SQL Query( Version( 130 ), Connection( "JMP" ), JMP Tables( ["Coefficients_Tbl" => "_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 );
Cheers,
Stan
Hello Mike, thanks. In the tree structure I was able to identify a tablebox with coefficients but not the VIPs. It looks like the table behind the framebox containing the VIP vs coefficients is not accessible.
Hello Mike, thanks. In the tree structure I was able to identify a tablebox with just coefficients but not the VIPs, in a sibling outlinebox.
I cannot find any table associated with the framebox I would like to extract data from (VIP vs coefficients).
Actually I was looking for VIP , not VIF, under PLS platform. I've not been able to find a table containing both VIP and coefficients.
In any case I think I figured out a workaround. Coefficients and VIPs are in two separate table boxes, so I will just extract them separately.
thanks
Matteo
Thanks!