Simple Linear Regression

Top  Previous  Next

How To... > Work with Statistical Objects > Build a Linear Model > Simple Linear Regression

_img508

Suppose you have data for two attributes and you wish to predict one from the other. For example, you might have a sample of airplane types and data about the cost per hour to run them and their range in miles. Can you predict cost per hour from the range?

1.Create an empty linear model by dragging one from the shelf or by choosing Object | New | Linear Model.
2.From the model’s pop-up menu, choose Simple Regression.
3.Drop the response attribute on the first line of the top pane.
4.Drop the predictor attribute on the second line of the top pane.

The result for the airplanes example is shown at right. The blue values are editable either by typing in a new value or by providing a formula. A formula tied to a slider is especially useful. See Use Sliders to Vary Summary Information in a Statistical Object.

The last paragraph of the model allows you to type in your own value for the predictor to get an estimate for the response. The confidence level for this estimate is the same as is given for the slope.

You can make a plot of residuals by making a scatter plot of the two attributes. See Make a Residual Plot.

You can also make attributes for predicted values and residuals in the collection using the linRegrPredicted and linRegrResiduals functions. (see the Reference section on Statistical Functions for Two Attributes.)