BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
lmickael
Occasional Contributor

Get parameter estimates of an exponential decay Fit 4P as Matrix

Everyone,

Despite many example in the forum i can't get the "Get As Matrix" function to work. Thank to the tree function i found the correct data table out of which the data ("Schätzer" = "estimate") need to be extracted, see the picture below. I need the Data in the four rows of NumberColBOX(8). "Get As Matrix" just doesn't extract anything!

Here is my script:

"Load data file"

....

drg = Fit Curve( Y( :Pmpp ), X( :time_ZUV ), Fit Biexponential 4P );
dgr_report = drg << Report;
dgr_report << show tree structure;
modell = dgr_report[OutlineBox(2)][TableBox(1)][StringColBox(1)] << Get();
cor_val = dgr_report[OutlineBox(2)][TableBox(1)][NumberColBox(6)] << Get();
SumFit = drg_report[OutlineBox(7)][TableBox(3)][NumberColBox(8)] << ge tAs Matrix;

....

"Display modell, cor_val, SumFit"

 

Note the parameters named "modell" and "cor_val" are correctly extracted from OutlineBox (2)!

grafik.pngTree structure of the expo decay fit

Help would be much appreciated!

Mickael

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
ms
Super User ms
Super User

Re: Get parameter estimates of an exponential decay Fit 4P as Matrix

You can adress a display boxes with its "absolute" number but if in a hierarchical context their relative numbers should be used. In your example there is only one TableBox and three NumberColBoxes in OutLineBox(7), and JMP will thus fail to find a third TableBox.

 

Below are four different but equivalent methods to extract the matrix. The first uses absolute numbering, the second and third use relative numbering, and the last uses xpath to identify the NumberColBox based on its title

SumFit = drg_report[Number Col Box(8)] << Get As Matrix;
SumFit = drg_report[Outline Box(7)][1][2] << Get As Matrix;
SumFit = drg_report[Outline Box(7)][Table Box(1)][Number Col Box(1)] << Get As Matrix;
SumFit = (drg_report << xpath("//NumberColBox[NumberColBoxHeader ='Estimate']"))[1] << Get As Matrix;

 

4 REPLIES 4
Highlighted
ms
Super User ms
Super User

Re: Get parameter estimates of an exponential decay Fit 4P as Matrix

You can adress a display boxes with its "absolute" number but if in a hierarchical context their relative numbers should be used. In your example there is only one TableBox and three NumberColBoxes in OutLineBox(7), and JMP will thus fail to find a third TableBox.

 

Below are four different but equivalent methods to extract the matrix. The first uses absolute numbering, the second and third use relative numbering, and the last uses xpath to identify the NumberColBox based on its title

SumFit = drg_report[Number Col Box(8)] << Get As Matrix;
SumFit = drg_report[Outline Box(7)][1][2] << Get As Matrix;
SumFit = drg_report[Outline Box(7)][Table Box(1)][Number Col Box(1)] << Get As Matrix;
SumFit = (drg_report << xpath("//NumberColBox[NumberColBoxHeader ='Estimate']"))[1] << Get As Matrix;

 

gzmorgan0
Super User

Re: Get parameter estimates of an exponential decay Fit 4P as Matrix

For the Fit Curve() platform there is an option to Make Parameter Table,  that you might find useful. iI is a Fit[n] option (message).

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Nonlinear Examples/Bioassay.jmp" );
obj = Fit Curve( Y( :Toxicity ), X( :log Conc ), Group( :formulation ) );
obj << Fit Logistic 4P;

ptbl = obj << (Fit[1] << Make Parameter Table);
lmickael
Occasional Contributor

Re: Get parameter estimates of an exponential decay Fit 4P as Matrix

Thanks a lot. Proposal 1,2,3 work just fine. With xpath I need to play a little more around!
Good help! Thanks again
0 Kudos
gzmorgan0
Super User

Re: Get parameter estimates of an exponential decay Fit 4P as Matrix

Below are comments from script 6_XPathFind.jsl written for JSL Companion, Applications of the JMP scripting Language, 2nd Ed

This might be a starting place to learn more.  Also search this JMP Blog for several discussions and presentations regarding XPath.

 

/* XML -> eXstensible Markup Language
     Several links to learn more about XPATH

       https://en.wikipedia.org/wiki/XPath

      https://www.w3.org/TR/xpath.html
      https://www.w3.org/TR/xpath/

//Section 6 - More XPAth Syntax
/* notes and examples based on https://www.tutorialspoint.com/xpath/xpath_quick_guide.htm

node-name                  Select all nodes with the given name "nodename" nodenames in JMP are  DisplayBox class names:
                                        OutlineBox, TableBox, StringColBox, NumberColBox, TabBox, TabPageBox, AxisBox, FrameBox etc.

/ Selection                    starts from the root node

// Selection                   starts from the current node that match the selection

.                                    Selects the current node

..                                  Selects the parent of the current node

@                                Selects attributes

TableBox                     Example − Selects all nodes (display) with the name (class name) "TableBox"

AxisBox/TextBox         Example − Selects all textBox elements that are children of an AxisBox

//node-name                Example - //TableBox selects all TableBox displays no matter where they are in the JMP report

 

----wildcards----

*                                   used to match any node.
.                                   used to match the current node in context.
@*                               used to match any attribute

 

----predicates---- Expression within square brackets to filter/restrict selection
Examples      [n]      [Last()]       [@NumberColBoxItem > 20]

 

----most useful string functions----

starts-with(string1, string2)            Returns true when first string starts with the second string.

contains(string1, string2)               Returns true when the first string contains the second string.

substring(string, offset, length?)    Returns a section of the string. The section starts at offset up to the length provided.

substring-before(string1, string2)  Returns the part of string1 up before the first occurrence of string2.

substring-after(string1, string2)     Returns the part of string1 after the first occurrence of string2.

position()                                        Provides the position of the node.

last()                                               Selects the last node relative to current node;


count                                             is also available , however, JMP returns a list of results and the JMP nitems(result) is just as easy

//nodename                                  Find all boxes with that name is likely the most useful

0 Kudos