## Please enable JavaScript to view this site.

This guide is for an old version of Prism. Browse the latest version or update Prism
 Equation: Fitting a straight line with nonlinear regression

## Introduction

Linear regression fits a straight line through your data. Nonlinear regression fits any model, which includes a straight line model. Prism offers separate analyses for linear regression and nonlinear regression, so you can choose either one to fit a line.

Prism's nonlinear regression analysis offers more options than its linear regression analysis, such as the ability to compare two models, apply weighting, automatically exclude outliers and perform normality tests on the residuals. See a longer discussion of the advantages of using the nonlinear regression analysis to fit a straight line.

## Step by step

Create an XY data table. There is one X column, and many Y columns. If you have several experimental conditions, place the first into column A, the second into column B, etc.

After entering data, click Analyze, choose nonlinear regression, choose the panel equations for lines, and choose Straight line.

## Model

Y= YIntercept + Slope*X

## Interpret the parameters

YIntercept is the Y value where the line intersects the Y axis.

Slope is the slope of the line, expressed in Y units divided by X units.

## Special forms of the linear regression equation

### Horizontal line

If you constrain the slope to be zero, the line will be horizontal. The only parameter is the Y intercept. Prism has this model built in as "horizontal line". The best-fit value of the Y intercept is the mean of all the Y values. The model is:

Y = Mean + 0*X

Prism requires that all equations include X. Here X is multiplied by zero, so it is present (as required) but has no effect.

### Line through origin

If you constrain the Y intercept to be zero, the line has to go through the origin (X=0, Y=0). Prism has this "Line through origin" model built in:

Y=Slope*X

The only parameter is the slope.