cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
trevorphysics
Level II

JSL for Line of Fit >> Save Formula

I am creating a JMP app for users to analyze data without much knowlege of JMP or interaction with the platform.

 

I have a Graph Builder plot with a Line of Fit. When I right click on the plot, hover over Line of Fit, and select Save Formula, it saves the formula I want to the my data table so that I can continue analysis. I am unable to find a JSL function to do this to add to this.

 

Here is the section of my code I wish to run this action. I used the command {Save Predicteds}  among other possible solutions but it didn't work.

 

 


Graph Builder( Size( 1057, 898 ), Show Control Panel( 0 ), Show Legend( 0 ), Fit to Window, Variables( X( :"V1 Forward_PN(1)"n ), Y( :"I1 Forward_PN(1)"n ), Overlay( :Test Count ) ), Elements( Line Of Fit( X, Y, Legend( 29 ), Response Axis( "X" ), Confidence of Fit( 0 ), Equation( 1 ), {Save Predicteds} ) ), Local Data Filter( Close Outline( 1 ), Add Filter( columns( :"I1 Forward_PN(1)"n, :Forward_Indicator ), Where( :"I1 Forward_PN(1)"n >= 0.003 & :"I1 Forward_PN(1)"n <= 0.00800009 ), Where( :Forward_Indicator == 1 ) ) ), SendToReport( Dispatch( {}, "graph title", TextEditBox, {Set Text( "On Voltage" )} ) ) )

I believe there is a way to do this since there seems to be commands for everything. For example, if you want to clear row states, you can either go to the menu, click Rows and then click Clear Row states, or you can make a button that runs the code

 

dt << Clear Row States; 

Thanks in advance for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: JSL for Line of Fit >> Save Formula

Here is one way which should work:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y, Legend(1)), Line Of Fit(X, Y, Legend(3)))
);

wait(1); // demo purposes

gbb = Report(gb)[GraphBuilderBox(1)];
gbb << updateElement(1, 1, 2, {Save Formula});

Found from Re: JSL to save smoother formula from Graph Builder

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: JSL for Line of Fit >> Save Formula

Here is one way which should work:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y, Legend(1)), Line Of Fit(X, Y, Legend(3)))
);

wait(1); // demo purposes

gbb = Report(gb)[GraphBuilderBox(1)];
gbb << updateElement(1, 1, 2, {Save Formula});

Found from Re: JSL to save smoother formula from Graph Builder

-Jarmo
trevorphysics
Level II

Re: JSL for Line of Fit >> Save Formula

That works, thanks!