Subscribe Bookmark RSS Feed

How can I get a variable's predicted value from Profiler using JSL script?

matthew83

Community Member

Joined:

Jan 22, 2014

4781_Untitled.png

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
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
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.