Community Trekker

Joined:

Sep 30, 2016

## How to Save Prediction Formula for Generalized Regression Using JSL

In partitions or linear regressions either 'Prediction Formula' or 'Save Prediction Formula' creates a new column in the data table.  In the generalized regression platform neither work.  In the example below, I suspect this is because I actually want to send a message to the 'Adaptive Lasso with AICc Validation' part of the Generalized Regression report instead of the top level 'Generalized Regression for Oxy'.  Any idea how to do this?

```dt = Open( "\$SAMPLE_DATA/Fitness.JMP" )  //open sample data

//Fit model with variable reduction
lasso = dt << Fit Model(
Y( :Oxy ),
Effects( :Age, :Weight, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( AICc )
)
)
);

//Save the prediction formula to the table
lasso << Save Prediction Formula;
lasso << Prediction Formula;
lasso << Get Prediction Formula;
//None of these work, the log returns 'Fit Generalized[]' for each.```

1 ACCEPTED SOLUTION

Accepted Solutions

Super User

Joined:

Jun 22, 2012

Solution

## Re: How to Save Prediction Formula for Generalized Regression Using JSL

The Save Prediction Formula needs to be part of the Fit syntax

``````dt = Open( "\$SAMPLE_DATA/Fitness.JMP" ) ; //open sample data

//Fit model with variable reduction
lasso = dt << Fit Model(
Y( :Oxy ),
Effects( :Age, :Weight, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( AICc),
Save Prediction Formula(1) )
)
);``````
Jim
2 REPLIES

Super User

Joined:

Jun 22, 2012

Solution

## Re: How to Save Prediction Formula for Generalized Regression Using JSL

The Save Prediction Formula needs to be part of the Fit syntax

``````dt = Open( "\$SAMPLE_DATA/Fitness.JMP" ) ; //open sample data

//Fit model with variable reduction
lasso = dt << Fit Model(
Y( :Oxy ),
Effects( :Age, :Weight, :Runtime, :RunPulse, :RstPulse, :MaxPulse ),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( AICc),
Save Prediction Formula(1) )
)
);``````
Jim

Community Trekker

Joined:

Sep 30, 2016

## Re: How to Save Prediction Formula for Generalized Regression Using JSL

Perfect, thank you!