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 Analyzing Successes-and-Trials Data with Logistic Regression 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, the progress appears below the form, and Cancel stops the estimation. When the estimation finishes, the Convergence History at the end of the results section lists the deviance and the coefficients at each iteration. Save History as Dataset saves this history as a 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.
The displayed results also stop belonging to the current data when the dataset used for the fit changes after a run. Reloading the dataset, editing cells, and changing an upstream dataset all count as such changes. MIDAS removes the results from the view and shows a message saying the dataset was modified. In this case there is no setting to restore, so run the analysis again to get results for the current data.
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.
Residual Deviance is 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.
In-Sample Prediction Accuracy Metrics
Right after Run, the results show prediction accuracy metrics computed on the fitting data itself, labeled Prediction Accuracy Metrics. The metrics depend on the distribution family and use the same definitions as the prediction accuracy metrics: Gaussian shows R², RMSE, and MAE; Binomial shows the Brier Score and AUC; Gamma, Poisson, and Negative Binomial show RMSE, MAE, and Mean Deviance. See Prediction Accuracy Metrics for the definition and interpretation of each metric.
Because these metrics describe the fit to the data the model was fitted on, a note stating this is always shown. Metrics on data not used for fitting are typically less favorable. To evaluate predictive performance on data not used for fitting, run a prediction against a different dataset.
Some Gaussian metrics use definitions that differ from the Linear Regression tab. The RMSE divides by the number of observations n, while the Linear Regression tab reports the residual standard error, which divides the same residual sum of squares by the residual degrees of freedom n − p, so the two values differ for the same model unless that sum is 0. The R² baseline is the mean of the observed values regardless of whether the model has an intercept, so for no-intercept models it does not match the Linear Regression tab's uncentered R².
When the response's variation is below floating-point precision relative to its magnitude, R², RMSE, and MAE cannot be computed and are shown as "-".
For Binomial models, a ROC curve appears below the metrics when the AUC can be computed. The curve uses the same definition as the ROC curve in prediction results, weighted by trials for the successes-and-trials format. When only one class is observed, the AUC shows "-" and a note appears instead of the curve.
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 |
| VIF | Variance inflation factor, a diagnostic for multicollinearity |
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.
The VIF (variance inflation factor) shows how much the correlation among predictors inflates the estimated variance of each coefficient. MIDAS computes the VIF from the variance-covariance matrix of the coefficients. For GLMs this matrix reflects the estimation weights, so the VIF changes when the family, the link, or the response changes, even for the same set of predictors. See OLS Fundamentals: Multicollinearity and VIF for interpretation.
When the VIF cannot be computed, MIDAS shows "-" for the whole column and states the reason below the coefficient table. A model without an intercept and a singular coefficient correlation matrix get separate wording: the first says that the definition of the VIF does not apply, the second that the predictors are perfectly or almost perfectly linearly dependent. The intercept row is not covered by the VIF and is always "-", with no reason shown.
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.
The display format of each numeric column in the coefficient table can be changed per column. The default is fixed decimal notation. Right-clicking a column header opens presets such as fixed decimals and significant digits. The chosen format is stored in the tab and persists when the model is rerun.
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%, Upper N%, and VIF; 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.
For an observation with leverage 1, neither the standardized residual nor Cook's Distance can be computed. With , the denominator of the standardized residual and the factor of Cook's Distance are both undefined. MIDAS shows these values as "-" and omits the observation from the plots that use standardized residuals. These plots are Scale-Location and Residuals vs Leverage, plus Normal Q-Q for the Gaussian family. Being uncomputable does not mean the observation has little influence; it indicates that the leverage is extreme. Check the leverage column of the diagnostic dataset to find such observations.
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.
When Include original data is on and the selected dataset already has a column with the same name as one the prediction adds (such as glm_predicted), Run Prediction is disabled and the tab shows the colliding names. This keeps the output from having two columns with the same name. To predict on a prediction result again, turn off Include original data or rename the colliding columns.
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.
For Binomial models, when the prediction dataset contains the response variable column (and the trials column for the successes-and-trials format), the results also include observed-outcome columns. Binary responses add a glm_observed column (0/1; boolean responses are mapped to 0/1), and the successes-and-trials format adds a glm_observed_proportion column (successes ÷ trials) and a glm_trials column. These columns are added even when Include original data is off, and support comparing predictions with observations and viewing the ROC curve.
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. Metrics with the same definitions also appear right after fitting (In-Sample Prediction Accuracy Metrics).
| 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. It cannot be computed and is shown as "-" when the spread of the observed values falls below floating-point precision relative to their magnitude, or when the sum of squared errors exceeds the range of double precision. 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.
For Binomial models, the ROC curve appears below the metrics. The curve uses the same definition as the AUC, counting ties as one half and weighting by trials for the successes-and-trials format, so the displayed AUC value equals the area under the curve. When the observations contain only one class, the curve is not shown and a note explains why. When the prediction dataset is the one used to fit the model, the curve, like the metrics, describes the fit to the fitting data. See Prediction Accuracy Metrics for how to read the ROC curve. To build the curve yourself, use the observed-outcome columns in the prediction result dataset with the ROC stat in a Custom Graph.
RMSE, MAE, and Mean Deviance are also shown as "-" when they cannot be computed. RMSE and MAE reach this state when the sum of squared or absolute errors exceeds the range of double precision, and Mean Deviance when a predicted value sits on the boundary of the family's domain and the unit deviance is unbounded.
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.