Example: Predicting Weight Based on a Student’s Height

In this example, you want to use regression analysis to find out how well you can predict a child's weight if you know the child's height.
To create this example:
  1. In the Tasks section, expand the Statistics folder, and then double-click Linear Regression. The user interface for the Linear Regression task opens.
  2. On the Data tab, select the SASHELP.CLASS data set.
    Tip
    If the data set is not available from the drop-down list, click Select a table icon. In the Choose a Table window, expand the library that contains the data set that you want to use. Select the data set for the example and click OK. The selected data set should now appear in the drop-down list.
  3. Assign columns to these roles:
    Role
    Column Name
    Dependent variable
    Weight
    Classification variables
    Sex
    Continuous variables
    Age
    Height
  4. On the Model tab, click Edit Icon and create these models:
    1. Select the Height variable, and then press Ctrl and select the Age variable. Click Add.
    2. Select the Height variable, and then press Ctrl and select the Sex variable. Click Cross.
    Creating Models for This Example in the Model Builder
    Click OK.
  5. To run the task, click Submit SAS Code.
Here is a subset of the results:
Tabular Results for Linear Regression Example
Graph of the Observed Values by the Predicted Values for Weight