turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- How can I get a variable's predicted value from Pr...

Topic Options

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

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

Jan 22, 2014 3:40 PM
(701 views)

The picture above is from JSL example. Using JSL script's Term Value command, I can change SILICA, SILANE, SULFUR's value.

Let's say I want to get the predicted HARDNESS's value 72.85618 in the figure above. How can I do that using JSL script?

1 ACCEPTED SOLUTION

Accepted Solutions

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

Solution

There are several options.

For this particular report you can get predicted Hardness with

num**(**currentreport**()[**Textbox**(****12****)]**<<get text**);**

**72.85618**

The "12" can be figured out from the tree structure view (right click and chose edit/show tree structure). However, usually one wants a more general approach to get items from a report. This can sometimes be difficult.

One way is to loop over all predictors. This code will get you a matrix with the predicted values:

n=**4**; // number of dependent variables

result=J**(****1**,n,**.****)**;

for**(**i=**1**,i<=**4**,i++,

result**[**i**]**=num**((**currentreport**()[**Axis box**(**i**)][****3****][****1****])**<<get text**)**;

**)**;

Show**(**result**)**;

**result = [153.7095 1392.402 384.4922 72.85618];**

A third and probably more general option would be to to use *<<get factor settings script,* pull out the numbers from the list and add them to the data table (e.g. in a new row). The predicted values can then easily be retrieved from the formula columns. All this can of course be done in JSL with some effort.

1 REPLY

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

There are several options.

For this particular report you can get predicted Hardness with

num**(**currentreport**()[**Textbox**(****12****)]**<<get text**);**

**72.85618**

The "12" can be figured out from the tree structure view (right click and chose edit/show tree structure). However, usually one wants a more general approach to get items from a report. This can sometimes be difficult.

One way is to loop over all predictors. This code will get you a matrix with the predicted values:

n=**4**; // number of dependent variables

result=J**(****1**,n,**.****)**;

for**(**i=**1**,i<=**4**,i++,

result**[**i**]**=num**((**currentreport**()[**Axis box**(**i**)][****3****][****1****])**<<get text**)**;

**)**;

Show**(**result**)**;

**result = [153.7095 1392.402 384.4922 72.85618];**

A third and probably more general option would be to to use *<<get factor settings script,* pull out the numbers from the list and add them to the data table (e.g. in a new row). The predicted values can then easily be retrieved from the formula columns. All this can of course be done in JSL with some effort.