The GLM Tab
The GLM tab fits generalized linear models (GLMs) to response variables that cannot be assumed to follow a normal distribution, such as binary outcomes, counts, and positive continuous values. A GLM extends the linear model by specifying a distribution family and a link function for the response variable. GLM Fundamentals explains the mathematical background.
OLS regression in the Linear Regression tab is the same model as a GLM with the Gaussian family and the Identity link. When the response is continuous and a normal distribution is a reasonable assumption, you can use the Linear Regression tab.
Distribution Families and Link Functions
Distribution Families
Distribution Family selects the family that matches the data type of the response variable. There are five options.
| Family (UI label) | Description |
|---|---|
| Gaussian (Normal) | Use it for continuous values such as height or temperature |
| Binomial (Logistic) | Use it for binary (0/1) responses such as whether a purchase was made or an inspection passed. Pairs of successes and trials are also supported. This is logistic regression. |
| Poisson (Count) | Use it for count data. It is commonly used to model counts such as inquiries or accidents per day. This is Poisson regression. |
| Gamma (Positive Continuous) | Use it for positive continuous values with a long right tail, such as waiting times or repair costs |
| Negative Binomial (Overdispersed Count) | Use it for overdispersed count data, when the Poisson assumption that the variance equals the mean does not hold |
The Binomial family offers a Response format choice. Binary (0/1) fits per-observation 0/1 data, and Grouped (n trials) fits data aggregated into successes and trials. Selecting Grouped replaces Response Variable (Y) with a Successes column and a Trials column. See Grouped Binomial GLM for Dose-Response Data for a worked example.
Link Functions
The Link Function options depend on the distribution family. Changing the family automatically switches the link function to that family's default.
| Family | Default | Available links |
|---|---|---|
| Gaussian | Identity | Identity, Log |
| Binomial | Logit | Logit, Probit |
| Poisson | Log | Log, Identity |
| Gamma | Inverse | Inverse, Log, Identity |
| Negative Binomial | Log | Log |
The link function connects the linear predictor to the expected value of the response. See GLM Fundamentals: Choosing a Link Function for guidance on reading effects as differences versus ratios and for the properties of canonical links.
Basic Usage
The examples below use the Auto MPG dataset. Opening the link launches MIDAS with this dataset loaded.
Opening GLM
Select Analysis > Generalized Linear Model (GLM)... from the menu bar.
Setting Up the Analysis

Dataset selects the dataset to analyze.
Response Variable (Y) selects the response variable. Only numeric columns (interval or ratio scale) can be selected. For the Binomial family, use a column containing 0/1 values1.
Predictor Variables (X) selects the predictors with checkboxes. Categorical columns (nominal or ordinal scale) and date columns cannot be selected; convert them to numeric variables in the Dummy Coding tab first.
Distribution Family and Link Function select the family and the link. See Distribution Families and Link Functions for the options.
Include intercept toggles the intercept term. It is on by default.
Confidence Level sets the level of the coefficient confidence intervals. The default is 95%, and values from 50 to 99.99% can be specified. The chosen level appears in the Lower N% / Upper N% columns of the coefficient table.
Max Iterations and Convergence Tolerance are the iteration limit and the convergence threshold of the estimation algorithm. The fit is considered converged when the largest absolute change in the coefficients falls below the threshold. The defaults are 100 iterations and 1e-6. See Convergence Issues for adjustments when the fit does not converge with the defaults.
Negative Binomial Settings
Selecting the Negative Binomial family shows settings for the shape parameter θ. The parameter θ controls the degree of overdispersion; see GLM Fundamentals: Variance Functions and Overdispersion for its statistical meaning.
By default, θ is estimated automatically by profile likelihood. See GLM Fundamentals: The Exponential Family for how the estimation works. Turning on Manually specify θ lets you enter θ in the range 0.1 to 100. The initial value of the input is 1.0. Manual specification is useful for sensitivity analysis, where you check how the results change with θ, and for model comparison with a fixed θ.
Offset Variable
Offset Variable specifies a column added to the linear predictor with its coefficient fixed at 1. An offset is not an estimated parameter but a known value for each observation. A column chosen as the offset is removed from the predictor candidates.
The typical use case is rate modeling in Poisson regression. Suppose you compare failure counts across machines: when operating hours differ from machine to machine, raw counts are not comparable. A machine with 5 failures in 100 hours fails more often per hour than one with 10 failures in 1,000 hours.
The offset accounts for the differing operating hours. With the failure count as the response and the log of operating hours, log(hours), as the offset, the model describes the failure rate per hour rather than the raw count.
In this model, can be interpreted as a rate ratio. With a predictor indicating whether a machine has a maintenance contract, an estimated of 0.8 means the failure rate of machines with a contract is estimated to be 0.8 times that of machines without one.
The offset also affects the null deviance (the deviance of the model with only the intercept and the offset), so its value differs from the model without an offset.
When you run predictions with an offset model, the prediction dataset must contain an offset column with the same name.
Running the Analysis
When the settings are complete, click Run GLM. Parameters are estimated with IRLS (Iteratively Reweighted Least Squares). See GLM Fundamentals: Parameter Estimation for the algorithm.
During estimation, a progress dialog shows the deviance at each iteration so you can watch the fit converge. Cancel stops the estimation. The convergence history can be saved as a dataset with Save as Dataset.
Changing the variable selection or the model settings after a run makes the displayed results no longer belong to the current settings. MIDAS removes those results from the view and shows a message asking you to run the analysis again. Restoring the previous settings brings the results back. Changing Dataset also resets the variable selection, so the results are discarded instead. Changing Confidence Level keeps the results, because that setting only recomputes the intervals from the estimated coefficients.
Understanding Results

Model Summary
The Model Summary lists goodness-of-fit indicators.
Convergence shows whether IRLS converged, together with the number of iterations. If the fit did not converge, the coefficients and standard errors are not reliable.
Deviance is the residual deviance, a goodness-of-fit measure based on the log-likelihood difference from the saturated model. See GLM Fundamentals for details.
AIC is the Akaike information criterion; smaller values indicate a better balance between fit and model complexity. Compare AIC only between models of the same distribution family, because families differ in how constant terms of the log-likelihood are handled2.
Shape Parameter (θ) appears only for Negative Binomial and indicates whether the value was estimated or manually specified.
Coefficients
The coefficient table shows the following columns.
| Column | Content |
|---|---|
| Variable | Variable name. The intercept is "(Intercept)". |
| Estimate | Coefficient estimate, on the link function scale |
| Std. Error | Wald standard error |
| Lower N% / Upper N% | Wald confidence interval, where N is the chosen confidence level |
| OR / IRR / exp(Est.) | , shown depending on the link function |
| exp(Lower N%) / exp(Upper N%) | The confidence interval transformed by |
The column is labeled odds ratio (OR) for the Logit link, incidence rate ratio (IRR) for the Log link with Poisson and Negative Binomial, and multiplicative effect exp(Est.) for the Log link with Gaussian and Gamma. The column is not shown for the Identity, Inverse, and Probit links.
Confidence intervals are based on the t distribution for families whose dispersion parameter is estimated from the data, and on the standard normal distribution otherwise. See GLM Fundamentals: Coefficient Standard Errors and Confidence Intervals for the calculation details.
Interpreting Coefficients
Coefficients are estimated on the link function scale, so their interpretation depends on the link.
| Link | Interpretation |
|---|---|
| Identity | is the change in the expected response itself, the same interpretation as OLS |
| Logit | is the change in the log odds, and is the odds ratio |
| Log | is the multiplicative change in the expected response |
| Inverse, Probit | Direct interpretation of the coefficients is difficult; interpreting through predicted values is practical |
See GLM Fundamentals: Choosing a Link Function for the effect-measure perspective of reading effects as differences versus ratios.
Saving the Coefficient Table and Reports
The coefficient table can be saved as a dataset with Save as Dataset and exported to CSV. The saved dataset contains the columns Variable, Estimate, Std. Error, Lower N%, and Upper N%; with the Logit and Log links, the exp-transformed columns are also included.
Saving the coefficient dataset requires saving the model. If the model has not been saved yet, a dialog asks for a model name and saves the model and the dataset together. The coefficient dataset is tied to the model: deleting the model deletes the dataset with it, and refitting the model updates the dataset with the new results.
Add to Report adds the coefficient table to a report. This also requires the model to be saved.
Saving Models and Diagnostics
Saving the Model
Enter a model name in Model Name and click Save Model. A name in the form "GLM: Y ~ X1 + X2 (Family, link)" is generated automatically, so you can use it as is. If a model with the same settings (dataset, response variable, predictors, family, link, and intercept) already exists, a confirmation dialog asks about overwriting it.
After Saving
After saving the model, two buttons appear: View Model Details and View Diagnostics.
View Model Details opens the Model Detail tab. Changing the Confidence Level input in the Model Detail tab recalculates the confidence intervals and column headers on the fly from the saved coefficients and standard errors. The values saved in the model do not change. From the Model Detail tab you can also add the coefficient table to a report with Add to Report and run predictions with Make Predictions.
View Diagnostics opens the GLM Diagnostics tab, which shows residual diagnostic plots.
Data Generated for Diagnostics
Opening the GLM Diagnostics tab for the first time generates a derived dataset that adds diagnostic statistics columns to the original dataset. The added columns are as follows.
| Column | Content |
|---|---|
fitted_values | Predicted values, on the response scale |
deviance_residuals | Deviance residuals |
pearson_residuals | Pearson residuals |
standardized_residuals | Standardized residuals (deviance-based) |
sqrt_abs_std_residuals | Square root of the absolute standardized residuals, the vertical axis of the Scale-Location plot |
standardized_pearson_residuals | Standardized residuals (Pearson-based) |
sqrt_abs_std_pearson_residuals | Square root of the absolute Pearson-based standardized residuals |
leverage | Leverage (diagonal elements of the hat matrix) |
cooks_distance | Cook's Distance (deviance-based) |
cooks_distance_pearson | Cook's Distance (Pearson-based) |
The Pearson-based columns correspond to the diagnostic plots when Pearson is chosen in the residual type selection. The dispersion parameter used for standardization depends on the family; see GLM Fundamentals: Variance Functions and Overdispersion for details.
Diagnostic Plots
Clicking View Diagnostics shows four diagnostic plots. As with OLS, they are used to check the model fit, the variance assumption, and the influence of outliers.

Residual Type Selection
The residual type of the diagnostic plots can be switched between Deviance (default) and Pearson. Switching updates all four plots. Deviance residuals are likelihood-based residuals. Pearson residuals standardize the difference between observed and expected values by the variance function and are useful for diagnosing overdispersion. See the glossary for the definitions of the two residual types and the difference between them.
The Four Plots
Residuals vs Fitted
This plot shows the fitted values on the horizontal axis and the residuals on the vertical axis. If the model is adequate, the residuals scatter randomly around zero. A curved pattern suggests an inappropriate link function or a missing nonlinear effect of a predictor. A funnel-shaped pattern suggests that the variance assumption of the chosen family does not match the data.
Normal Q-Q Plot
This plot compares the quantiles of the standardized residuals with theoretical normal quantiles to check normality. It is shown only for the Gaussian family. For other families the residuals are not guaranteed to approach a normal distribution, so the message "This plot is only shown for Gaussian family GLMs." appears instead.
Scale-Location
This plot shows the fitted values on the horizontal axis and the square root of the absolute standardized residuals on the vertical axis. If the variance assumption is adequate, the points scatter evenly in the horizontal direction. An upward trend suggests that the variance function of the chosen family does not match the data.
Residuals vs Leverage
This plot shows the leverage on the horizontal axis and the standardized residuals on the vertical axis, with Cook's Distance contours overlaid (D = 0.5: orange dashed, D = 1.0: red dashed). Leverage measures how far an observation lies from the others in the predictor space. For observations outside the contours, removing that single point may change the estimation results substantially.
Point Selection
Clicking or rectangle-selecting data points on any plot shows the details of the corresponding observations (fitted value, residual, leverage, Cook's Distance, and more) in a table below the plots. The selection state is synchronized across the four plots.
Deviance Goodness-of-Fit
For the Poisson and Binomial families, the GLM Diagnostics tab shows the Deviance/df ratio, the residual deviance divided by the residual degrees of freedom. A ratio near 1 indicates that the variation in the data is consistent with the model's assumption. A ratio much larger than 1 suggests overdispersion; for Poisson data, consider switching to Negative Binomial. See GLM Fundamentals: Variance Functions and Overdispersion for the meaning of overdispersion and the theory behind the diagnosis.
For Binomial models with binary data (one trial per observation), the Deviance/df ratio is not a reliable goodness-of-fit indicator. Evaluate the fit with the diagnostic plots instead.
Prediction
A saved GLM model can be used to predict on new data.

Running Predictions
- Open the Model Detail tab with View Model Details.
- Click Make Predictions to open the GLM Prediction tab.
- Select the dataset to predict on. Only datasets that have the same predictor column names as the fitted model can be selected.
- Configure the output. Output Dataset Name is the name of the result dataset. Include original data controls whether the original columns are included in the result. Confidence Interval Levels and Prediction Interval Levels select interval levels from 90%, 95%, and 99%.
- Run the prediction with Run Prediction.
Prediction Output
The prediction results are saved as a dataset. The results contain the predicted values on the response scale, confidence intervals for the mean response, and prediction intervals for new observations. The confidence interval expresses the uncertainty in estimating the population mean at the given predictor values, while the prediction interval also includes the variability of individual observations.
Most prediction intervals are computed with a plug-in method that does not account for parameter estimation uncertainty, so the intervals can be narrower than they should be for small samples or extrapolation points. See GLM Fundamentals: Confidence and Prediction Intervals for the calculation methods and reference distributions.
Prediction Accuracy Metrics
If the prediction dataset contains the response variable column, accuracy metrics comparing predictions with observations are computed and displayed. The metrics depend on the distribution family. See Prediction Accuracy Metrics for the definition and interpretation of each metric.
| Family | Metrics |
|---|---|
| Gaussian | R², RMSE, MAE |
| Gamma, Poisson, Negative Binomial | RMSE, MAE, Mean Deviance |
| Binomial | Brier Score, AUC |
The Gaussian R² is a predictive R² relative to the mean of the observed values in the prediction dataset itself; when all observed values are identical it cannot be computed and is shown as "-". See Prediction Accuracy Metrics for why Mean Deviance is shown instead of R² for Gamma, Poisson, and Negative Binomial.
For Binomial, when the observations contain only one class, AUC cannot be computed and is shown as "-". For models fitted in the successes-and-trials format, the Brier Score and AUC are weighted by the number of trials, so the prediction dataset must also contain the trials column.
When the selected prediction dataset is the one used to fit the model, a note is shown together with the metrics. In that case the metrics measure the fit to the fitting data itself, and they tend to be more favorable than metrics computed on data that was not used for fitting.
Notes
Using Categorical Variables
GLM accepts only numeric variables. To use categorical (nominal or ordinal scale) or date/datetime variables as predictors, convert them to numeric dummy variables in the Dummy Coding tab before the analysis.
Automatic Exclusion of Missing and Invalid Values
Rows containing missing values (null), non-numeric values, or infinities are automatically excluded from the analysis. The number of excluded rows appears in the Data field of the GLM Diagnostics tab in a form like "after removing 5 incomplete observations". This exclusion is listwise deletion; see Missing Data Mechanisms for the conditions under which it yields valid estimates.
Convergence Issues
If IRLS does not converge, try the following in order: increase Max Iterations, for example from 100 to 500; loosen Convergence Tolerance, for example from 1e-6 to 1e-4; and standardize the predictors. Predictors with widely different magnitudes are a major cause of numerical instability.
If the predictors or the response have extreme ranges, the variance calculation can overflow or become undefined, and the fit fails with an error because the standard errors cannot be computed. Rescale or standardize the variables and refit.
When the condition number of the design matrix exceeds , a warning that the matrix is ill-conditioned appears in the results. Strong correlation between predictors and large scale differences between predictors are the main causes. See Condition Number for the meaning and remedies.
When the number of estimated parameters reaches the number of observations and the residual degrees of freedom become 0 (a saturated model), the behavior depends on the family. For families whose dispersion parameter is estimated from the data (Gaussian, Gamma, and Negative Binomial with a manually specified θ), the dispersion parameter cannot be estimated and the fit is aborted with an error; reduce the number of predictors or add more observations. For the other families the fit completes, but a warning states that the model fits the data perfectly and that goodness-of-fit diagnostics are not meaningful, and AIC is not computed.
When a fitted mean falls outside the valid range of the distribution family, MIDAS does not clamp the value into the range; it aborts the fit and reports an error. Clamping would make the deviance and standard errors describe a different fit than the coefficients. One cause is the combination of link and family: using the Identity link with Poisson or Gamma can produce negative or zero means. In that case, consider a link whose range matches the family, such as Log. The other cause is divergence of the iterations, which is addressed by standardizing the predictors, removing redundant predictors, and increasing the iteration limit.
In logistic regression, if a predictor can perfectly separate the response, the maximum likelihood estimates do not converge to finite values. MIDAS detects separation and shows a warning when the fit completes. With strong separation or the Probit link, fitted probabilities can saturate at 0 or 1 and the fit is aborted with an error; address this by removing the predictor in question, adjusting scales, and checking high-leverage observations. See GLM Fundamentals: Parameter Estimation for the statistical background of separation.
When count data contain an extreme number of zeros, Poisson and Negative Binomial fits can be difficult.
Footnotes
-
Columns that store binary values as booleans are inferred as nominal scale by default and cannot be selected. Changing the scale to interval in the Data Table makes them selectable, with true = 1 and false = 0. ↩
-
The parameter count k in AIC depends on the family. For Poisson and Binomial it is the number of regression coefficients (including the intercept); for Gaussian and Gamma the dispersion parameter is added. For Negative Binomial, θ is counted only when it is estimated automatically; a manually specified θ is not an estimated parameter and is not counted. Keep this difference in mind when comparing the AIC of a θ-estimated model with a θ-fixed model. ↩
Also available as a Markdown file.