![]() |
spa |
|
How to fit different portions of the data to different equations
In some situations you may wish to fit different models to different portions of your data. This often occurs in kinetic experiments where you add a drug or perform some sort of intervention while recording data. The values collected before the intervention follow a different model than those collected afterwards. Although Prism has no built-in way to fit different equations to different portions of the data, you can achieve that effect using a user-defined equation containing the IF function. Example 1. Plateau followed by exponential association In this example, you collected data that established a baseline early in the experiment, up to "Start". You then added a drug, and followed the outcome (Y) as it increased towards a plateau. Prior to the injection the data followed a horizontal line; after the injection the data formed an exponential association curve.
It is easiest to understand this equation by reading the bottom line first. For X values less than START, Y equals Y1, which is the baseline. Otherwise, Y equals Y2, which is defined by the exponential association equation. This equation has two intermediate variables (Y1 and Y2). Prism can fit the four true variables: START, SPAN, K, and BASELINE. In many cases, you'll make START a constant equal to the time of the experimental intervention. If you want Prism to fit START, choose an initial value carefully. Example 2. Two linear regression segments This example fits one linear regression line to points where X is less than some value X0 and another linear regression line to points where X is greater than X0. You can make X0 a constant (the time of an experimental intervention). Or you can ask Prism to find the best fit value of X0. The two lines will not necessarily meet at X0, and may intersect far from it. Use this user-defined equation in Prism's nonlinear regression:
Y1 and Y2 define the two linear regression lines, each with their own slope and intercept. If X is less than X0, Y is computed using the Y1 formula, otherwise the Y2 formula is used. If you want Prism to fit X0, give Prism a reasonable initial value. The rule that the initial value of X0 equals 1 times XMID works well for many data sets. The initial values of the two slopes and intercepts don't really matter (since this is a linear, rather than a nonlinear, equation). Prism will fit them accurately even if all initial values are set to zero. This method fits two linear regression lines, but does not ensure that the lines meet at X0. The curve may be discontinuous, as shown below. In this example the best-fit value of X0 is 6.5. The two regression lines do not intersect at X=6.5, so the curve is discontinuous. The next example fits two linear regression lines that intersect at X0. Example 3. Two linear regression segments that meet at the breakpoint This equation fits two linear regression lines, ensuring that they intersect at X=X0.
The first line of the equation defines the first line segment from its intercept and slope. The second line of the equation computes the Y value of the first regression at the right end of that segment, when X=X0. The third line of the equation computes the second regression segment. Since we want a continuous line, the Y value at the left end of the second segment must equal the Y value at the right end of the first segment (YatX0). The Y value at any other position along the second segment equals YatX0 plus the increase due to the second regression line. That increase equals the slope of the second segment (slope2) times the distance from X to X0. The final line defines Y for all values of X. If X is less than X0 then Y is set equal to Y1. Otherwise Y is set equal to Y2. Here are the results with sample data. The program found that the best-fit value of X0 was 5.00, and the two lines meet at that X value.
Example 4. Linear regression with three segments This equation fits three linear regression lines, ensuring that they intersect at X=X0 and X=X1.
The logic is identical to that of the two segment regression line. Use segmental linear regression cautiously Segmental linear regression is appropriate when something happens at X0 to change the slope of the line. For example, segmental linear regression might be appropriate if X is time, and you added a drug or changed a voltage at time X0. If you didn't perform an intervention at X0, consider carefully whether segmental linear regression is the analysis of choice. Without an experimental intervention, segmental linear regression is rarely an appropriate method, as there usually is not a sharp break point. Instead, you probably want to fit some sort of curve. Warning. Segmental linear regression is definitely NOT an appropriate method to analyze a biphasic Scatchard plot. A biphasic Scatchard plot follows a curve, not two intersecting lines. There is no abrupt break point. You should fit the original data to a two-site binding curve instead. |
| All contents copyright © 1999 by GraphPad Software, Inc. All rights reserved. |