Don't know if this is SAS IP or not, but if not does anyone have a function for turning parameter estimates (for any data type/modeling type/model), into the prediction formula JMP uses.
I can't use the normal "Get Prediction Formula" because ... reasons.
I'd like to do something like this. The type of model doesn't matter too much to me. But if it does for the calculation, let's start simple.
Names Default to Here (1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt << Clear Select();
r = dt << Select Rows( 28::40 );
r << Hide and Exclude;
dt << Clear Select();
dt:sex[[3, 6, 9, 12, 27]] = "G";
fm = dt << Fit Model(
Y( :height ),
Effects( :age[:sex], :sex, :weight, :sex * :weight, :age * :weight[:sex] ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run( Fit( Estimation Method( Lasso ), Validation Method( AICc ) ) )
);
pred = fm << (fit[1] << Get Prediction Formula);
// what I want
prediction_from_estimates = function({fm},
{DEFAULT LOCAL},
olb = report(fm)[OutlineBox("Parameter Estimates?")];
terms = olb[StringColBox("Term")] << Get;
est = olb[NumberColBox("Estimate")] << Get;
// do some stuff
return(prediction_formula)
);
// and I'd like it to be able to do
other_pred = prediction_from_estimates(fm);
nameexpr(pred) == nameexpr(other_pred); // true
I'd also take any references to read up on.