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
RobRobeyns
Level III

Extend linear regression line in JMP version 13

Hi,

 

I have a question regarding the Fit Line functionality in version 13.

In version 10, I was able to make graphs with a linear regression line that extended beyond the data points (see figure). However in version 13 the linear regression line stops at the last data point. Is there a setting in version 13 to achieve the extension of the linear regression beyond the last data point?

example.png

 

Thanks!

20 REPLIES 20
nocaltim
Level II

Re: Extend linear regression line in JMP version 13

Hi Julian,

The problem with your "trick" is this:  Suppose I have a data table with three columns of data -- Age, Height, Weight.  Sometimes I will plot Age vs Weight, sometimes I will plot Age vs Weight, sometimes I will plot Height vs Weight, and sometimes I will invert the X and Y values (Weight vs Age instead of Age vs Weight).  Your trick works only if I have only a single X value for all plots.  Correct?  Or am I missing something?   And, if I am correct, it becomes a real pain to manage as to which column (Age, Weight, Height) will be the X-value for the next plot that I will be making (or re-making via a script).  Instead...JMP should -- at a minimum -- allow forced-fits (where I am prescribing the slope and intercept, for example) to extend to the limits of the X and Y plot window limits.

 

julian
Community Manager Community Manager

Re: Extend linear regression line in JMP version 13

Hi @nocaltim,

I see just what you mean!  There are a few ways to go about this. Using rows with value ranges staggered by column you can achieve the same result, regardless of what variable is the X or Y:Screen Shot 2018-02-13 at 12.43.55 PM.pngI agree that's not ideal, and in Fit Y by X in JMP 14 the line will extend by default. Another option: Graph Builder has a nice functionality for that sort of plotting using the Formula element, which might be useful to you in general. Write your own formula in a formula column, or for any model save your prediction formula for the mean, as well as the formula columns for the confidence intervals (if you want, but make sure to save the formula columns, not just the values), then pull up graph builder, use the same X as the X variable, then all your formula columns for the Y variable, and then click the Formula graph element. You can then change line colors and styles if you like.

 

I hope this helps some!

 

@julian

 

quantum
Level I

Re: Extend linear regression line in JMP version 13

This works acceptably on multiple data sets contained in the same column as split by a group column.  this will work nicely although in JMP 14 I do look forward to seeing this operate by default.  

Kevin_Anderson
Level VI

Re: Extend linear regression line in JMP version 13

I just need to say this, to get it out of my system.  I understand there are exceptions to almost every rule, but:

 

1.  Most physical phenomena are described by sums and/or products of differential equations.  These differential equations are usually nonlinear in the parameters by nature.  (This means something different than "curved"!!)

 

2. Since these sums and/or products of differential equations are very difficult to model, we tend to fit Taylor Series approximations to them, since they are much easier to specify and can often do an acceptable job of fitting the data.  These approximations are necessarily fit only over the range of the existing data.

 

3. Making predictions by extrapolating these approximations outside the existing data is like playing Russian Roulette.

 

Please don't be too upset if JMP and the responsible denizens of this community don't want to help you load your gun!

 

You can do anything your heart desires, no matter how statistically ill-considered or exceptional, by writing a JSL script.  Scripts can be easily deployed across an enterprise.  You may wish to consider writing some JSL to implement your procedures.

 

Good luck!

Vball247
Level V

Re: Extend linear regression line in JMP version 13

Today teaching "JMP Software: ANOVA and Regression", in JMP13.1 and JMP14. It is fixed in JMP14.0, can see the extrapolation in Bivariate. Student has JMP13.1, stops at last data point. So to fix, upgrade to free JMP14.0 for current license owners. Note there are some reported bugs in JMP14.0, so do not uninstall JMP13. It is nice that the upgrade does not overwrite the previous version like other software, you can keep both versions with same license.
KV
KV
Level I

Re: Extend linear regression line in JMP version 13

This has been one of my fustrations with the JMP program, as new rollouts have made the program less flexible and useable.  If alternative work-arounds are being offered for functions that use to be available in past versions, then why was that functionality removed in the first place?

KV
KV
Level I

Re: Extend linear regression line in JMP version 13

For large and complicated datasets the work-around is not feasible.

Kevin_Anderson
Level VI

Re: Extend linear regression line in JMP version 13

When first-generation food processors cut off fingers, responsible manufacturers added interlocks to the covers.

 

When Taylor Series approximations were improperly used to extrapolate beyond the range of the data, responsible manufacturers disabled that functionality.

 

I think Jim and Dan are right.  Just say no to the workarounds.  If you simply must extrapolate, fit a deterministic (usually nonlinear) model.

nocaltim
Level II

Re: Extend linear regression line in JMP version 13

Regarding this issue of extending best-fit lines to the limits of the (say) X graph range limits, I would like suggest a scenario where it is very useful to have these best-fit lines extend beyond the data.  In my work, EVERY SINGLE DAY I do an analysis where two variables should have perfect 1:1 correlation (slope of 1, intercept of zero).  And this 1:1 correlation should extend across range that far exceeds my data limits.  The actual X vs Y never a that true 1:1 correlation -- and that's very useful to know.  But to help grasp this, I like to explicitly add the 1:1 line to the graph.  And I want this 1:1 line to extend far beyond the data limits so that when I also do a best-fit on the actual data, even though the best-fit line is limited to the range of available data, I can use the 1:1 line as "tilted floor" of comparison.  I fully understand why best-fit data shouldn't be extrapolated (too far) beyond the available data, but why can't I include an extended 1:1 line???  (Yes, I can add it as a graphical object, but that's just JMP *creating* work for me rather than JMP simlifying my work.)  Comments?

txnelson
Super User

Re: Extend linear regression line in JMP version 13

While there are almost always exceptions to rules, I believe JMP has taken the most prudent road with the way they have implemented the platform. 

Jim