The GENMOD Procedure

Generalized Linear Models Theory

This is a brief introduction to the theory of generalized linear models.

Response Probability Distributions

In generalized linear models, the response is assumed to possess a probability distribution of the exponential form. That is, the probability density of the response Y for continuous response variables, or the probability function for discrete responses, can be expressed as

\[  f(y) = \exp \left\{  \frac{y\theta - b(\theta )}{a(\phi )} + c(y,\phi ) \right\}   \]

for some functions a, b, and c that determine the specific distribution. For fixed $\phi $, this is a one-parameter exponential family of distributions. The functions a and c are such that $a(\phi ) = \phi / w$ and $c = c(y, \phi / w)$, where w is a known weight for each observation. A variable representing w in the input data set can be specified in the WEIGHT statement. If no WEIGHT statement is specified, $w_ i=1$ for all observations.

Standard theory for this type of distribution gives expressions for the mean and variance of Y:

$\displaystyle  \mr {E}(Y)  $
$\displaystyle  =  $
$\displaystyle  b^{\prime }(\theta )  $
$\displaystyle \mr {Var}(Y)  $
$\displaystyle  =  $
$\displaystyle  \frac{b^{\prime \prime }(\theta ) \phi }{w}  $

where the primes denote derivatives with respect to $\theta $. If $\mu $ represents the mean of Y, then the variance expressed as a function of the mean is

\[  \mr {Var}(Y) = \frac{V(\mu ) \phi }{w} \\  \]

where V is the variance function.

Probability distributions of the response Y in generalized linear models are usually parameterized in terms of the mean $\mu $ and dispersion parameter $\phi $ instead of the natural parameter $\theta $. The probability distributions that are available in the GENMOD procedure are shown in the following list. The zero-inflated Poisson and zero-inflated negative binomial distributions are not generalized linear models. However, the zero-inflated distributions are included in PROC GENMOD since they are useful extensions of generalized linear models. See Long (1997) for a discussion of the zero-inflated Poisson and zero-inflated negative binomial distributions. The PROC GENMOD scale parameter and the variance of Y are also shown.

  • Normal:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{1}{\sqrt {2\pi } \sigma } \exp \left[ -\frac{1}{2} \left( \frac{y-\mu }{\sigma } \right)^2 \right]~ ~ ~  \mbox{for } -\infty < y < \infty  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  \sigma ^{2}  $
    $\displaystyle \mr {scale}  $
    $\displaystyle  =  $
    $\displaystyle  \sigma  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \sigma ^{2}  $
  • Inverse Gaussian:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{1}{\sqrt {2\pi y^3} \sigma } \exp \left[ -\frac{1}{2y} \left( \frac{y-\mu }{\mu \sigma } \right)^2 \right]~ ~ ~  \mbox{for } 0 < y < \infty  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  \sigma ^2  $
    $\displaystyle \mr {scale}  $
    $\displaystyle  =  $
    $\displaystyle  \sigma  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \sigma ^2 \mu ^3  $
  • Gamma:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{1}{\Gamma (\nu )y} \left( \frac{y\nu }{\mu } \right)^{\nu } \exp \left(-\frac{y \nu }{\mu } \right)~ ~ ~  \mbox{for } 0 < y < \infty  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  \nu ^{-1}  $
    $\displaystyle \mr {scale}  $
    $\displaystyle  =  $
    $\displaystyle  \nu  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{\mu ^2}{\nu }  $
  • Geometric: This is a special case of the negative binomial with k = 1.

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{(\mu )^ y}{(1+\mu )^{y+1}}~ ~ ~  \mbox{for } y = 0,1,2,\ldots  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \mu (1+\mu )  $
  • Negative binomial:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{\Gamma (y+1/k)}{\Gamma (y+1)\Gamma (1/k)} \frac{(k\mu )^ y}{(1+k\mu )^{y+1/k}}~ ~ ~  \mbox{for } y = 0,1,2,\ldots  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
    $\displaystyle \mr {dispersion}  $
    $\displaystyle  =  $
    $\displaystyle  k  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \mu + k\mu ^2  $
  • Poisson:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{\mu ^ y \mr {e}^{-\mu }}{y!}~ ~ ~  \mbox{for } y = 0,1,2,\ldots  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \mu  $
  • Binomial:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  {\left( \begin{array}{c}n \cr r\end{array}\right) } \mu ^ r (1-\mu )^{n-r}~ ~ ~  \mbox{for } y=\frac{r}{n}, ~  r=0,1, 2,\ldots ,n  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{\mu (1-\mu )}{n}  $
  • Multinomial:

    $\displaystyle  f(y_1, y_2,\cdots ,y_ k)  $
    $\displaystyle  =  $
    $\displaystyle  \frac{m!}{y_1! y_2! \cdots y_ k!}p_1^{y_1} p_2^{y_2} \cdots p_ k^{y_ k}  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
  • Zero-inflated Poisson:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \left\{  \begin{array}{l} \omega + (1-\omega )\mr {e}^{-\lambda }~ ~ ~ \mbox{for } y=0 \\ (1-\omega )\frac{\lambda ^ y \mr {e}^{-\lambda }}{y!}~ ~ ~ \mbox{for } y = 1,2,\ldots \\ \end{array} \right.  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
    $\displaystyle \mu = \mr {E}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  (1-\omega )\lambda  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  (1-\omega )\lambda (1+\omega \lambda )  $
    $\displaystyle  $
    $\displaystyle  =  $
    $\displaystyle  \mu + \frac{\omega }{1-\omega }\mu ^2  $
  • Zero-inflated negative binomial:

    $\displaystyle  f(y)  $
    $\displaystyle  =  $
    $\displaystyle  \left\{  \begin{array}{l} \omega + (1-\omega )(1+k\lambda )^{-\frac{1}{k}}~ ~ ~ \mbox{for } y=0 \\ (1-\omega ) \frac{\Gamma (y+1/k)}{\Gamma (y+1)\Gamma (1/k)} \frac{(k\lambda )^ y}{(1+k\lambda )^{y+1/k}} ~ ~ ~ \mbox{for } y = 1,2,\ldots \\ \end{array} \right.  $
    $\displaystyle \phi  $
    $\displaystyle  =  $
    $\displaystyle  1  $
    $\displaystyle \mr {dispersion}  $
    $\displaystyle  =  $
    $\displaystyle  k  $
    $\displaystyle \mu = \mr {E}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  (1-\omega )\lambda  $
    $\displaystyle \mr {Var}(Y)  $
    $\displaystyle  =  $
    $\displaystyle  (1-\omega )\lambda (1+\omega \lambda + k\lambda )  $
    $\displaystyle  $
    $\displaystyle  =  $
    $\displaystyle  \mu + \left(\frac{\omega }{1-\omega }+\frac{k}{1-\omega }\right)\mu ^2  $

The negative binomial and the zero-inflated negative binomial distributions contain a parameter k, called the negative binomial dispersion parameter. This is not the same as the generalized linear model dispersion $\phi $, but it is an additional distribution parameter that must be estimated or set to a fixed value.

For the binomial distribution, the response is the binomial proportion $Y = \mi {events}/\mi {trials}$. The variance function is $V(\mu ) = \mu (1-\mu )$, and the binomial trials parameter n is regarded as a weight w.

If a weight variable is present, $\phi $ is replaced with $\phi /w$, where w is the weight variable.

PROC GENMOD works with a scale parameter that is related to the exponential family dispersion parameter $\phi $ instead of working with $\phi $ itself. The scale parameters are related to the dispersion parameter as shown previously with the probability distribution definitions. Thus, the scale parameter output in the Analysis of Parameter Estimates table is related to the exponential family dispersion parameter. If you specify a constant scale parameter with the SCALE= option in the MODEL statement, it is also related to the exponential family dispersion parameter in the same way.

Log-Likelihood Functions

Log-likelihood functions for the distributions that are available in the procedure are parameterized in terms of the means $\mu _ i$ and the dispersion parameter $\phi $. Zero-inflated log likelihoods are parameterized in terms two parameters, $\lambda $ and $\omega $. The parameter $\omega $ is the zero-inflation probability, and $\lambda $ is a function of the distribution mean. The relationship between the mean of the zero-inflated Poisson and zero-inflated negative binomial distributions and the parameter $\lambda $ is defined in the section Response Probability Distributions. The term $y_ i$ represents the response for the ith observation, and $w_ i$ represents the known dispersion weight. The log-likelihood functions are of the form

\[  L(\mb {y},\bmu , \phi ) = \sum _ i \log \left( f(y_ i,\mu _ i,\phi ) \right)  \]

where the sum is over the observations. The forms of the individual contributions

\[  l_ i = \log \left( f(y_ i,\mu _ i ,\phi ) \right)  \]

are shown in the following list; the parameterizations are expressed in terms of the mean and dispersion parameters.

For the discrete distributions (binomial, multinomial, negative binomial, and Poisson), the functions computed as the sum of the $l_ i$ terms are not proper log-likelihood functions, since terms involving binomial coefficients or factorials of the observed counts are dropped from the computation of the log likelihood, and a dispersion parameter $\phi $ is included in the computation. Deletion of factorial terms and inclusion of a dispersion parameter do not affect parameter estimates or their estimated covariances for these distributions, and this is the function used in maximum likelihood estimation. The value of $\phi $ used in computing the reported log-likelihood function is either the final estimated value, or the fixed value, if the dispersion parameter is fixed. Even though it is not a proper log-likelihood function in all cases, the function computed as the sum of the $l_ i$ terms is reported in the output as the log likelihood. The proper log-likelihood function is also computed as the sum of the $\mathit{ll}_ i$ terms in the following list, and it is reported as the full log likelihood in the output.

  • Normal:

    \[  \mathit{ll}_ i = l_ i = -\frac{1}{2} \left[ \frac{w_ i(y_ i-\mu _ i)^2}{\phi } + \log \left( \frac{\phi }{w_ i} \right) + \log (2 \pi ) \right]  \]
  • Inverse Gaussian:

    \[  \mathit{ll}_ i = l_ i = -\frac{1}{2} \left[ \frac{w_ i(y_ i-\mu _ i)^2}{y_ i \mu ^2 \phi } + \log \left( \frac{\phi y_ i^3}{w_ i} \right) + \log (2 \pi ) \right]  \]
  • Gamma:

    \[  \mathit{ll}_ i = l_ i = \frac{w_ i}{\phi } \log \left( \frac{w_ i y_ i}{\phi \mu _ i} \right) - \frac{w_ i y_ i}{\phi \mu _ i} - \log (y_ i) - \log \left( \Gamma \left( \frac{w_ i}{\phi } \right) \right)  \]
  • Negative binomial:

    \[  l_ i = y_ i\log \left(\frac{k\mu }{w_ i} \right) - (y_ i+w_ i/k)\log \left(1+\frac{k\mu }{w_ i} \right) + \log \left(\frac{\Gamma (y_ i+w_ i/k)}{\Gamma (w_ i/k)}\right)  \]
    \[  \mathit{ll}_ i = y_ i\log \left(\frac{k\mu }{w_ i} \right) - (y_ i+w_ i/k)\log \left(1+\frac{k\mu }{w_ i} \right) + \log \left(\frac{\Gamma (y_ i+w_ i/k)}{\Gamma (y_ i+1)\Gamma (w_ i/k)}\right)  \]
  • Poisson:

    \[  l_ i = \frac{w_ i}{\phi }[y_ i \log (\mu _ i) - \mu _ i]  \]
    \[  \mathit{ll}_ i = w_ i[y_ i \log (\mu _ i) - \mu _ i - \log (y_ i!) ]  \]
  • Binomial:

    \[  l_ i = \frac{w_ i}{\phi }[r_ i \log (p_ i) + (n_ i-r_ i) \log (1-p_ i)]  \]
    \[  \mathit{ll}_ i = w_ i[\log \left( \begin{array}{c} n_ i \\ r_ i \end{array} \right) + r_ i \log (p_ i) + (n_ i-r_ i) \log (1-p_ i)]  \]
  • Multinomial (k categories):

    \[  l_ i = \frac{w_ i}{\phi }\sum _{j=1}^ k y_{ij}\log (\mu _{ij})  \]
    \[  \mathit{ll}_ i = w_ i[\log (m_ i!)+\sum _{j=1}^ k (y_{ij}\log (\mu _{ij})-\log (y_{ij}!))]  \]
  • Zero-inflated Poisson:

    \[  l_ i = \mathit{ll}_ i = \left\{  \begin{array}{ll} w_ i\log [\omega _ i + (1-\omega _ i)\exp (-\lambda _ i)] &  y_ i=0 \\ w_ i[\log (1-\omega _ i)+y_ i \log (\lambda _ i) - \lambda _ i-\log (y_ i!)] &  y_ i>0 \\ \end{array} \right.  \]
  • Zero-inflated negative binomial:

    \[  l_ i = \mathit{ll}_ i = \left\{  \begin{array}{ll} \log [\omega _ i + (1-\omega _ i)(1+\frac{k}{w_ i}\lambda )^{-\frac{1}{k}}] &  y_ i=0 \\ \log (1-\omega _ i)+ y_ i\log \left(\frac{k\lambda }{w_ i} \right) & \\ -(y_ i+\frac{w_ i}{k})\log \left(1+\frac{k\lambda }{w_ i} \right) & \\ +\log \left(\frac{\Gamma (y_ i+\frac{w_ i}{k})}{\Gamma (y_ i+1)\Gamma (\frac{w_ i}{k})}\right) &  y_ i>0 \\ \end{array} \right.  \]

Maximum Likelihood Fitting

The GENMOD procedure uses a ridge-stabilized Newton-Raphson algorithm to maximize the log-likelihood function $L(\mb {y},\bmu , \phi )$ with respect to the regression parameters. By default, the procedure also produces maximum likelihood estimates of the scale parameter as defined in the section Response Probability Distributions for the normal, inverse Gaussian, negative binomial, and gamma distributions.

On the rth iteration, the algorithm updates the parameter vector ${\bbeta }_{r}$ with

\[  {\bbeta }_{r+1} = {\bbeta }_{r} - \mb {H}^{-1}\mb {s}  \]

where $\mb {H}$ is the Hessian (second derivative) matrix, and $\mb {s}$ is the gradient (first derivative) vector of the log-likelihood function, both evaluated at the current value of the parameter vector. That is,

\[  \mb {s} = [s_ j] = \left[ \frac{\partial L}{\partial \beta _ j} \right]  \]

and

\[  \mb {H} = [{h_{ij}}] = \left[ \frac{\partial ^2 L}{\partial \beta _ i\partial \beta _ j} \right]  \]

In some cases, the scale parameter is estimated by maximum likelihood. In these cases, elements corresponding to the scale parameter are computed and included in $\mb {s}$ and $\mb {H}$.

If $\eta _ i = \mb {x}_ i^\prime \bbeta $ is the linear predictor for observation i and g is the link function, then $\eta _ i = g(\mu _ i)$, so that $\mu _ i = g^{-1}(\mb {x}_ i^\prime \bbeta )$ is an estimate of the mean of the ith observation, obtained from an estimate of the parameter vector $\bbeta $.

The gradient vector and Hessian matrix for the regression parameters are given by

$\displaystyle  \Strong{s}  $
$\displaystyle  =  $
$\displaystyle  \sum _ i \frac{w_ i (y_ i - \mu _ i)\Strong{x}_ i}{V(\mu _ i) g^{\prime }(\mu _ i) \phi }  $
$\displaystyle \Strong{H}  $
$\displaystyle  =  $
$\displaystyle  -\Strong{X}^{\prime }\Strong{W}_ o \Strong{X}  $

where $\mb {X}$ is the design matrix, $\mb {x}_ i$ is the transpose of the ith row of X, and V is the variance function. The matrix $\mb {W}_ o$ is diagonal with its ith diagonal element

\[  w_{oi} = w_{ei} + w_ i(y_ i - \mu _ i) \frac{V(\mu _ i)g^{\prime \prime }(\mu _ i) + V^{\prime }(\mu _ i)g^{\prime }(\mu _ i)}{(V(\mu _ i))^2 (g^{\prime }(\mu _ i))^3 \phi }  \]

where

\[  w_{ei} = \frac{w_ i}{\phi V(\mu _ i)(g^{\prime }(\mu _ i))^2}  \]

The primes denote derivatives of g and V with respect to $\mu $. The negative of $\mb {H}$ is called the observed information matrix. The expected value of $\mb {W}_ o$ is a diagonal matrix $\mb {W}_ e$ with diagonal values $w_{ei}$. If you replace $\mb {W}_ o$ with $\mb {W}_ e$, then the negative of $\mb {H}$ is called the expected information matrix. $\mb {W}_ e$ is the weight matrix for the Fisher scoring method of fitting. Either $\mb {W}_ o$ or $\mb {W}_ e$ can be used in the update equation. The GENMOD procedure uses Fisher scoring for iterations up to the number specified by the SCORING option in the MODEL statement, and it uses the observed information matrix on additional iterations.

Covariance and Correlation Matrix

The estimated covariance matrix of the parameter estimator is given by

\[  \bSigma = -\mb {H}^{-1}  \]

where $\mb {H}$ is the Hessian matrix evaluated using the parameter estimates on the last iteration. Note that the dispersion parameter, whether estimated or specified, is incorporated into $\mb {H}$. Rows and columns corresponding to aliased parameters are not included in $\bSigma $.

The correlation matrix is the normalized covariance matrix. That is, if $\sigma _{ij}$ is an element of $\bSigma $, then the corresponding element of the correlation matrix is $\sigma _{ij}/\sigma _ i\sigma _{j}$, where $\sigma _ i = \sqrt {\sigma _{ii}}$.

Goodness of Fit

Two statistics that are helpful in assessing the goodness of fit of a given generalized linear model are the scaled deviance and Pearson’s chi-square statistic. For a fixed value of the dispersion parameter $\phi $, the scaled deviance is defined to be twice the difference between the maximum achievable log likelihood and the log likelihood at the maximum likelihood estimates of the regression parameters.

Note that these statistics are not valid for GEE models.

If $l(\mb {y}, \bmu )$ is the log-likelihood function expressed as a function of the predicted mean values $\bmu $ and the vector $\mb {y}$ of response values, then the scaled deviance is defined by

\[  D^*(\mb {y}, \bmu ) = 2(l(\mb {y},\mb {y}) - l(\mb {y}, \bmu ))  \]

For specific distributions, this can be expressed as

\[  D^*(\mb {y}, \bmu ) = \frac{D(\mb {y}, \bmu )}{\phi }  \]

where D is the deviance. The following table displays the deviance for each of the probability distributions available in PROC GENMOD. The deviance cannot be directly calculated for zero-inflated models. Twice the negative of the log likelihood is reported instead of the proper deviance for the zero-inflated Poisson and zero-inflated negative binomial.

Distribution

Deviance

Normal

$\sum _ i w_ i (y_ i - \mu _ i)^2$

Poisson

$2\sum _ i w_ i \left[ y_ i \log \left( \frac{y_ i}{\mu _ i} \right) - (y_ i - \mu _ i) \right] $

Binomial

$2\sum _ i w_ i m_ i \left[ y_ i \log \left( \frac{y_ i}{\mu _ i} \right) + (1-y_ i) \log \left( \frac{1-y_ i}{1-\mu _ i} \right) \right]$

Gamma

$2\sum _ i w_ i \left[ -\log \left( \frac{y_ i}{\mu _ i} \right) + \frac{y_ i - \mu _ i}{\mu _ i} \right]$

Inverse Gaussian

$ \sum _ i \frac{w_ i(y_ i - \mu _ i)^2}{\mu ^2_ i y_ i}$

Multinomial

$ \sum _ i\sum _ j w_ i y_{ij}\log \left(\frac{y_{ij}}{p_{ij}m_ i}\right) $

Negative binomial

$ 2\sum _ i \left[ y\log (y/\mu ) - (y+w_ i/k)\log \left(\frac{y+w_ i/k}{\mu +w_ i/k}\right)\right]$

Zero-inflated Poisson

$ -2\sum _ i\left\{  \begin{array}{ll} w_ i\log [\omega _ i + (1-\omega _ i)\exp (-\mu _ i)] &  y_ i=0 \\ w_ i[\log (1-\omega _ i)+y_ i \log (\mu _ i) - & \\ \mu _ i-\log (y_ i!)] &  y_ i>0 \\ \end{array} \right. $

Zero-inflated negative binomial

$ -2\sum _ i\left\{  \begin{array}{lll} \log [\omega _ i + (1-\omega _ i)(1+\frac{k}{w_ i}\lambda )] &  y_ i=0 \\ \log (1-\omega _ i)+ y_ i\log \left(\frac{k\lambda }{w_ i} \right) - & \\ (y_ i+\frac{w_ i}{k})\log \left(1+\frac{k\lambda }{w_ i} \right) + & \\ \log \left(\frac{\Gamma (y_ i+\frac{w_ i}{k})}{\Gamma (y_ i+1)\Gamma (\frac{w_ i}{k})}\right) &  y_ i>0 \\ \end{array} \right. $

In the binomial case, $y_ i=r_ i/m_ i$, where $r_ i$ is a binomial count and $m_ i$ is the binomial number of trials parameter.

In the multinomial case, $y_{ij}$ refers to the observed number of occurrences of the jth category for the ith subpopulation defined by the AGGREGATE= variable, $m_ i$ is the total number in the ith subpopulation, and $p_{ij}$ is the category probability.

Pearson’s chi-square statistic is defined as

\[  X^2 = \sum _ i \frac{w_ i( y_ i - \mu _ i)^2}{V(\mu _ i)}  \]

and the scaled Pearson’s chi-square is $X^2 / \phi $.

The scaled version of both of these statistics, under certain regularity conditions, has a limiting chi-square distribution, with degrees of freedom equal to the number of observations minus the number of parameters estimated. The scaled version can be used as an approximate guide to the goodness of fit of a given model. Use caution before applying these statistics to ensure that all the conditions for the asymptotic distributions hold. McCullagh and Nelder (1989) advise that differences in deviances for nested models can be better approximated by chi-square distributions than the deviances can themselves.

In cases where the dispersion parameter is not known, an estimate can be used to obtain an approximation to the scaled deviance and Pearson’s chi-square statistic. One strategy is to fit a model that contains a sufficient number of parameters so that all systematic variation is removed, estimate $\phi $ from this model, and then use this estimate in computing the scaled deviance of submodels. The deviance or Pearson’s chi-square divided by its degrees of freedom is sometimes used as an estimate of the dispersion parameter $\phi $. For example, since the limiting chi-square distribution of the scaled deviance $D^* = D / \phi $ has $n-p$ degrees of freedom, where n is the number of observations and p is the number of parameters, equating $D^*$ to its mean and solving for $\phi $ yields $\hat{\phi } = D/(n-p)$. Similarly, an estimate of $\phi $ based on Pearson’s chi-square $X^2$ is $\hat{\phi } = X^2/(n-p)$. Alternatively, a maximum likelihood estimate of $\phi $ can be computed by the procedure, if desired. See the discussion in the section Type 1 Analysis for more about the estimation of the dispersion parameter.

Other Fit Statistics

The Akaike information criterion (AIC) is a measure of goodness of model fit that balances model fit against model simplicity. AIC has the form

\[  \mr {AIC} = -2\mr {LL} + 2p  \]

where p is the number of parameters estimated in the model, and LL is the log likelihood evaluated at the value of the estimated parameters. An alternative form is the corrected AIC given by

\[  \mr {AICC} = -2\mr {LL} + 2p\frac{n}{n-p-1}  \]

where n is the total number of observations used.

The Bayesian information criterion (BIC) is a similar measure. BIC is defined by

\[  \mr {BIC} = -2\mr {LL} + p\log (n)  \]

See Akaike (1981, 1979) for details of AIC and BIC. See Simonoff (2003) for a discussion of using AIC, AICC, and BIC with generalized linear models. These criteria are useful in selecting among regression models, with smaller values representing better model fit. PROC GENMOD uses the full log likelihoods defined in the section Log-Likelihood Functions, with all terms included, for computing all of the criteria.

Dispersion Parameter

There are several options available in PROC GENMOD for handling the exponential distribution dispersion parameter. The NOSCALE and SCALE options in the MODEL statement affect the way in which the dispersion parameter is treated. If you specify the SCALE=DEVIANCE option, the dispersion parameter is estimated by the deviance divided by its degrees of freedom. If you specify the SCALE=PEARSON option, the dispersion parameter is estimated by Pearson’s chi-square statistic divided by its degrees of freedom.

Otherwise, values of the SCALE and NOSCALE options and the resultant actions are displayed in the following table.

NOSCALE

SCALE=value

Action

Present

Present

Scale fixed at value

Present

Not present

Scale fixed at 1

Not present

Not present

Scale estimated by ML

Not present

Present

Scale estimated by ML,

   

  starting point at value

Present (negative binomial)

Not present

k fixed at 0

The meaning of the scale parameter displayed in the Analysis Of Parameter Estimates table is different for the gamma distribution than for the other distributions. The relation of the scale parameter as used by PROC GENMOD to the exponential family dispersion parameter $\phi $ is displayed in the following table. For the binomial and Poisson distributions, $\phi $ is the overdispersion parameter, as defined in the Overdispersion section, which follows.

Distribution

Scale

Normal

$\sqrt {\phi }$

Inverse Gaussian

$\sqrt {\phi }$

Gamma

$1/\phi $

Binomial

$\sqrt {\phi }$

Poisson

$\sqrt {\phi }$

In the case of the negative binomial distribution, PROC GENMOD reports the dispersion parameter estimated by maximum likelihood. This is the negative binomial parameter k defined in the section Response Probability Distributions.

Overdispersion

Overdispersion is a phenomenon that sometimes occurs in data that are modeled with the binomial or Poisson distributions. If the estimate of dispersion after fitting, as measured by the deviance or Pearson’s chi-square, divided by the degrees of freedom, is not near 1, then the data might be overdispersed if the dispersion estimate is greater than 1 or underdispersed if the dispersion estimate is less than 1. A simple way to model this situation is to allow the variance functions of these distributions to have a multiplicative overdispersion factor $\phi $:

  • Binomial: $V(\mu ) = \phi \mu (1-\mu )$

  • Poisson: $V(\mu ) = \phi \mu $

An alternative method to allow for overdispersion in the Poisson distribution is to fit a negative binomial distribution, where $V(\mu ) = \mu + k\mu ^2$, instead of the Poisson. The parameter k can be estimated by maximum likelihood, thus allowing for overdispersion of a specific form. This is different from the multiplicative overdispersion factor $\phi $, which can accommodate many forms of overdispersion.

The models are fit in the usual way, and the parameter estimates are not affected by the value of $\phi $. The covariance matrix, however, is multiplied by $\phi $, and the scaled deviance and log likelihoods used in likelihood ratio tests are divided by $\phi $. The profile likelihood function used in computing confidence intervals is also divided by $\phi $. If you specify a WEIGHT statement, $\phi $ is divided by the value of the WEIGHT variable for each observation. This has the effect of multiplying the contributions of the log-likelihood function, the gradient, and the Hessian by the value of the WEIGHT variable for each observation.

The SCALE= option in the MODEL statement enables you to specify a value of $\sigma = \sqrt {\phi }$ for the binomial and Poisson distributions. If you specify the SCALE=DEVIANCE option in the MODEL statement, the procedure uses the deviance divided by degrees of freedom as an estimate of $\phi $, and all statistics are adjusted appropriately. You can use Pearson’s chi-square instead of the deviance by specifying the SCALE=PEARSON option.

The function obtained by dividing a log-likelihood function for the binomial or Poisson distribution by a dispersion parameter is not a legitimate log-likelihood function. It is an example of a quasi-likelihood function. Most of the asymptotic theory for log likelihoods also applies to quasi-likelihoods, which justifies computing standard errors and likelihood ratio statistics by using quasi-likelihoods instead of proper log likelihoods. For details on quasi-likelihood functions, see McCullagh and Nelder (1989, Chapter 9), McCullagh (1983); Hardin and Hilbe (2003).

Although the estimate of the dispersion parameter is often used to indicate overdispersion or underdispersion, this estimate might also indicate other problems such as an incorrectly specified model or outliers in the data. You should carefully assess whether this type of model is appropriate for your data.