BookmarkSubscribeRSS Feed
dharding

Community Trekker

Joined:

Aug 14, 2013

extend regression line through intercept

Hi All,

 

there may be an easy way to do this but I haven't figured it out yet. I just want the regression line to pass through the y-axis at the intercept. So far, I can only get results like what I included in the attachment.

 

thanks for any help!

PreviewScreenSnapz006.png

1 ACCEPTED SOLUTION

Accepted Solutions
XanGregg

Staff

Joined:

Jun 23, 2011

Solution

Re: extend regression line through intercept

If you're in Bivariate, just reset the X axis to include 0 before you add the Fit Line. The line will span all visible X values.

4204_biv0.png

11 REPLIES
XanGregg

Staff

Joined:

Jun 23, 2011

Solution

Re: extend regression line through intercept

If you're in Bivariate, just reset the X axis to include 0 before you add the Fit Line. The line will span all visible X values.

4204_biv0.png

mia_stephens

Staff

Joined:

May 28, 2014

Re: extend regression line through intercept

Xan, is there a way to do this for Fit Spline, either here or for the smoother in Graph Builder? I.e. extend the smoother through x=0?

julian

Staff

Joined:

Jun 25, 2014

Re: extend regression line through intercept

Hi @mia_stephens,

 

It seems neither Graph Builder nor Fit Y by X will extend a smoother out of the box. There is a way to this, but it requires a few steps:

 

  1. Launch Fit Y by X with your Y and X, and fit a spline of your choosing (Red Triangle > Flexible > Fit Spline).
  2. Go to the Red Triangle for the smoothing fit > Save Predicteds. JMP will not just save the predicted Ys, but a prediction formula using the Spline Eval() function and a coefficient matrix.
  3. Launch Graph > Graph Builder, add your predictor as the X, and the new saved formula column as the Y
  4. Toggle the Formula graphing element
  5. If you want to have the original points plotted, drag your original Y column to the drop zone to add a variable to Y, and then shift-click the Points element (or drag the points element to the plot).
  6. You will be plotting points for both the formula column as well as the original Y; if you don't want this, expand the controls for the points and uncheck the box for the spline predictor under variables. 

 

Now, whether or not this is a good idea of course depends on the data and how flexible that model is. In the example below this particular extrapolation returns a prediction of -29,714 lbs for someone 0 inches tall :)

 

I hope this helps!

 

@julian

 

Spline.gif

 

 

 

 

mia_stephens

Staff

Joined:

May 28, 2014

Re: extend regression line through intercept

Thanks Julian, will pass posting this along.

 

Mia

dharding

Community Trekker

Joined:

Aug 14, 2013

Re: extend regression line through intercept

Thanks so much! I knew it'd be a quick and easy one

Byron_JMP

Staff

Joined:

Apr 26, 2012

Re: extend regression line through intercept

If you happen to forget to reset the axis before fitting the line...

Click the red triangle menu on the linear fit, and then select "set alpha level", 0.05 is the default so click that.

This will redraw the regression line, and it will also redraw the confidence intervals of the individual and fit too.

JMP Systems Engineer, Pharm and BioPharm Sciences
tylerram93

Community Trekker

Joined:

Jul 20, 2017

Re: extend regression line through intercept

Do you know how to do this using the JMP script?

txnelson

Super User

Joined:

Jun 22, 2012

Re: extend regression line through intercept

All you have to do to get the JMP script for this, is to generate the bivariate plot interactively, and then go to the red triangle in the output, and select "Save Script".  It will give you your script for reproducing the chart.

Jim
tylerram93

Community Trekker

Joined:

Jul 20, 2017

Re: extend regression line through intercept

Yes, but when I do that it doesn't work all the time. I have some plots I
generated that still don't work.

Tyler