I am using fit model to built a regression equation for time and a bunch of extra factors. The end goal is to create a table in a journal that has the prediction equation evaluated for all the extra factors and show the pure intercept + slope * time based equation. Example:
dt = Open("$SAMPLE_DATA\Powder Metallurgy.jmp");
fm = dt << Fit Model(
Y( :Shrinkage ),
Effects(
:Formation Method, :Compaction Method, :Sintering Time
),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run()
);
PredForm = Arg(Arg((FM << GetPredictionFormula), 3),1);
This results in equation:
0.942161598883733 + Match( :Formation Method,
"Die", 0.0407171588498178,
"Extrusion", 0.0256123252434345,
"Isostatic", -0.0663294840932524,
.
) + Match( :Compaction Method,
"Cold", 0.594574663098895,
"Warm", -0.594574663098895,
.
) + -0.0742413463542265 * :Sintering Time
We can then create a table with the extra factors:
dtEquations = dt << Summary(
Group( :Formation Method, :Compaction Method ),
Freq( "None" ),
Weight( "None" )
);
dtEquations << DeleteColumns(:N Rows);
And so how do I write the equation into a new column where it looks at the (in this example) first 2 columns and evaluates the Match statements, with simplicfication, but leaves the equation for time? End goal:
Even better if all the static coefficients are reduced to one.
The whole thing needs to be dynamic for multiple extra factor levels, and the equation could common slope, common intercept or it could be different slopes and or different intercepts.