Fit Least Squares
Fit Least Squares using Fit Model
Summary: Fits a linear model to a data table, selecting specific rows and excluding others, while configuring Pareto plot and Actual vs. Predicted plot preferences.
Code:
dt = Open("data_table.jmp");
obj = dt << Fit Model( Effects( :height ), Y( :weight ), Personality( "Standard Least Squares" ), Emphasis( "Minimal Report" ), Run );
obj << Automatic Recalc( 1 );
dt << Select Rows( Index( 2, 4 ) );
dt << Exclude;
Close( dt, No Save );
pref1 = Get Preferences( Fit Least Squares( Pareto Plot ) );
pref2 = Get Preferences( Fit Least Squares( Plot Actual by Predicted ) );
Preferences( Fit Least Squares( Pareto Plot( 1 ) ) );
Preferences( Fit Least Squares( Plot Actual by Predicted( 1 ) ) );
Code Explanation:
- Open data table.
- Fit linear model.
- Set automatic recalculation.
- Select specific rows.
- Exclude selected rows.
- Close data table without saving.
- Get Pareto plot preferences.
- Get Actual vs. Predicted plot preferences.
- Enable Pareto plot.
- Enable Actual vs. Predicted plot.