Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Fishing.jmp" );
col = dt << Get Column Names( Numeric, String );
For( c = N Items( col ), c > 0 , c--,
If( col[c] == "Fish Caught", Remove From( col, c ) );
If( col[c] == "Validation", Remove From( col, c ) );
If( col[c] == "People", Remove From( col, c ) );
);
biv = dt << Bivariate(
Y( :Fish Caught ),
X( Eval( col ) ),
By( :Validation ),
Fit Line
);
biv rep = biv << Report;
summary dt = biv rep[1]["Summary of Fit"][TableBox(1)] << Make Combined Data Table;
parameter dt = biv rep[1]["Parameter Estimates"][TableBox(1)] << Make Combined Data Table;
Wait( 0 );
biv << Close Window;
Column( summary dt, 6 ) << Set Name( "RSquare" );
summary dt
<< Select Where( Contains( :Column 1[], "RSquare" ) & Not( Contains( :Column 1[], "Adj" ) ) )
<< Invert Row Selection
<< Delete Rows
<< Delete Columns( { "Y", "Validation 2", "Column 1" } );
Column( parameter dt, 7 ) << Set Name( "Slope" );
parameter dt
<< Select Where( Contains( :Term[], "Intercept" ) )
<< Delete Rows
<< Delete Columns( { "Y", "Validation 2", "Term", "~Bias", "Std Error", "t Ratio", "Prob>|t|" } );
summary dt << Join(
With(parameter dt ),
Select( :Validation, :X, :RSquare ),
SelectWith( :Slope ),
By Row Number
);
Close( summary dt, No Save );
Close( parameter dt, No Save );