cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Aphex
Level I

Graph line of fit for all values and ellipse by group

I'm trying to figure out if it's possible to create a graph in JMP which draws a Line of Fit relative to all points in the graph along with 95% ellipse curves over individual groups.  

 

For example if this is my data:

X ValueY ValueGroup
33A
26A
42A
16A
13B
22B
32B
41B

 

If I do Graph Builder - X Value to X - Y Value to Y - Group to Color - Click Line of Fit.  I want to keep the color for each group and the regression line fit based on points from both groups.

 

Then if I do this in another Graph Builder - X Value to X - Y Value to Y - Group to Overlay - Click Ellipse.  I want to keep the separate ellipses over each group without removing the regression line or color from above. 

 

I've tried various methods (copying Frame Contents, scripts, etc) for accomplishing this without any luck.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Graph line of fit for all values and ellipse by group

Maybe try this without Graph Builder.

 

Use Fit Y by X. Put your X and Y values in the proper roles.

In the resulting graph, click the red triangle and choose Fit Line.

 

Now go back to the red popup and choose Group By... and specify your Group column.

One more trip to the red popup and choose Density Ellipse > 0.95.

 

To make things prettier you will likely want to right-click the graph and add a Row Legend with the Group column to establish the marker colors.

You will also want to click red popups associated with each density ellipse to shade them, if you like the shading.

 

I've included my result for your sample data.Fit Y by X.png

 

 

Dan Obermiller

View solution in original post

2 REPLIES 2

Re: Graph line of fit for all values and ellipse by group

Maybe try this without Graph Builder.

 

Use Fit Y by X. Put your X and Y values in the proper roles.

In the resulting graph, click the red triangle and choose Fit Line.

 

Now go back to the red popup and choose Group By... and specify your Group column.

One more trip to the red popup and choose Density Ellipse > 0.95.

 

To make things prettier you will likely want to right-click the graph and add a Row Legend with the Group column to establish the marker colors.

You will also want to click red popups associated with each density ellipse to shade them, if you like the shading.

 

I've included my result for your sample data.Fit Y by X.png

 

 

Dan Obermiller
txnelson
Super User

Re: Graph line of fit for all values and ellipse by group

Is this what you want......overall line, but separate ellipses?  If so, just specify under the variables for Line, to not Overlay

overlay.PNG

Jim