Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Create prediction expression display based on column formula

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Sep 10, 2020 9:28 AM
(115 views)

I would like to create a formatted prediction expression, based on a column formula, in a custom report window. When I fit a linear model using Fit Least Squares, in the model report, I can turn on the display of the prediction expression, which displays a formatted "picture" view of the equation.

I can then save the equation to the data table as a column with a formula.

Now I want to select that column and display a prediction expression for the formula saved to the column, all by itself, in a new report window.

Is there a way to do this with JSL?

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

If you're looking for a picture of the prediction expression you can use Expr As Picture().

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Drug.jmp" );
obj = dt << Fit Model(
Y( :y ),
Effects( :Drug, :x ),
Personality( Standard Least Squares ),
Emphasis( Minimal Report ),
Run
);
obj << Prediction Formula;
New Window( "Example",
Lineup Box( N Col( 1 ), spacing( 10 ),
Text Box( "Column Formula" ),
Border Box( Left( 10 ), Right( 10 ), bottom( 10 ), top( 10 ), sides( 15 ),
Expr As Picture( dt:pred formula y << get formula )
)
)
);
```

-Jeff

3 REPLIES 3

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Create prediction expression display based on column formula

You can simply retrieve the formula with a <<get formula message passed to the column.

```
Names Default To Here( 1 );
dt = New Table( "Example",
add rows( 10 ),
New Column( "The Column", formula( Random Integer( 1, 100 ) ) )
);
theFormla = dt:The Column << get formula;
```

Jim

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

If you're looking for a picture of the prediction expression you can use Expr As Picture().

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Drug.jmp" );
obj = dt << Fit Model(
Y( :y ),
Effects( :Drug, :x ),
Personality( Standard Least Squares ),
Emphasis( Minimal Report ),
Run
);
obj << Prediction Formula;
New Window( "Example",
Lineup Box( N Col( 1 ), spacing( 10 ),
Text Box( "Column Formula" ),
Border Box( Left( 10 ), Right( 10 ), bottom( 10 ), top( 10 ), sides( 15 ),
Expr As Picture( dt:pred formula y << get formula )
)
)
);
```

-Jeff

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Create prediction expression display based on column formula

**Expr as Picture()** box display object.