Choose Language Hide Translation Bar
Highlighted

## How to save formula (predicteds) from filtered data?

Question:  Within a jmp script, is it possible to save off specific prediction equations for various filtered datasets within a single data table?

Current Result:  The script exectutes no problem, but the prediction equation is based on the unfiltered data.

I've tried rearranging things but havent found an example online to help do this particular task.  Thanks for taking a look!

Script looks something like this:

``````obj = bivariate(

Y( :DataSet1 ),
X( :DataSet2 ),

Local Data Filter(

Mode( Select(1), Show(1), Include(1) ),

columns( :FilterParam1, :FilterParam2 ),
Where( :FilterParam1 == 3),
Where( :FilterParam2 == 6),
)
),
SendToReport( Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( XXX, YYY )} ) )
);

obj << (Curve << Save Predicteds);
EQN1 = Char(:Predicted DataSet1 << Get Formula);``````

Save Text File(.... (saving eqn to text file))....

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

## Re: How to save formula (predicteds) from filtered data?

I can think of a few approaches.

1. You could use the criterion to select the observations that you want to fit and predict and make a separate subset for this work.
2. You could create a column formula for an indicator of membership in a subset and use it in the By role.
3. You could use a (global) data filter to set the Exclude and Hide row states. You could iterate down the data table with For Each Rox() after saving the predicted values and assign missing to the prediction based on the row state.
Learn it once, use it forever!
2 REPLIES 2
Highlighted

## Re: How to save formula (predicteds) from filtered data?

I can think of a few approaches.

1. You could use the criterion to select the observations that you want to fit and predict and make a separate subset for this work.
2. You could create a column formula for an indicator of membership in a subset and use it in the By role.
3. You could use a (global) data filter to set the Exclude and Hide row states. You could iterate down the data table with For Each Rox() after saving the predicted values and assign missing to the prediction based on the row state.
Learn it once, use it forever!
Highlighted

## Re: How to save formula (predicteds) from filtered data?

Thank you, Mark!

Article Labels

There are no labels assigned to this post.