Names default to here(1);
dt = Open("$Sample_data/iris.jmp");
dt << New Column("Sepal length Pred from Model 1", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Prediction Formula"), Set Property("Predicting", {:Sepal length, Creator("Fit Least Squares")}), Formula(4 + 0.5 * :Petal length), Set Display Width(129));
dt << New Column("Sepal length Pred form Model 1 and Linear Correction", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Prediction Formula"), Formula(1.03522519623809 + 0.817844554702371 * :Sepal length Pred from Model 1), Set Property("Predicting", {:Sepal length, Creator("Fit Least Squares")}));
dt << New Column("Sepal length Pred from Petal length linear equation", Numeric, "Continuous", Format("Best", 12), Set Property("Notes", "Prediction Formula"), Formula(4.30660341504758 + 0.408922277351185 * :Petal length), Set Property("Predicting", {:Sepal length, Creator("Fit Least Squares")}));
dt << Graph Builder(
Size( 473, 500 ),
Variables(
X( :Sepal length Pred from Model 1 ),
Y( :Sepal length ),
Y(
Transform Column(
"Transform[Sepal...d from Model 1]",
Formula( :Sepal length Pred from Model 1 )
),
Position( 1 )
)
),
Elements(
Points( X, Y( 1 ), Legend( 5 ) ),
Formula( X, Y( 2 ), Legend( 7 ) ),
Line Of Fit( X, Y( 1 ), Legend( 9 ) )
),
SendToReport(
Dispatch( {"Line Of Fit"}, "", OutlineBox, {Close( 0 )} ),
Dispatch(
{},
"Sepal length Pred from Model 1",
ScaleBox,
{Min( 4 ), Max( 8 ), Inc( 1 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"Sepal length",
ScaleBox,
{Min( 4 ), Max( 8 ), Inc( 2 ), Minor Ticks( 1 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
7,
Level Name(
0,
"Line if Perfect Fit",
Item ID( "Transform[Sepal...d from Model 1]", 1 )
)
), Legend Model(
9,
Level Name(
0,
"Fit for Model 1 Predicted Values",
Item ID( "Sepal length", 1 )
)
)}
),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "Fit from Model 1" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Sepal length Actual" )} )
)
);
dt << Fit Model(
Y( :Sepal length Pred form Model 1 and Linear Correction ),
Effects( :Sepal length ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:Sepal length Pred form Model 1 and Linear Correction <<
{Summary of Fit( 1 ), Analysis of Variance( 1 ), Parameter Estimates( 1 ),
Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 1 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 )}
)
);
dt << Graph Builder(
Size( 949, 500 ),
Variables(
X( :Sepal length Pred from Model 1 ),
X( :Sepal length Pred form Model 1 and Linear Correction ),
Y( :Sepal length ),
Y(
Transform Column(
"Transform[Sepal...d from Model 1]",
Formula( :Sepal length Pred from Model 1 )
),
Position( 1 )
),
Y(
Transform Column(
"Transform[Sepal...inear equation]",
Formula( :Sepal length Pred from Petal length linear equation )
),
Position( 1 )
),
Y(
Transform Column(
"Transform[Sepal...inear equation]",
Formula( :Sepal length Pred from Petal length linear equation )
),
Position( 1 )
),
Y(
Transform Column(
"Transform[Sepal...ear Correction]",
Formula( :Sepal length Pred form Model 1 and Linear Correction )
),
Position( 1 )
)
),
Elements(
Position( 1, 1 ),
Points( X, Y( 1 ), Legend( 5 ) ),
Line Of Fit(
X,
Y( 1 ),
Legend( 9 ),
Root Mean Square Error( 1 ),
Equation( 1 )
),
Formula( X, Y( 2 ), Legend( 7 ) )
),
Elements(
Position( 2, 1 ),
Points( X, Y( 1 ), Legend( 10 ) ),
Line Of Fit( X, Y( 1 ), Legend( 12 ), Equation( 1 ) ),
Formula( X, Y( 5 ), Legend( 13 ) )
),
SendToReport(
Dispatch(
{},
"Sepal length Pred from Model 1",
ScaleBox,
{Min( 4 ), Max( 8 ), Inc( 1 ), Minor Ticks( 3 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
Dispatch(
{},
"Sepal length Pred form Model 1 and Linear Correction",
ScaleBox,
{Min( 4 ), Max( 8 ), Inc( 1 ), Minor Ticks( 3 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
Dispatch(
{},
"Sepal length",
ScaleBox,
{Min( 4 ), Max( 8 ), Inc( 1 ), Minor Ticks( 3 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Level Name( 0, "Actual Value", Item ID( "Sepal length", 1 ) ),
Base( 0, 0, 0, Item ID( "Sepal length", 1 ) ),
Properties( 0, {Line Color( 21 )}, Item ID( "Sepal length", 1 ) )
), Legend Model(
9,
Level Name(
0,
"Fit line from predicted values",
Item ID( "Sepal length", 1 )
),
Properties( 0, {Line Color( 21 )}, Item ID( "Sepal length", 1 ) )
), Legend Model(
7,
Level Name(
0,
"Fit if perfect model",
Item ID( "Transform[Sepal...d from Model 1]", 1 )
),
Properties(
0,
{Line Color( 3 )},
Item ID( "Transform[Sepal...d from Model 1]", 1 )
)
), Legend Model(
10,
Properties( 0, {Line Color( 21 )}, Item ID( "Sepal length", 1 ) )
), Legend Model(
12,
Properties( 0, {Line Color( 21 )}, Item ID( "Sepal length", 1 ) )
), Legend Model(
13,
Properties(
0,
{Line Color( 3 )},
Item ID( "Transform[Sepal...ear Correction]", 1 )
)
)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Fit from Model 1 (left) and Ensemble Model (right)" )}
),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "Sepal length Actual" )} ),
Dispatch(
{},
"400",
LegendBox,
{Legend Position(
{5, [0], 9, [1, -3], 7, [2], 10, [-1], 12, [-1, -3], 13, [-1]}
)}
)
)
);
dt << Model Comparison(
Y(
:Sepal length Pred from Model 1,
:Sepal length Pred form Model 1 and Linear Correction,
:Sepal length Pred from Petal length linear equation
)
);