I performed a curve fit in JMP and saved the formula to a column (see below). I would like to be able to have the same curve appear in Graph Builder.
I have tried to use Customize>Script to add the saved formula as a Y Function but nothing happens. See below.
I'm sure I'm making some kind of simple error but I'm stuck at this point.
Any suggestions?
Thanks in advance for any help.
Figured it out. I can add the formula to Custom>Script, but I have to change the column name to x.
Here is a step-by-step solution.
Well... I'm an idiot. It turns out that I have two similarly named predictor columns. I used one to generate the curve fit equation but I inadvertently used the other on the X axis for graph builder. Once I corrected this, the Formula Graphics element worked like a charm.
Aaargh.
Thanks for all your help. The incredible support from the JMP staff and community are a HUGE reason why we use JMP.
Add a formula column to your data table, using your function. Then add that column to the graph as a function. Here's an example with a simple linear regression
dt = New Table( "Test Linear Regression", Add Rows( 6 ),
New Column( "Column 1", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6] ) ),
New Column( "Column 2", Numeric, "Continuous", Format( "Best", 12 ),
Set Values( [1, 3, 2, 4, 3, 7] ) ),
New Column( "Column 3", Numeric, "Continuous", Format( "Best", 12 ),
Formula( 0.1333333 + 0.9142857 * :Column 1 ) )
);
gb = dt << Graph Builder(
Size( 522, 456 ),
Show Control Panel( 0 ),
Variables( X( :Column 1 ), Y( :Column 2 ), Y( :Column 3, Position( 1 ) ) ),
Elements(
Formula( X, Y( 2 ), Legend( 12 ) ),
Points( X, Y( 1 ), Legend( 13 ) )
),
SendToReport(
Dispatch( {}, "400", ScaleBox,
{Legend Model( 12,
Properties( 0, {Line Color( 19 )}, Item ID( "Column 3", 1 ) )
)}
)
)
);
Here's the formula column:
So... First, thanks for the reply.
I have the formula column but I'm not sure how to add it to the graph as a function. I don't really know JSL that well. Can I do this without using JSL?
Figured it out. I can add the formula to Custom>Script, but I have to change the column name to x.
Graph Builder provides the Formula graphics element. It is based on a data column formula. Please see the
https://www.jmp.com/support/help/en/17.0/#page/jmp/formula.shtml
.
Hi Mark,
Thanks for your reply.
As a matter of fact, I looked at that exact page before my post. I must not understand the process properly because it is not working for me. When I drag the formula to the Y axis with the individual values on the X axis Graph builder just plots individual data points for the function, not a smooth curve. See attached image. The Legend shows a line but there is no line.
I'm not sure what I'm doing wrong here.
You seem to be plotting the data, not the formula. Try this: drag the predictor data column to the X role, drag the response data column to the Y role, and then drag the formula data column just to the right of the Y role (inside the frame and close to the left border). JMP should preview the result until you release the mouse button. You should see the formula added to the markers.
Here is a step-by-step solution.
Well... I'm an idiot. It turns out that I have two similarly named predictor columns. I used one to generate the curve fit equation but I inadvertently used the other on the X axis for graph builder. Once I corrected this, the Formula Graphics element worked like a charm.
Aaargh.
Thanks for all your help. The incredible support from the JMP staff and community are a HUGE reason why we use JMP.
To switch from point plot to any other plot type - like Formula - just click on the icon on top of the plot region:
if the icons are missing, you can show them again by activating "Show Control Panel" from the Graph builder RedTriangle Menu: