15 Linear Regression
15.1 Fitting Simple and Multiple Regression Models
In this section, you will find instructions for fitting simple and multiple regression models.
To specifically fit a simple regression model, use the function Simple Regression available under the Analytics toolbox.
More generally, to fit either a simple or multiple regression model, you can use one of two options:
- The function Simple & Multiple Regression under the Analytics toolbox.
- The function Linear Regression under the Prediction-Classification toolbox.
We recommend using the Linear Regression function from the Prediction-Classification toolbox, as it is more comprehensive. The instructions provided in this section are primarily based on the Prediction-Classification toolbox function. However, these instructions also apply to the Simple & Multiple Regression function under the Analytics toolbox, whenever its functionality overlaps.
Instructions for fitting a multiple linear regression model in Rguroo:
- Use a dataset in your Rguroo account or recreate the example below by importing the cardata dataset from the Rguroo dataset repository called Rguroo Users Guide into your account.
Click here to see a portion of the dataset.

Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the
Analysis
dropdown menu and choose Linear Regression —> Simple & Multiple Regression. This will open the Multiple Regression dialog box (see Figure 15.1).Select a Dataset.
In the Model Specification section, select your response variable from the Response drop down.
In the formula textbox, add your predictors. Predictors must be separated by a + sign. To get a model without an intercept, add -1 to your formula. See R documentation for details on how to specify models with interactions using “*” and “:”.
(Optional) Click the
to add additional output, including model estimate and diagnostics graphs, diagnostic indices, fitted values, and prediction intervals.
Click the Preview icon
to view the result.

Figure 15.1: Multiple regression dialog
Instructions for obtaining prediction intervals in Rguroo:
- Use a dataset in your Rguroo account or recreate the example below by importing the AirPassengers dataset from the Rguroo dataset repository called R datasets into your account.
Click here to see a portion of the dataset.

Open the Analytics toolbox on the left-hand side of the Rguroo window. Use the
Analysis
dropdown menu and choose Linear Regression —> Simple & Multiple Regression. This will open the Multiple Regression dialog box (see Figure 15.2).Select a Dataset.
In the Model Specification section, select your response variable from the Response dropdown.
In the formula textbox, add your predictors. Predictors must be separated by a + sign. To get a model without an intercept, add -1 to your formula. See R documentation for details on how to specify models with interactions using “*” and “:”.
Click the
and select the
Fitted Values, Predictions, and Interval Estimates
tab. Here, move Prediction Interval to theSelected
column using drag-and-drop or the menu arrows.Check one or both of the options Internal Data or External Data. Internal data refers to cases that are used to fit the model. External data refers to cases that are not used to fit the model. You specify the external data by adding them to your dataset and setting the response variable column for these cases to NA.
Click the Preview icon
to view the result.

Figure 15.2: Regression Prediction Intervals dialog