KNOWLEDGEBASE - ARTICLE #912

Fitting the crossing point of two intersecting linear regression lines .

Prism can do this, but you must use the nonlinear regression analysis, rather than linear regression. The nonlinear regression analysis can fit straight lines, but has more options (as is needed here).

Enter your data onto one data table, with Y values in columns A and B next to corresponding X values in the X column. If the X values don't match for the two data sets, just leave some Y values blank.

Use nonlinear regression, and enter this user-defined equation.

Y= Ycross + (X - Xcross)*Slope

This means that the Y coordinate of any point along either line equals the Y coordinate of the crossing point plus the slope times the X distance from the crossing point to that point.

Set these rules for initial values:

  • Ycross:  1*Ymid (the average of the highest and lowest Y values)
  • Xcross:  1*Xmid
  • Slope:    1*(Ymax-Ymin)/(Xmax-Xmin).

Define Xcross and Ycross to be shared parameters, so Prism will find one global best-fit value for those parameters that applies to both data sets. Do not share the slope parameter, as you want Prism to fit separate slopes for each data set. Getting these sharing settings correct is essential.

Prism will fit four parameters:

  • Slope for the first data set
  • Slope for the second data set
  • Xcross (shared for both data sets)
  • Ycross (shared for both data sets).

That makes sense. You have two lines, and it takes two parameters (usually a slope and intercept) to describe each. Here, the equations were rearranged so the program doesn't fit two separate Y intercepts, but rather fits the X and Y values of the crossing point. 

Here is an example, with the key results circled. Prism file

 



Keywords: intersect, cross, lines, linear regression

Explore the Knowledgebase

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.