Subscribe Bookmark RSS Feed

Extract slope and intercept from Summary of Fit

francescaz

New Contributor

Joined:

Jun 30, 2017

Hi all,

 

I need to create a script that extracts slope and intercept from Summary of Fit and then uses them to calculate a cutoff value for my variable. 

The user will first imput filters and remove outliers. When satisfied with the data points, he/she presses a button and get the slope and interecept as shown in Summary of fit, to be used for the cutoff calculation.

Can anybody help me?

 

1 ACCEPTED SOLUTION

Accepted Solutions
uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

Solution

@francescaz : 
    In order to get the data from summary of fit , please refer to here 

 

https://community.jmp.com/t5/Discussions/JSL-A-script-that-extracts-textbox-information-from-a-bivar...

 

   As for definition of cutoff point , can you define the conditions or share what you have  ? 

 

Best

 Uday

4 REPLIES
uday_guntupalli

Community Trekker

Joined:

Sep 15, 2014

Solution

@francescaz : 
    In order to get the data from summary of fit , please refer to here 

 

https://community.jmp.com/t5/Discussions/JSL-A-script-that-extracts-textbox-information-from-a-bivar...

 

   As for definition of cutoff point , can you define the conditions or share what you have  ? 

 

Best

 Uday

francescaz

New Contributor

Joined:

Jun 30, 2017

Thank you for the link, it's very usefult.

The cutoff is a predefined concentration of analyte, so once the intercept and slope are known, it's easily determined. I'd like to add it to my y as a specification limit but the ultimate goal would be to fill in an xml template with slope and interecept. Is there any way to fill in xml files with jmp?

ian_jmp

Staff

Joined:

Jun 23, 2011

Yes. If the XML template exists, you can use 'LoadTextFile()', make the changes and insertions you require using JSL, then use 'SaveTextFile()'. Look in 'Help > Scripting Index' for details of these JSL expressions.

 

I'm sure you would get more speciifc guidance if you are able to provide an example. 

francescaz

New Contributor

Joined:

Jun 30, 2017

here is my code so far.

It works as is, just I'd like to get both slope and intercept from Num Col Box(7) and I can't figure out what's wrong with int = num(word(1, eq2)). It returns no number, so I'm getting the intercept from Outline Box(2).

I attach the template xml.

 

dt = Current Data Table();
biv = dt << Bivariate(Y(:variable1), X(:Conc A), Fit Line());
rbiv=report(biv);
 
eq1=rbiv[Outline Box(2)][1, 1] << get text; 
eq2=rbiv[Number Col Box(7)] << get text; 

slope = num(word(2, eq2));
int = num(word(3, eq1)); //I'd like to get both numebers from Number Col Box (7), but if set int = num(word(1, eq2)) I get nothing.
 
Cutoff = int+slope*2.5;
Eval(
Eval Expr(
:variable1 << Set Property(
"Spec Limits",
{LSL( Expr( Cutoff ) ), USL( Expr( . ) ), Target( Expr( . ) ),
Show Limits( 1 )}
)
)
);