Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
Level IV

## Newbie Question extracting values from a report

Hi,

I am trying to come up to speed on extracting values from a report called by a script.

To test things out I create two simple columns and do a fit and I am trying to extract the intercept from the estimate just so I know what I am doing.

Test=Bivariate(

Y( :Column 2 ),

X( :Column 1 ),

Fit Line( {Line Color( {208, 64, 86} )} )

);

r=test<<report;

fred=r[outlinebox("Linear Fit"),Outlinebox("Parameter Estimates"),ColBox("Estimate")[1]]<<get(1);

show(fred);

I am trying (obviously unsuccessfully) to follow the example in the manual and I am getting an error as show in the log window

index{100} in access or evaluation of 'Get' , Get( 1 ) /*###*/

What should this test script look like?

10 REPLIES 10
Highlighted
Staff

## Re: Newbie Question extracting values from a report

Hi,

There is a little syntax error in this section of the code:

fred=r[outlinebox("Linear Fit"),Outlinebox("Parameter Estimates"),ColBox("Estimate")[1]]<<get(1);

The column box reference is a number column box in the report, so try using NumberColBox. Also, Put the reference of the first value inside the () instead of outside and remove the [ ]. Put a comma between the title and the number reference. See below

fred=r[OutlineBox("Linear Fit"),OutlineBox("Parameter Estimates"),NumberColBox("Estimate",1)]<<get(1);

That should work for you.

Best Regards,

Chris Kirchberg

Chris Kirchberg
Principal Systems Engineer, Life Sciences - JMP Global Technical Enablement
SAS Institute, Inc. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
JMP – A Division of SAS Institute | www.jmp.com
Highlighted
Level IV

## Re: Newbie Question extracting values from a report

I was fishing through the scripting manual and in the section on invisible reports (pg 384 on manual for Version 12)yields a different syntax that eschews the get directive completely and uses a term columnbox which does not appear to be a reserved word because it is not showing up in blue font color.  This also works.  If I use the properties window to examine the report, The "estimate" is listed as a "col box"

Test=Bivariate(

Y( :Column 2 ),

X( :Column 1 ),

Fit Line( {Line Color( {208, 64, 86} )} )

);

r=test<<report;

//fred=r[Col Box("Estimate")][2];

fred=r[outlinebox("Linear Fit"),Outlinebox("Parameter Estimates"),ColumnBox("Estimate")][1];

show(fred);

Highlighted
Staff

## Re: Newbie Question extracting values from a report

Yup, that will work as long as you don't use the Get Message.

Chris Kirchberg
Principal Systems Engineer, Life Sciences - JMP Global Technical Enablement
SAS Institute, Inc. - Denver, CO
Tel: +1-919-531-9927 ▪ Mobile: +1-303-378-7419 ▪ E-mail: chris.kirchberg@jmp.com
JMP – A Division of SAS Institute | www.jmp.com
Highlighted
Level IV

## Re: Newbie Question extracting values from a report

Where can I find the "properties window"?

I need to extract data from a table in a report and need to find the correct path. Apparently the "properties window" could be used for that purpose but I don't know where to find that...

Highlighted
Level IV

## Re: Newbie Question extracting values from a report

To be more precise, I would like to extract the values from the validation and training tables below in JSL.

Highlighted
Super User

## Re: Newbie Question extracting values from a report

Below is a simple example on how to output the information from the 2 tables into a data table.  Learning about how to deal with JMP Output Display Trees increases a JMP users capabilities exponentially.  The documentation on Display Trees is found in the Scripting Guide in the JMP Documentation Library

Help==>JMP Documentation Library

Here is the script

``````Names Default To Here( 1 );
dt = Open( "\$SAMPLE_DATA/semiconductor capability.jmp" );
neur = dt << Neural(
Y( :NPN1 ),
X( :PNP1, :PNP2, :NPN2, :PNP3, :IVP1, :PNP4, :NPN3 ),
Informative Missing( 0 ),
Validation Method( "Holdback", 0.3333 ),
Fit( NTanH( 3 ) )
);
Report( neur )["Training"][Table Box( 1 )] << Make Combined Data Table;``````
Jim
Highlighted
Level IV

## Re: Newbie Question extracting values from a report

Thanks for your answer, I will try it. I will also check the Display Tress section in the Scripting Guide. (Actually I have searched for that kind of information under “properties window” in the help, but couldn’t find it.

Highlighted
Level IV

## Re: Newbie Question extracting values from a report

Thanks for providing the script. I does pretty much what I needed. However, there is a point I don't understand:

This is the table I get. It includes the measures for the training and the validation data.

However the last line of the script refers explicitly to the training data:

``Report( neur )["Training"][Table Box( 1 )] << Make Combined Data Table;``

Why does the table also include the information about the validation data?

NB: Removing the part ["Training"] from the last line leads to the same result.

Highlighted
Staff

## Re: Newbie Question extracting values from a report

To extract just the information from the first TableBox under the "Validation" OutlineBox, change to the following:

``Report( neur )["Validation"][Table Box( 1 )] << Make into Data Table;``

The <<Make into Data Table message creates the data table from the values in that TableBox only.

Wendy
Article Labels

There are no labels assigned to this post.