Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Adding a Value to End of Trend Line

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 20, 2020 1:07 AM
(240 views)

I have a set marker at 1800 RFh and my trend line shows that at the end of this reporting period, I have cross and passed the mark.

However, how can I add a value at the end of the trend line to show the calculated value by JMP? Assuming Lamda is default.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

@Sage ,

JMP platforms are the options found under analysis and graphs. For example Fit Y by X with both continuous Y and X is called Bivariate; continuous Y and nominal X is called Oneway, or as documented in my post GraphBuilder. Your graph looked like a trend or time series. So I was stating I could not determine how you created the graph in your original post.

The JMP messgages (commands) to save the values or formula of the smoothed curve can be different for diifferent platforms. If you save the script (inverted red triangle option) for your graph to the script window and post it, then a script that would work for your graph could be provided. Don't forget to change names or values that might contain proprietary information before posting.

3 REPLIES 3

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Adding a Value to End of Trend Line

Created:
Aug 21, 2020 1:44 AM
| Last Modified: Aug 21, 2020 1:45 AM
(206 views)
| Posted in reply to message from Sage 08-20-2020

@Sage ,

I cannot detect which platform you are using. Here is as script that adds the last value of a smoother from the GraphBuilder platform. The key here is to save the smoother values to the data table, you can delete that new smoother values column later. It takes a few steps to find the last value, extend the x-axis and add the text.

```
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 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
//get row where max X
xmax = Col Max( :height );
idx = (dt << get rows where( :height == xmax ))[1];
gbb = Report( gb )[Graph Builder Box( 1 )];
Wait( 0.5 );
```

//smoother is the second element, save to the data table
gbb << Update Element( 1, 1, 2, {Save Formula} );
//smoother is in the last col
lastVal = Round( Column( dt, N Col( dt ) )[idx], 2 );
// here is the tricky part, if you want to annotate this to teh right of xmax you need to extend the x axis
gb_x = gbb[GraphBuilderAxisBox( 1 )];
xaxis_inc = gb_x << get inc;
xaxis_max = gb_x << get max;
//add a half inc ?? arbitrary
gb_x << Max( xaxis_max + 0.5 * xaxis_inc );
Eval(
Eval Expr(
gbb[FrameBox( 1 )] << Add Graphics Script(
Text Font( "Arial", 10, "Bold" );
Text Color( "Red" );
Text( {Expr( xmax + 0.1 * xaxis_inc ), Expr( lastVal )}, Expr( Char( lastVal ) ) );
)
)
);

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Adding a Value to End of Trend Line

Thanks!

Let me play around and figure out. Haven't attended JMP course yet due to Covid-19.

By platform, what do you mean? I'm using version 15.1

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

@Sage ,

JMP platforms are the options found under analysis and graphs. For example Fit Y by X with both continuous Y and X is called Bivariate; continuous Y and nominal X is called Oneway, or as documented in my post GraphBuilder. Your graph looked like a trend or time series. So I was stating I could not determine how you created the graph in your original post.

The JMP messgages (commands) to save the values or formula of the smoothed curve can be different for diifferent platforms. If you save the script (inverted red triangle option) for your graph to the script window and post it, then a script that would work for your graph could be provided. Don't forget to change names or values that might contain proprietary information before posting.