The Linear Regression Tab
The Linear Regression tab fits a linear regression model to a continuous response variable by OLS (Ordinary Least Squares).
The examples below use the Auto MPG dataset. Opening the link launches MIDAS and imports this dataset.
Linear Regression Model
A linear regression model expresses the response variable as the sum of a linear combination of the predictors and an error. The model in the examples takes fuel economy mpg as the response variable, and horsepower horsepower and weight weight as the predictors:
is the intercept, and are the coefficients of the predictors, and is the error of observation .
MIDAS uses the values that minimize the residual sum of squares as the coefficient estimates.
Error Assumptions
MIDAS computes standard errors, confidence intervals, and prediction intervals based on assumptions about the errors. OLS Fundamentals: Error Assumptions and the Guaranteed Properties explains the assumptions and the properties that each of them guarantees.
Analysis Execution
Tab Access
Open the tab from Analysis > Linear Regression (OLS)... in the menu bar.
Analysis Settings

The columns you can select as the response variable and the predictors are integer, decimal, and boolean columns whose measurement scale is interval or ratio. Boolean columns have a nominal scale by default, so you cannot select them as they are. Changing the scale to interval in the Data Table tab lets you select the column, with true as 1 and false as 0.
Categorical columns can be used as predictors after you convert them to columns of 0 and 1 in the Dummy Coding tab. The converted columns are placed in a new Derived Dataset, so select that dataset in Dataset.
Confidence Level is the confidence level of the confidence intervals and prediction intervals, and does not affect the fit of the model.
Exclusion of Missing and Invalid Values
MIDAS fits the model after excluding the rows in which the response variable or any predictor has a missing or invalid value. Invalid values are not-a-number values and infinities. This exclusion is listwise deletion. Missing Data Mechanisms explains the conditions under which listwise deletion yields valid estimates.
Interpretation of Results
Model Summary

| Item | Content |
|---|---|
| R² | Coefficient of determination |
| Adjusted R² | Coefficient of determination computed by dividing the numerator and the denominator of the fraction in the R² formula by the DF (degrees of freedom) of Residuals and Total in the ANOVA Table, respectively |
| Residual Std. Error | Residual standard error and residual degrees of freedom (df) |
| MAE | Mean absolute error |
| Observations | Number of observations used in the fit |
The R² of a model with Include intercept turned off cannot be compared with the R² of a model with an intercept. When Include intercept is turned off, the baseline model of R² is the model whose fitted value is 0 rather than the mean of the response variable.
Coefficients

The coefficient table shows the intercept and each predictor in its own row, with the estimate (Estimate) and the following columns1.
| Column | Content |
|---|---|
| Std. Error | Standard error |
| Lower N% / Upper N% | Lower and upper limits of the confidence interval with confidence level N% |
| Std. Coef. | Standardized coefficient. The coefficient multiplied by the standard deviation of the predictor and divided by the standard deviation of the response variable |
| VIF | Variance inflation factor |
Coefficient Interpretation
The coefficient of a predictor is the difference in the expected value of the response variable when the value of that predictor is larger by 1 and the values of the other predictors are the same. The model in the examples estimates that, for cars of the same weight, fuel economy is lower by 0.047 mpg on average when horsepower is larger by 1.
Model Fit

Residual Deviance is the residual sum of squares, and Null Deviance is the sum of squares in the denominator of the fraction in the R² formula.
The information criteria AIC (Akaike information criterion) and BIC (Bayesian information criterion) can be compared only between models with the same response variable fitted to the same rows.
ANOVA Table

ANOVA Table shows the sums of squares of the predictors, the residuals (Residuals), and the total (Total), using the type you select from Type I and Type III. ANOVA Tab: Sum of Squares Types explains the difference between the two types.
With Type I, MIDAS adds the predictors to the model in the order of the rows in the table, from the top. You cannot specify this order.
Selecting Type III adds the partial η² and partial ω² columns to the table. ANOVA Tab: ANOVA Table explains the definitions of the two.
Prediction & Confidence Intervals

The Prediction & Confidence Intervals table lists the fitted value (Fitted), the confidence interval for the mean response (CI), and the prediction interval (PI) for each observation used in the fit. OLS Fundamentals: Normality and Interval Estimation explains the difference between the two intervals.
Storage of Results
Model Storage

After you save the model with Save Model, you can use View Model Details, which shows the saved model, and View Diagnostics, which shows the residual diagnostics.
Table Storage
You can save the coefficient table and the Prediction & Confidence Intervals table as Derived Datasets with Save as Dataset.
Residual Diagnostics
View Diagnostics opens four diagnostic plots. OLS Fundamentals: Standardized Residuals and Diagnostic Statistics explains the definitions of the residuals, standardized residuals, leverage, and Cook's Distance used in the plots.
The next four sections show plots of a model of the Production Line dataset and of the Auto MPG model in the examples. The Production Line model is the model fitted in the tutorial. Its plots are close in shape to the plots obtained when the error assumptions hold. Departures from the error assumptions appear in the plots of the Auto MPG model.
Residuals vs Fitted


Residuals vs Fitted is a plot for examining whether the expected value of the response variable can be expressed as a linear combination of the predictors, from the presence or absence of a curved pattern in the residuals. If the error assumptions hold, the points scatter above and below the dashed line at residual 0, and no curved pattern appears.
A curved pattern is not visible for Production Line and is visible for Auto MPG. The residuals of Auto MPG tend to be positive where the fitted values are 13 or less and between 30 and 32, and negative where they are around 20. This pattern appears when the expected value of fuel economy cannot be expressed as a linear combination of horsepower and weight.
Scale-Location


Scale-Location is a plot for examining whether homoscedasticity of the errors holds, from whether the square root of the absolute value of the standardized residuals increases or decreases with the fitted values. If the error assumptions hold, the mean height of the points is nearly the same regardless of the fitted values.
A tendency for the mean height of the points to increase or decrease with the fitted values is not visible for Production Line and is visible for Auto MPG. The mean height of the points of Auto MPG is low where the fitted values are around 15 and high where they exceed 20. This pattern appears when the error variance differs across fitted values, or when the expected value of fuel economy cannot be expressed as a linear combination of horsepower and weight.
Normal Q-Q


Normal Q-Q is a plot for examining whether normality of the errors holds, from the departure of the points from the dashed line. The dashed line connects the positions where the standardized residuals equal the quantiles of the standard normal distribution. If the error assumptions hold, the points lie along the dashed line.
The points that depart from the dashed line are a few points at the upper right for Production Line, and points at both ends and in the center for Auto MPG. For Auto MPG, the points at both ends lie above the dashed line, and the points whose horizontal-axis values are between 0 and 1 lie below it. The distribution of these standardized residuals has a shorter left tail and a longer right tail than the normal distribution.
Residuals vs Leverage


Residuals vs Leverage is a plot for examining which observations have a large influence on the coefficient estimates, from the positions of the points relative to the dashed lines. The orange dashed line connects the positions where Cook's Distance is 0.5, and the red dashed line connects those where it is 1.0. The Cook's Distance of a point on the side of the orange dashed line farther from standardized residual 0 is greater than 0.5, and that of a point on the farther side of the red dashed line is greater than 1.0. When no dashed line is visible in a plot that has been neither zoomed nor panned, the Cook's Distance of every plotted observation is less than 0.5.
If the error assumptions hold, the points scatter above and below standardized residual 0 regardless of the leverage.
Production Line has no observation whose leverage is far from those of the other observations, and Auto MPG has one. The leverage of this Auto MPG observation is about 0.095. Its point lies on the side of the orange dashed line closer to standardized residual 0, so the Cook's Distance of this observation is less than 0.5. No dashed line is visible in the Production Line plot, so the Cook's Distance of every observation is less than 0.5.
Observations with leverage 1 do not appear in the three plots other than Residuals vs Fitted, because their standardized residuals are undefined. Find such observations in the leverage column of the diagnostic dataset.
Point Selection
When you select points in a plot, MIDAS also selects the rows of the same observations in the dataset used in the fit. Row Selection and the Filtered Data Tab explains the range in which selections are shared.
Diagnostic Dataset
Save as Dataset below the plots saves a Derived Dataset that adds the following columns to the dataset used in the fit. This Derived Dataset is called the diagnostic dataset.
| Column name | Content |
|---|---|
fitted_values | Fitted value |
deviance_residuals | Residual |
standardized_residuals | Standardized residual |
sqrt_abs_std_residuals | Square root of the absolute value of the standardized residual |
leverage | Leverage |
cooks_distance | Cook's Distance |
You can add a diagnostic plot to a report from ⋮ next to the plot title. When you add it, MIDAS also saves the diagnostic dataset.
Prediction
You can use a saved model to compute the predicted value, the confidence interval for the mean response, and the prediction interval for each row of another dataset. Press Make Predictions in the Model Detail tab, which opens from View Model Details, and select the dataset to predict. GLM Tab: Prediction explains the operation and the conditions on the datasets you can select.
See also
- OLS Fundamentals - The mathematics of the error assumptions, standardized residuals, Cook's Distance, and VIF
- The GLM Tab - Analysis of binary, count, and positive continuous response variables
- The ANOVA Tab - Comparison of the means of groups defined by categorical columns
- The Dummy Coding Tab - Conversion of categorical columns to numeric columns
- Prediction Accuracy Metrics - Definitions of root mean squared error (RMSE), MAE, and predictive R²
Footnotes
-
You can change the display format of the numeric columns in the coefficient table from the context menu of the column header. ↩
Also available as a Markdown file.