I'm not sure how helpful this will be. But in case you or anyone else would like to see some xpath examples, here is a set of examples that I refer to when I am using xpath. You may already be aware but if not, the edit -> properties page will show you the tree structure, with interactivity when you hover over and click on areas of the report. So you can click on the area of interest (number col box, etc) and it will show you the related info in the properties pane. You can expand the 'box path' outline box in the properties pane, and it will show you the outline tree code or the xpath code depending on the drop down choice, and you can generalize from there. The right most icon in the box path area will copy the code.
You can run the whole thing, but skip to the last 20 lines or so and use an associative array on the output of the last bits of xpath.
I suspect you can use something similar to this and look for 'Training' or 'Predicted Rate' and then as Jarmo says, explore the results.
Anything commented out is not working. I haven't debugged this in years, and don't recall if that part is even valid code.
// This is a file containing some examples of xpath, which is useful for traversing display trees (outline boxes and other display boxes) and getting data from these reports. For example, getting mean and st dev from the summary stats section of a distribution report window, or an Rsquare from a fit y by x. both of these are shown below.
//Tip: go to Edit -> Properties from a report output. Expand the 'Box Path' outline box in the properties pane. Switch between Subscript and Xpath to see the different paths. and change the root to whatever is convenient. Right most icon here is copy, so you can copy / paste the code.
//below focuses on xpath.
names default to here(1);
open("$SAMPLE_DATA\Semiconductor Capability.jmp");
myDist = Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :NPN1 ),
Customize Summary Statistics(
Robust Mean( 1 ),
Robust Std Dev( 1 )
),
Capability Analysis( 1 )
),
Continuous Distribution(
Column( :PNP1 ),
Customize Summary Statistics(
Robust Mean( 1 ),
Robust Std Dev( 1 )
),
Capability Analysis( 1 )
),
Continuous Distribution(
Column( :PNP2 ),
Customize Summary Statistics(
Robust Mean( 1 ),
Robust Std Dev( 1 )
),
Capability Analysis( 1 )
)
);
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']");
for(i = 1, i<=nitems(reportObj), i++, show(reportObj[i]<<get title););
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
strList = {};
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']//StringColBox");
strList = reportObj[1] << get;
show(strList);
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
//for(i = 1, i<=nitems(reportObj), i++, show(reportObj[i]<<get); strList = reportObj[i] << get;);
try(MnIndx = loc(strList, "Mean")[1], MnIndx = -1);
try(StdIndx = loc(strList, "Std Dev")[1], StdIndx = -1);
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
statList = {};
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']//NumberColBox");
for(i = 1, i<=nitems(reportObj), i++, show(reportObj[i]<<get); statList = reportObj[i]<< get;);
statList = reportObj[1]<< get;
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
if(MnIndx > 0 & StdIndx > 0,
mean = statList[MnIndx];
std = statList[StdIndx];
,
mean = -999;
std = -999;
);
show(mean, std);
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']/ancestor::OutlineBox[last()]"); //gets top ancestor
show(reportObj << get title());// {"Distributions"}
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'NPN1']/ancestor::OutlineBox[last()]");
show(reportObj << get title());// {"Distributions"}
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'NPN1']//OutlineBox");
show(reportObj << get title());// {"Quantiles", "Summary Statistics", "Capability Analysis", " Long Term Sigma"}; depending on your settings
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'NPN1']//StringColBox"); // gets all the string col boxes under NPN1
for(i = 1, i<=nitems(reportObj), i++, show(reportObj[i]<<get);); // next several lines...
/*reportObj[i] << get = {"100.0%", "99.5%", "97.5%", "90.0%", "75.0%", "50.0%", "25.0%", "10.0%", "2.5%", "0.5%", "0.0%"};
reportObj[i] << get = {"maximum", "", "", "", "quartile", "median", "quartile", "", "", "", "minimum"};
reportObj[i] << get = {"Mean", "Std Dev", "N", "N Missing", "Range", "Robust Mean", "Robust Standard Deviation"};
reportObj[i] << get = {"Lower Spec Limit", "Target", "Upper Spec Limit"};
reportObj[i] << get = {"Below LSL", "Above USL", "Total Outside"};
reportObj[i] << get = {"", ""};
reportObj[i] << get = {"CP", "CPK", "CPM", "CPL", "CPU"};
reportObj[i] << get = {"Below LSL", "Above USL", "Total Outside"};
reportObj[i] << get = {"Z Bench", "Z LSL", "Z USL"};*/
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
//reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']"); // gets the 3 summary stat outline boxes in the report
//for(i = 1, i<=nitems(reportObj), i++, show(reportObj[i]<<get title()););
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']//ListBox//TableBox//StringColBox"); // get all cases where there's string col box in a table box in a list box in the summary stats.
reportObj=myDist<<xpath( "//OutlineBox[ text() = 'Summary Statistics']//StringColBox"); // same as above but less strict.
StringList = reportObj[1] << get();
for(i = 1, i <= nitems(StringList), i++,
show(StringList[i]); // shows all the strings in the string col box
);
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
/*not working (and not sure if this is even remotely valid code)
list_testSS.Key=(myDist<<xpath("//*[contains( text(), 'Summary Statistics')]/following-sibling::*//StringColBox")) <<Get;
list_testSS.Key=(myDist<<xpath("//*[contains( text(), 'Mean')]")) <<Get;
///following-sibling::*//StringColBox
list_testSS.Key=(myDist<<xpath("//*[contains( text(), 'Summary Statistics')]/following-sibling::*//StringColBox")) <<Get;
list_testSS.Val=(myDist<<xpath("//*[contains( text(), 'Summary Statistics')]/following-sibling::*//NumberColBox")) <<Get;
list_levelString=(myDist<<xpath("//OutlineBox[ text() = 'Long Term Sigma']//StringColBoxHeader[text()='Capability']/..")) << get;
list_levelMeans=(myDist<<xpath("//OutlineBox[ text() = 'Long Term Sigma']//NumberColBoxHeader[text()='Index']/..")) << get;
*/
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
//////////
//FIT model rsq example
dt = open( "$SAMPLE_DATA\Big Class.jmp");
//fmObj = Fit Model(Y( column( yParamNames[i])), Effects( column( xParamNames[k])),
fmObj = Fit Model(Y(column("height")), Effects( column("weight")),
Personality(Standard Least Squares),
Run(
column( "height") <<
{
Plot Actual by Predicted( 0 ),
Plot Residual by Predicted( 0 ),
Plot Effect Leverage( 0 ),
analysis of variance(0),
lack of fit(0),
parameter estimates(0),
effect tests(0),
effect details(0)
}
)
);
myRsqr = -9999;
//Find the table containing RSquare
fmOlbXpObj = fmObj << xpath( "//OutlineBox[ text() = 'Summary of Fit']//TableBox//StringColBox");
show(jmp version());
show(fmOlbXpObj);
show(fmOlbXpObj<<get());
show(fmOlbXpObj[1]);
show(fmOlbXpObj[1]<<get());
show(fmOlbXpObj[1][1]);
fmNames = fmOlbXpObj[1] << get(); // store the list of names from the fit model outlinebox xpath object (strings) into fmNames for use in associative array below
/*xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
fmList = fmOlbXpObj[1]<<get();
//fmOlbXpObj[1] is a list containing the text items in the stat table, the first of which is "RSquare". Next line gets the index (e.g. kk=1)
for(kk=1,kk<=nitems(fmList),kk++, if(lowercase(fmList[kk]) == "rsquare", tableIndex = kk; break()));
//and now get the actual numbers from the stat table
fmOlbXpObj2 = fmObj << xpath( "//OutlineBox[ text() = 'Summary of Fit']//TableBox//NumberColBox");
fmList2 = fmOlbXpObj2[1] << get();
show(fmOlbXpObj2);
show(fmOlbXpObj2<<get());
show(fmOlbXpObj2[1]);
show(fmOlbXpObj2[1]<<get());
show(fmOlbXpObj2[1][1]);
fmValues = fmOlbXpObj2[1] << get(); // store the list of values from the fit model outlinebox xpath object (numbers) into fmValues for use in associative array below
//and use the index kk to get the RSquare
myRsqr = fmList2[kk];
show(myRsqr);
// associative arrays
fitModelAA= associative array(fmNames, fmValues);
myRsqr_AA = fitMOdelAA["RSquare"];
show(myRsqr_AA);