cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • DownloadSemiconductor Toolkit: Tools to create wafer maps, add wafer geometry to graphics, explore die defects & compare wafers.
  • Discovery Summit 2026: Early User Edition - September 23-24.Register. It's free.
  • Use JMP Clinical with CDISC-compliant data. Review studies, ID safety and efficacy signals & communicate findings with interactive graphics. Register to see how. Aug. 27, 2 pm US ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
robert_d_
Level II

plot regression line through overlay groups

Hello,

I want to create an x-y graph with a single regression line passing through data points that are differentiated by color for each of four groups. I can create an overlay plot with different colored groups, see below:8131_JMP-Overlay.PNG8131_JMP-Overlay.PNG

But can't do regression in Overlay mode. This is pretty simple to do in Proc Gplot so I figure there's a way in JMP.

Any pointers?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz
Super User

Re: plot regression line through overlay groups

You can use Graph Builder to do this.  Plot meanHI vs population, and drag the Density column into the Color area.  Then click on the Line of Fit toolbar icon.

Here's a scripted example using Big Class:

dt = open("$sample_data\Big Class.jmp");

dt << Graph Builder(

     Show Control Panel( 0 ),

     Variables( X( :weight ), Y( :height ), Color( :age ) ),

     Elements(

           Points( X, Y, Legend( 1 ), Jitter( 1 ) ),

           Line Of Fit(

                X,

                Y,

                Legend( 4 ),

                Confidence of Fit( 0 ),

                Confidence of Prediction( 0 ),

                Degree( "Linear" ),

                Equation( 0 ),

                Root Mean Square Error( 0 ),

                R²( 0 )

           )

     )

);


8140_Big Class Regression.png8140_Big Class Regression.png

View solution in original post

2 REPLIES 2
pmroz
Super User

Re: plot regression line through overlay groups

You can use Graph Builder to do this.  Plot meanHI vs population, and drag the Density column into the Color area.  Then click on the Line of Fit toolbar icon.

Here's a scripted example using Big Class:

dt = open("$sample_data\Big Class.jmp");

dt << Graph Builder(

     Show Control Panel( 0 ),

     Variables( X( :weight ), Y( :height ), Color( :age ) ),

     Elements(

           Points( X, Y, Legend( 1 ), Jitter( 1 ) ),

           Line Of Fit(

                X,

                Y,

                Legend( 4 ),

                Confidence of Fit( 0 ),

                Confidence of Prediction( 0 ),

                Degree( "Linear" ),

                Equation( 0 ),

                Root Mean Square Error( 0 ),

                R²( 0 )

           )

     )

);


8140_Big Class Regression.png8140_Big Class Regression.png

robert_d_
Level II

Re: plot regression line through overlay groups

That worked. Thank you for the speedy reply and the scripting example. 

Recommended Articles