Skip to main content
v2026.11,986 entries · CC-BY 4.0

PROC GENMOD in SAS: Syntax, Models and Output

How to fit generalized linear models with PROC GENMOD in SAS: DIST and LINK pairings, a worked Poisson run, reading the output, GEE and overdispersion.

Written and maintained by CASRAI Editorial Board

Published

On this page

PROC GENMOD is the SAS/STAT procedure that fits generalized linear models: regression models in which the mean of the response depends on a linear predictor through a link function and the response can follow any distribution from the exponential family. You choose the distribution with DIST= and the link with LINK= on the MODEL statement, and the same procedure can also fit correlated data by generalized estimating equations (the REPEATED statement) and run Bayesian analyses (the BAYES statement).

This guide shows the minimum syntax, a complete Poisson-with-offset run taken from the SAS documentation, how to read each output table, the options that handle overdispersion and repeated measures, and what to use if SAS is not available. All SAS syntax follows the SAS/STAT User’s Guide (release 9.4 documentation set, page dates February 2025).

What PROC GENMOD is used for in research

PROC GENMOD fits generalized linear models as defined by Nelder and Wedderburn (1972). The SAS documentation lists the model families that fall under this definition: classical linear models with normal errors, logistic and probit models for binary data, and log-linear models for multinomial data. In research practice that covers count outcomes (events, lesions, claims, admissions), binary outcomes (response or no response), positive continuous outcomes, and rates when you add an offset.

Two further uses matter for study data. First, GENMOD can fit models to correlated responses by the GEE method introduced by Liang and Zeger (1986), which is the route for repeated measurements on the same subject when the responses are discrete. The documentation notes that GEE models are not available for the zero-inflated distributions. Second, a BAYES statement requests Bayesian analysis of the generalized linear model, with Markov chain Monte Carlo sampling.

If your outcome is continuous and normal with random effects, a different procedure fits better; see PROC MIXED in SAS, and for random effects with non-normal outcomes see generalized linear mixed models. For the wider picture of what the SAS statistical procedures cover, see the SAS statistical software platform guide.

How to install or access PROC GENMOD

PROC GENMOD belongs to SAS/STAT, and its documentation lives in the SAS/STAT User’s Guide. You run it wherever your SAS session has SAS/STAT licensed, which is how institutions typically provide it, through their own SAS installation or SAS server. There is nothing to load inside a program: the procedure is invoked by name, so a session that has SAS/STAT can run proc genmod immediately.

If you do not have a local installation, SAS describes SAS OnDemand for Academics as a cloud-based learning environment in which students, educators and independent learners use SAS Studio to perform statistical analysis without installing or managing software locally. The same SAS page lists the Studio edition as the choice for using SAS on Windows, a Mac or Linux. Check with your institution’s research computing group which SAS products and SAS/STAT components it has licensed for research (as distinct from teaching) work.

How to fit a model with PROC GENMOD step by step

The documentation’s own Poisson regression example is the clearest end-to-end run. It models insurance claim counts classified by car type and age group, with the number of policyholders as an exposure. The same structure applies to any count outcome observed over unequal exposure, such as events per person-year.

  1. Prepare the data. Create the response, the explanatory variables, and, for a rate model, the log of the exposure. The documentation example is: data insure; input n c car$ age; ln = log(n); datalines; 500 42 small 1 / 1200 37 medium 1 / 100 1 large 1 / 400 101 small 2 / 500 73 medium 2 / 300 14 large 2 ; run; where n is policyholders, c is claims, car is car type and age is age group (one row per line in the actual data step).
  2. Start the procedure. Write proc genmod data=insure;. The DATA= option names the input data set.
  3. Declare classification variables. class car age; makes GENMOD generate indicator variables automatically. Any categorical explanatory variable must appear in CLASS before it is used in MODEL.
  4. Write the MODEL statement. model c = car age / dist=poisson link=log offset=ln;. The response is on the left of the equals sign, the effects on the right, and the options after the slash. An intercept is included by default; NOINT removes it.
  5. Run it. End with run;. For tests of each effect, add type1 type3 to the MODEL options.

The documentation’s full statement sequence is therefore: proc genmod data=insure; class car age; model c = car age / dist=poisson link=log offset=ln; run;. The offset variable cannot be a CLASS variable, the response, or one of the explanatory variables. Here the offset ln normalizes the fitted cell means to a per-policyholder basis, because only total claims per cell are observed.

If you give DIST= without LINK=, GENMOD uses a default link for that distribution; if you give neither, it fits a normal distribution with the identity link. The data table below sets out each DIST= keyword with its default link in SAS, beside the closest function in R’s stats family documentation. The valid LINK= keywords are CUMCLL, CUMLOGIT, CUMPROBIT, CLOGLOG, IDENTITY, LOG, LOGIT, PROBIT and POWER(number); the cumulative links are appropriate only for the multinomial distribution.

Common options on the MODEL statement

  • TYPE1 and TYPE3 request Type 1 and Type 3 analyses. WALD adds Wald statistics for the Type 3 contrasts.
  • WALDCI computes Wald confidence intervals. LRCI computes profile-likelihood intervals instead; the documentation describes the Wald intervals as faster but thought to be less accurate, especially for small samples.
  • EVENT='1' in parentheses after a binary response sets which level is modeled. By default GENMOD models the first-ordered category, so with a 0/1 response it would model the probability of 0 unless you set EVENT='1'. You can write model Y(event='1') = Exposure;.
  • events/trials on the left side fits summarized binomial data; use it only when each row holds counts of events and trials.
  • ALPHA= sets the confidence coefficient to 1 minus the number given; the default is 0.05.

How to read the PROC GENMOD output

The Poisson example produces, by default, a Model Information table, a Class Level Information table, a goodness-of-fit table and the parameter estimates; adding TYPE1 and TYPE3 produces the effect tests. The figures below are the values the SAS documentation reports for that run.

Model Information and Class Level Information

Model Information confirms what you actually asked for: the data set (WORK.INSURE), the distribution (Poisson), the link function (Log), the dependent variable (c) and the offset variable (ln). Read it first, because a mis-specified DIST= or LINK= shows up here. Class Level Information lists each CLASS variable’s levels and their order. For the character variable car the levels are sorted alphabetically (large, medium, small), which is the default sort; the ORDER= option in the PROC GENMOD statement changes it.

Criteria For Assessing Goodness Of Fit

The documentation reports a deviance of 2.8207 on 2 degrees of freedom (value/DF 1.4103) and a Pearson chi-square of 2.8416 (value/DF 1.4208), along with AIC, AICC and BIC. Comparing the deviance with a chi-square distribution on 2 degrees of freedom gives a p-value of 0.24, which the documentation reads as the model fitting the data reasonably well. Value/DF near 1 is also the quick check for overdispersion in Poisson and binomial models, discussed below.

Analysis Of Maximum Likelihood Parameter Estimates

Each row gives an estimate on the link scale, a standard error, Wald 95% confidence limits, a Wald chi-square and its p-value. In the example the estimates are: Intercept -1.3168, car large -1.7643, car medium -0.6928, car small 0 (the reference level), age 1 -1.3199 and age 2 0 (reference). A zero estimate with zero degrees of freedom and a standard error of 0 marks the reference level; the same display is how GENMOD flags an aliased column, a column linearly dependent on earlier ones.

Because the link is log, exponentiating a coefficient gives a rate ratio against the reference level. Working that out from the documented estimates (our own arithmetic, not a figure in the manual): large cars show exp(-1.7643) ≈ 0.17 times the claim rate of small cars, medium cars exp(-0.6928) ≈ 0.50 times, and age group 1 exp(-1.3199) ≈ 0.27 times the rate of age group 2, each holding the other factor fixed.

The table also contains a Scale row of 1.0000 with a note that the scale parameter was held fixed. The Poisson distribution has no free scale parameter, so this is expected unless you request an overdispersion adjustment.

Type 1 and Type 3 analyses

In the documented example the Type 1 table shows the deviance for the model with each effect and its predecessors: 175.1536 for the intercept alone, 107.4620 after adding car (chi-square 67.69 on 2 degrees of freedom, p below .0001) and 2.8207 after adding age (chi-square 104.64 on 1 degree of freedom, p below .0001). The Type 3 table tests each effect given the others: car 72.82 on 2 degrees of freedom and age 104.64 on 1, both p below .0001. Type 3 likelihood-ratio statistics are the default; the documentation says the score statistic is the default for GEE models, and WALD adds Wald versions.

How do I handle overdispersion?

Binomial and Poisson distributions have no free scale parameter, so SAS lets you fix one yourself. SCALE=DEVIANCE (also DSCALE) sets the dispersion to the deviance divided by the degrees of freedom after estimation, and SCALE=PEARSON (also PSCALE) uses Pearson chi-square divided by the degrees of freedom; standard errors and likelihood-ratio statistics are adjusted accordingly. When quasi-likelihood scaling is not what you want, fit a distribution with its own dispersion parameter: DIST=NEGBIN is a built-in option, and the negative binomial regression guide compares the approaches.

How do I analyze repeated measures with GEE?

Add a REPEATED statement. The documentation’s example fits a logistic model for wheezing status in 16 children measured at ages 9 to 12: proc genmod data=six; class case city; model wheeze(event='1') = city age smoke / dist=bin; repeated subject=case / type=exch covb corrw; run;. SUBJECT= names the subject variable, which must be listed in CLASS; TYPE=EXCH requests an exchangeable working correlation; COVB prints the parameter covariance matrix; CORRW prints the final working correlation. The GEE output reports empirical standard errors by default, and the MODELSE option adds model-based ones. The documentation cautions that statistics from the initial model fit (deviances, Pearson chi-squares) do not apply to the GEE model. For choosing a working correlation and deciding between GEE and a mixed model, see the generalized estimating equations guide.

Troubleshooting PROC GENMOD

  • The model is for the wrong response level. The default event level is the first-ordered category. Set EVENT='1' (or DESCENDING) explicitly.
  • A categorical variable is treated as numeric. Classification variables must be declared in CLASS; otherwise they enter as continuous covariates.
  • A parameter shows 0 degrees of freedom and zero standard error. That is the reference level or an aliased (linearly dependent) column; check the design for redundant variables.
  • The reference level is not the one you wanted. Levels follow ORDER= in the PROC GENMOD statement; the default is ORDER=FORMATTED, whose sort order is machine-dependent, so state it explicitly.
  • Convergence difficulty. The INITIAL= option sets starting values for the parameters, and the documentation points to it for convergence problems. ITPRINT displays the iteration history.
  • Standard errors look too small for count data. Check value/DF in the goodness-of-fit table, then apply SCALE=, a negative binomial distribution, or a model for correlated data.
  • The offset is rejected. The variable named in OFFSET= cannot be a CLASS variable, the response, or an explanatory variable. Create a separate log-exposure variable in the data step.

Free alternatives to PROC GENMOD

Both alternatives below are open-source projects whose own documentation describes generalized linear model fitting. The table lists only what those pages state.

Tool Function What its documentation states
R (stats package) glm() Fits generalized linear models specified by a symbolic linear predictor and an error distribution (family); the usage includes an offset argument. Families include binomial, gaussian, Gamma, inverse.gaussian, poisson, quasibinomial and quasipoisson.
Python (statsmodels) GLM Generalized Linear Models module lists Binomial, Gamma, Gaussian, InverseGaussian, NegativeBinomial, Poisson and Tweedie families.
Python (statsmodels) GEE A Generalized Estimating Equations module, with covariance structure classes such as Autoregressive, for the correlated-data use that GENMOD covers with REPEATED.

For an overview of statistical modelling in SAS beyond GENMOD, including where other procedures fit, see modelling in SAS.

Sources

Data: PROC GENMOD DIST= keywords with SAS default links and the nearest R stats family

Compiled for this page from the SAS/STAT User's Guide MODEL statement DIST= table (default link per distribution) and the R stats family documentation (default links of the built-in family functions). Where R's stats package lists no matching family the cell says so.

PROC GENMOD DIST= keywords with SAS default links and the nearest R stats family
DIST= keywordDistributionSAS default linkNearest R stats family (default link)
BINOMIALBinomialLogitbinomial (logit)
GAMMAGammaInverse, power(-1)Gamma (inverse)
GEOMETRICGeometricLognot in stats family list
IGAUSSIANInverse GaussianInverse squared, power(-2)inverse.gaussian (1/mu^2)
MULTINOMIALMultinomialCumulative logitnot in stats family list
NEGBINNegative binomialLognot in stats family list
NORMALNormalIdentitygaussian (identity)
POISSONPoissonLogpoisson (log)
TWEEDIETweedieLognot in stats family list
ZIPZero-inflated PoissonLog/logitnot in stats family list
ZINBZero-inflated negative binomialLog/logitnot in stats family list

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about PROC GENMOD in SAS: Syntax, Models and Output

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →