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
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.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.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.png

robert_d_
Level II

Re: plot regression line through overlay groups

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