cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Return platform results in a structured way (e.g., as an Associative Array)

Advanced users obtain results of platforms (e.g., Fit Model) by scripts. But for this, JMP forces the user to "scrape" the report, which is painful. It will be very helpful if the analysis results are, like in R, returned in a structured way, e.g., as an Associative Array.

2 Comments
XanGregg
Staff

Two ways to scrape a report now:

 

  • Get XML() and XPath Query()
biv = Bivariate( Y( :weight ), X( :height ), Fit Line( ) );
x = biv << Get XML();
XPath Query(x, "//NumberColBoxItem[preceding-sibling::NumberColBoxHeader='Estimate']/text()");

// {"-127.1452", "3.7113549"}
  • DisplayBox subscripting
nb = report(biv)[OutlineBox("Parameter Estimates")][NumberColBox(1)];
nb << Get As Matrix();
// [-127.145248610913, 3.71135489385953]

 

Neither is trivial, but an associative array or a giant nested list introduce complexities, too. For instance, an associative array requires unique keys and has no sense of order.

nao
Level IV

Thanks, Xan. I know how to scrape JMP reports, and I regularly do this. The problem arises due to inconsistency across different platforms regarding the structure of their reports (as to how they need to be scraped), and with reports that has existed in early days of JMP. For example, the Bivariate command triggers one of the several platforms including Contingency. The Contingency report may have different elements depending on the data, e.g., how many unique values the variables have. This makes the reports nicely simple in human's eyes, but creates headache when these are to be scraped. I hope I can see a consistent "hidden" structure regardless of data, which seems to be found in relatively new reports, in all the JMP reports such as Contingency.