Main Content

Fit generalized linear regression model

specifies additional options using one or more name-value arguments. For example, you can
specify `b`

= glmfit(`X`

,`y`

,`distr`

,`Name,Value`

)`'Constant','off'`

to omit the constant term from the model.

`glmfit`

is useful when you simply need the output arguments of the
function or when you want to repeat fitting a model multiple times in a loop. If you need to
investigate a fitted model further, create a generalized linear regression model object `GeneralizedLinearModel`

by using `fitglm`

or `stepwiseglm`

. A
`GeneralizedLinearModel`

object provides more features than
`glmfit`

.

Use the properties of

`GeneralizedLinearModel`

to investigate a fitted model. The object properties include information about the coefficient estimates, summary statistics, fitting method, and input data.Use the object functions of

`GeneralizedLinearModel`

to predict responses and to modify, evaluate, and visualize the generalized linear regression model.You can find the information in the output of

`glmfit`

using the properties and object functions of`GeneralizedLinearModel`

.Output of `glmfit`

Equivalent Values in `GeneralizedLinearModel`

`b`

See the `Estimate`

column of the`Coefficients`

property.`dev`

See the `Deviance`

property.`stats`

See the model display in the Command Window. You can find the statistics in the model properties (

`CoefficientCovariance`

,`Coefficients`

,`Dispersion`

,`DispersionEstimated`

, and`Residuals`

).The dispersion parameter in

of`stats`

.s`glmfit`

is the scale factor for the standard errors of coefficients, whereas the dispersion parameter in the`Dispersion`

property of a generalized linear model is the scale factor for the variance of the response. Therefore,`stats.s`

is the square root of the`Dispersion`

value.

[1] Dobson, A. J. *An Introduction to Generalized
Linear Models*. New York: Chapman & Hall, 1990.

[2] McCullagh, P., and J. A. Nelder. *Generalized
Linear Models*. New York: Chapman & Hall, 1990.

[3] Collett, D. *Modeling Binary Data*. New
York: Chapman & Hall, 2002.

`glmval`

| `regress`

| `regstats`

| `GeneralizedLinearModel`

| `fitglm`

| `stepwiseglm`